Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

http://i.imgur.com/JGObjn5.png

 

I tried with and without evalf. Do I need to import something? or something like with Linear Algebra? 

This is pretty similar to my last question. but I found this maple code on a website that is suppose to find a vertex coloring of a graph G. The output is is supposed to be a list for example like [3, table([y = 1, k = 2, c = 2, m = 3, h = 1, x = 1] where the first part (in this case 3) is the number of colors and 1,2,3 in the second part are the colors to which each vertex is assigned.  However, no matter what graph I run this on I get everything equal to 1. such as [1, table([y = 1, k = 1, c = 1, m = 1, h = 1, x = 1])]. Why is this happening?  
color:=proc(G)
  local i, j, C, U, V, total_used;
  V:=Vertices(G); total_used:=1;
  C[V[1]]:=1;
  for i from 2 to nops(V) do
    C[V[i]]:=0;
  end do;
  for i from 2 to nops(V) do
    U:={};
      for j from 1 to nops(neighbors(V[i], G)) do
      U:=U union C[neighbors(V[i], G)[j]];
       end do;
    j:=1;
    while member(j, U) do
      j:=j+1;
     end do;
    C[V[i]]:=j;
    if j>total_used then
      total_used:=j;
    end if;
   end do;
  [total_used, eval(C)];
end:

I'm brand new to Maple and was assigned a problem to modify a code provided by my professor to incorporate variable window size. However, I don't know where to begin or what I'm doing. I've attached the link to the problem below. Plz help.  NA1_Project_IDW_01.2014_Fall.pdf

error in( dsolve/numeric/bvp) unable to achieve the requested accuracy of 0.1e-5 with maximum 128 point mesh (was able to get 0.22e-4), consider increasing `maxmesh` or using larger `abserr`

 

The above is the error message displayed by maple 17. How do I correct this.

Thank you.

 

Adeniyi Michael

Mytest:=module()
    option package;
    
    export
        mymain
        ;
        
        
    # local a,b,c;

    uses LinearAlgebra;
    
    interface(rtablesize=infinity);
    
    
    mymain:=proc(n::integer)

        local ans;
        
        ans:=Vector(n);

        return ans;

    end proc;

end module;

Here is a short piece of code to create a Maple package. It runs fine. Is that possible to hide the code from print() ?

 

with(Mytest);

print(mymain); # which displays the source code

 

Could I hide some of the code? Say I want to use the function mymain() for debugging purpose, but I dont want to make it local to the package. Instead I keep it in "export", but I dont want users to see its code.

 

Thanks!

Hello I am a Maple 15 user and I am using the command fsolve to solve for the intersection of two curves over a specified interval in x, namely from 0 to the lim defined in the Maple document. The specified interval contains asymptotes and when I specify the full interval only one of the three solutions is returned even if I can see that there are three distinct solutions by looking at the plot of RHS and LHS. Should I use another technique to find the solution or is my implementation of fsolve command wrong?

Thanks in advance


restart

with(ListTools):

n1 := 1:

n2 := 1.50:

n3 := 1.40:

lambda := 1.3:

k0 := 2*Pi/lambda:

d := 3:

x0 := k0*d:

arg1 := sqrt(x0^2*(n2^2-n1^2)):

arg2 := sqrt(x0^2*(n2^2-n3^2)):

lim := FindMinimalElement([arg1, arg2]):

sqr1 := sqrt(x0^2*(n2^2-n1^2)-x^2):

sqr2 := sqrt(x0^2*(n2^2-n3^2)-x^2):

LHS := tan(x):

RHS := (sqr1+sqr2)/(x*(1-sqr1*sqr2/x^2)):

plot([LHS, RHS], x = 0 .. lim, y = -6 .. 6)

 

fsolve(RHS = LHS, x = (1/2)*Pi .. 3*Pi*(1/2))

2.634254816

(1)

fsolve(RHS = LHS, x = 3*Pi*(1/2) .. 9*Pi*(1/4))

5.222527128

(2)

fsolve(RHS = LHS, x = 9*Pi*(1/4) .. lim)

7.598486053

(3)

``


Download HW4Q2.mw

Hey guys,

i'd like to create a custom component for maplesim. I opened the template in maple18 and defined the following equations:

eq := [p(t) = p__0+rho*g*h(t), Q(t) = A*(diff(h(t), t)), L(t) = 100*h(t)/h(0)]

These equations describes a tank with a liquid in it. Now I tried to define a function L(t) (above) that gives the level of the tank in percentage. Therefore I need the initial height value at t=0. The function defined above (h(0)) does not work, cause maple tells me that the function does not exist.

Any hint how to get an initial value or a value at t=0? Or maybe another way to solve my problem?

Hopefully I described right. :-)

Best regards

Christian

I am numerically solving a nonlinear system of nine equations. How long can I expect it to take?

I have run it for 30 minutes and it has not solved yet.

Here is the system of equations:

0=Lambda-mu.*S-beta.*(H+C+C1+C2).*(S./N)-tau.*(T+C).*(S./N);

0=tau.*(T+C).*(S./N)-beta.*(H+C+C1+C2).*(T./N)-(mu+mu_T).*T;

0=beta.*(H+C+C1+C2).*(S./N)-tau.*(T+C).*(H./N)-(mu+mu_A).*H;

0=beta.*(H+C+C1+C2).*(T./N)+tau.*(T+C).*(H./N)-(mu+psi.*mu_A+mu_T+lambda_T).*C;

0=lambda_T.*C-(mu+mu_A+rho_1+eta_1).*C1;

0=rho_1.*C1-(mu+mu_A+rho_2+eta_2).*C2;

0=eta_1.*C1-(mu+rho_1+gamma).*CT1;

0=eta_2.*C2-(mu+rho_2+gamma.*(rho_1)./(rho_1+rho_2)).*CT2+(rho_1).*CT1;

0 = N - S - T - H - C - C1 - C2 - CT1 - CT2;

and I have numeric values for Lambda, beta, tau, mu, mu_T, mu_A, rho_1, rho_2, psi, gamma. The only parameters left are eta_1, eta_2.

Thank you.

Hi everyone.

I wrote simple program with several functions. I would like to obtain parallel computing of my functions. I can't understand how to use nodes.

My programm.

Simple_example.mw

I'm trying to solve a series of equations and then graph them. I'm trying to solve for the variables involved:

values := solve({eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9,

eq10, eq11, eq12, eq13, eq14, eq15, eq16}, {a, b, b, c, d, e, f,

g, h, i, j, k, l, m, n, o, p});

 

. . . but it gives me this:

Warning, solving for expressions other than names or functions is not recommended. 

values := 

A major-league pitcher releases a ball at a point 6 feet above the ground and 58 feet from home plate at a speed of 100 mi/hr ,  

If gravity had no effect, the ball would travel along a line and cross home plate 4 feet off the ground. Find the drop D caused by gravity.                                                                                                                                                      

 

NB: in this problem the angle alpha is the angle between the horizontal and the direction of the released ball. Since the ball is dropping, alpha will be negative.

Let N be an integer. 

 

For each pair of integers (n,m) where 1<= n,m <= N, we have a variable f_{n,m}(t). 

 

Then for these we have a system of ODEs 

 

d/dt f_{n,m}(t) = \sum_{n', m'} f_m'n' * f_m''n'' * (m'n'' - m''n') 

 

where m''=m-m', n''=n=n', and the sum is simply over for all pairs (n',m'). 

 

I simply do not know how to put these set of equations into Maple in a nice way. 

 

I will really appreciate any help!

Hello,
Maple does not cancel out a variable.

Why is that?

Is there a way to solve this? 

(I pasted my code on the bottom of this message)

 

Thanks for your help/advice,

Stephan

restart:
M(x):=piecewise(x<=l,1/2*(q*x^2)/(EI)-3/8*(q*l*x)/(EI),l<x,1/2*(q*x^2)/(EI)-13/8*(q*l*x)/(EI)+5/4*(q*l^2)/(EI)):
M(x):=M(x)*(-EI);
# simplify() does not work.....?
M(x):=simplify(%) assuming EI>0;
# Wiht EI cancelled out by hand it schould look like:
M(x):=piecewise(x<=l,1/2*(q*x^2)-3/8*(q*l*x),l<x,1/2*(q*x^2)-13/8*(q*l*x)+5/4*(q*l^2));

 

Hi!


Please find my Maple-worksheet attached below.

 

How do I solve this problem? I can not drawn it.

I would really appriciate if somebody could help me. 

Hi!

I am quite new to Maple and have a problem I've been struggling with all day.

I have a spring pendulum and have to develop the equation of motion in the y-direction. The pendulum consist of a mass at the end of a elastic, unbendable and massless rod. 

Please find my Maple-worksheet attached below.

How do I solve the differential equation 2.9 for y(t)? As far as I can see the problem is that I have to differentiate y(t), which is not designated as a function, with respect to y (?)

I would really appriciate if somebody could help me. 

Thank you in advance!

First 188 189 190 191 192 193 194 Last Page 190 of 2097