Maple 2015 Questions and Posts

These are Posts and Questions associated with the product, Maple 2015

I am attempting  to show that ocean wave B has a larger velocity than ocean wave A, because wave B has a longer wavelength.


 

I considered the displacement of two particels located at the peak of each wave at time = 0.  Differentiating the two displacement functions I determined the velocity function for each particle.  I used a sequence to determine the velocity for each particle over the time interval 1 to 20 seconds (integer).  The following syntax produces the information I need but I would like to format it as 3 columns in 20 rows, how could I edit the following syntax to do that?

restart;
R := {seq([t, evalf(-sin(t)), -.5*sin(.5*t)], t = 1 .. 20)};

This sequence prints 20 lists of t, evalf(-sin(t)), -.5*sin(.5*t)

What do I need to do to print 3 columns in 20 rows?

The first 3 rows would look something like

1 -0.84147 -0.23971
2 -0.9093 -0.42073
3 -0.14112 -0.49874

I am trying to show that two ocean waves of equal amplitude but different wavelenghts have different velocities and the wave with the largest wavelength will have the greatest velocity.    If someone has a suggestion about how to show this using SHM, any advice welcomed.

Les

 

Dear users! I want to define y-axes like Re^(1/2)*C[f] in the following expression

restart; plot([sin, cos], -Pi .. Pi, title = "Simple Trig Functions", legend = ["Sine Plot", "Cosine Plot"], titlefont = ["ARIAL", 15], labels = ["x values", typeset("Re", C__f)], labeldirections = ["horizontal", "vertical"], labelfont = ["HELVETICA", 16], linestyle = [solid, longdash], axesfont = ["HELVETICA", "ROMAN", 16], legendstyle = [font = ["HELVETICA", 9], location = right], tickmarks = [[-Pi = -180^o, -2*Pi*(1/3) = -120^o, -(1/3)*Pi = -60^o, 0 = `0`^o, (1/3)*Pi = 60^o, 2*Pi*(1/3) = 120^o, Pi = 180^o], default]);

Dear Users!

Hope you would be fine with everything. The following expression doesn't work for M=4,N=2,alpha=1. Please see the problem and try to fix. I shall be very thankful. 

 

simplify(sum(sum(((-1)^i2*GAMMA(N-i2+alpha)*2^(N-2*i2)/(GAMMA(alpha)*factorial(i2)*factorial(N-2*i2)*(N-2*i2+1))*(GAMMA(k+1)*(k+alpha)*GAMMA(alpha)^2/(Pi*2^(1-2*alpha)*GAMMA(k+2*alpha))))*(sum((1/2)*(-1)^i*GAMMA(k-i+alpha)*2^(k-2*i)*(1+(-1)^(N-2*i2+1+k-2*i))*GAMMA((1/2)*N-i2+1+(1/2)*k-i)*GAMMA(alpha+1/2)*L[k]/(GAMMA(alpha)*factorial(i)*factorial(k-2*i)*GAMMA(alpha+3/2+(1/2)*N-i2+(1/2)*k-i)), i = 0 .. floor((1/2)*k))), i2 = 0 .. floor((1/2)*N)), k = 0 .. M))

I have a list of relationships between variables, in this example there are three. The second of these requires one of the parameters to have a relationshipo that is not allowed with one of the other parmaters i.e. k[d2] = k[d1]; the rule is a parameter without h in its name can only be equated to itself or an expression with at least one parameter with h in its name.

How can I eliminate sets with relationships that break this rule?



Sa1 := [{R = R, Rh = R, C[T] = Ch[T]*kh[a1]/k[a2], Ch[T] = Ch[T], k[a1] = kh[a2]*k[a2]/kh[a1], k[a2] = k[a2], k[d1] = k[d1], k[d2] = k[d2], kh[a1] = kh[a1], kh[a2] = kh[a2]}, {R = R, Rh = R, C[T] = C[T], Ch[T] = Ch[T], k[a1] = -(C[T]*k[a2]-Ch[T]*kh[a1]-Ch[T]*kh[a2])/C[T], k[a2] = k[a2], k[d1] = k[d1], k[d2] = k[d1], kh[a1] = kh[a1], kh[a2] = kh[a2]}, {R = R, Rh = Rh, C[T] = C[T], Ch[T] = Ch[T], k[a1] = -k[a2], k[a2] = k[a2], k[d1] = k[d1], k[d2] = k[d1], kh[a1] = -kh[a2], kh[a2] = kh[a2]}]

I am sure that this is a common enough problem. I want to show what commands I'm using to make an output in a maple worksheet in a latex document that i can include in a report.

So far I've got the export feature to work:

(here is an example mapleworksheet, texfile and a corresponding LatexProducedPDF),

but i can't see how to get it to include the commands that create the output.

I have a list of relationships between variables, in this example there are three. The third of these requires at least one of the parameters to take a negative value i.e. kh[a1] = -kh[a2] how do I eliminate sets from a list like this that do that?


Sa1 := [{R = R, Rh = R, C[T] = Ch[T]*kh[a1]/k[a2], Ch[T] = Ch[T], k[a1] = kh[a2]*k[a2]/kh[a1], k[a2] = k[a2], k[d1] = k[d1], k[d2] = k[d2], kh[a1] = kh[a1], kh[a2] = kh[a2]}, {R = R, Rh = R, C[T] = C[T], Ch[T] = Ch[T], k[a1] = -(C[T]*k[a2]-Ch[T]*kh[a1]-Ch[T]*kh[a2])/C[T], k[a2] = k[a2], k[d1] = k[d1], k[d2] = k[d1], kh[a1] = kh[a1], kh[a2] = kh[a2]}, {R = R, Rh = Rh, C[T] = C[T], Ch[T] = Ch[T], k[a1] = -k[a2], k[a2] = k[a2], k[d1] = k[d1], k[d2] = k[d1], kh[a1] = -kh[a2], kh[a2] = kh[a2]}]

Hi, I'm very new to maple and I'm trying to solve  a system of ODEs but as of now it has taken over 5 hours to solve and is still evaluating. i feel as though I may have made some basic mistakes in the code which make the calculation much longer than it should be. I will try tyo explain the problem as well as I can

I'm trying to model a chemical reaction, and solve for the concentrations of two species involved in the reaction after a given time.

The rate of the reaction is given as: r=2900exp(-53300/RT)*Cno^0.62*Cnh3^-0.05;  where R is a constant, T is temperature and Cno and Cnh3 are the concentrations of NO and NH3 respectively. I am interested in solving for Cno and Cnh3 and getting an expression for each of them. I have tried to set up the system of ODEs as follows:

with(LinearAlgebra):

with(DEtools):

r := 2900*(exp(1)^(-53300/R*T)*CNO(t)^0.62*CNH3(t)^-0.05:

ode := diff(CNO(t), t) = -1* r: (negative because they are decaying with time)  

ode2 := diff(CNH3(t), t) = -1* r:

ics := CNO(1020) = 1.6, CNH3(1020) = 1.6; (sets up known initial conditions)

ode := subs(R = 8.314, T = 473, ode):

ode2 := subs(R = 8.314, T = 473, ode2):

sys_ode := (ode, ode2) :

dsolve([sys_ode, ics]);

 

I wonder if the problem has to do with the boundary conditions that I've set or not. Please help as I know I may have set it up very inefficiently which might be causing the problems. Thank you for your help

Dear users!

Hope everyone should be fine here. I need the following simiplification. I did it step by step is there and maple command to do this.

I am waiting your positive answer.

(diff(theta(eta), eta, eta))*(Rd*T[infinity]^3*(`θw`-1)^3*theta(eta)^3+3*Rd*T[infinity]^3*(`θw`-1)^2*theta(eta)^2+(3*(Rd*T[infinity]^3+(1/3)*epsilon*k[nf]))*(`θw`-1)*theta(eta)+Rd*T[infinity]^3+k[nf]) = (-3*Rd*T[infinity]^3*(`θw`-1)^3*theta(eta)^2-6*Rd*T[infinity]^3*(`θw`-1)^2*theta(eta)+(-3*Rd*T[infinity]^3-epsilon*k[nf])*(`θw`-1))*(diff(theta(eta), eta))^2+(-(rho*c[p])[nf]*nu[f]*f(eta)-(rho*c[p])[nf]*nu[f]*g(eta))*(diff(theta(eta), eta))+a*nu[f]*mu[nf]*(diff(f(eta), eta))^2/((-`θw`+1)*T[infinity])-2*a*nu[f]*mu[nf]*(diff(g(eta), eta))*(diff(f(eta), eta))/((`θw`-1)*T[infinity])+a*nu[f]*mu[nf]*(diff(g(eta), eta))^2/((-`θw`+1)*T[infinity])

 

(diff(theta(eta), eta, eta))*Rd*T[infinity]^3*(theta(eta)*`θw`-theta(eta)+1)^3+(diff(theta(eta), eta, eta))*k[nf]*(epsilon*theta(eta)*`θw`-epsilon*theta(eta)+1)+3*Rd*T[infinity]^3*(`θw`-1)*(theta(eta)*`θw`-theta(eta)+1)^2*(diff(theta(eta), eta))^2+epsilon*k[nf]*(`θw`-1)*(diff(theta(eta), eta))^2

 

diff((theta(eta)*`θw`-theta(eta)+1)^3*(diff(theta(eta), eta))*Rd*T[infinity]^3, eta)+diff((epsilon*theta(eta)*`θw`-epsilon*theta(eta)+1)*(diff(theta(eta), eta))*k[nf], eta);

Hi Users!

Hope everyone in fine and enjoying good health. I am facing problem to differential the following expression with respect to first variable (mentioned as red). Please help me to fix this query

f(z*sqrt(a/nu[f]), U*t/(2*x))

Thanks in advance

dS[c] := Gamma*(P*In[a]+R[a]+S[a])-rho*S[c]-S[c]*beta[h]*In[v]/(S[c]+In[c]+R[c]+S[a]+In[a]+R[a]+In[m])-mu[h]*S[c]; dIn[c] := S[c]*beta[h]*In[v]/(S[c]+In[c]+R[c]+S[a]+In[a]+R[a]+In[m])-rho*In[c]-gamma*In[c]-mu[h]*In[c]; dR[c] := gamma*In[c]-rho*R[c]-R[c]*mu[h]; dS[a] := rho*S[c]-S[a]*beta[h]*In[v]/(S[c]+In[c]+R[c]+S[a]+In[a]+R[a]+In[m])-mu[h]*S[a]; dIn[a] := rho*In[c]+S[a]*beta[h]*In[v]/(S[c]+In[c]+R[c]+S[a]+In[a]+R[a]+In[m])-gamma*In[a]-mu[h]*In[a]; dR[a] := gamma*In[a]+rho*R[c]-R[a]*mu[h]; dIn[m] := Gamma*In[a]*(1-P)-mu[m]*In[m]; dS[v] := Gamma[v]-S[v]*beta[v]*(In[c]+In[a]+In[m])/(S[c]+In[c]+R[c]+S[a]+In[a]+R[a]+In[m])-mu[v]*S[v]; dIn[v] := S[v]*beta[v]*(In[c]+In[a]+In[m])/(S[c]+In[c]+R[c]+S[a]+In[a]+R[a]+In[m])-mu[v]*In[v]; solve({dIn[a]=0, dIn[c]=0, dIn[m]=0, dIn[v]=0, dR[a]=0, dR[c]=0, dS[a]=0, dS[c]=0, dS[v]=0}, {In[a], In[c], In[m], In[v], R[a], R[c], S[a], S[c], S[v]}); Warning, solutions may have been lost

Hi

I have the following piecewise function in Maple:

sigmaP:=piecewise(u < -1,-1,u >1,1,u);

Now we can plot this function:

plot(sigmaP,u=-5..5,size=[1200,300],gridlines,discont=[showremovable]);

Next, I define a new piecewise  function as

sigmaF:=u->piecewise(u < -1,-1,u >1,1,u);

and I use this function in 

Fun:=proc(x1,x2,u1,u2)
	2*x1*(1+x2)*sigmaF(u1)+(1+x2^2)*sigmaF(u2);
end proc:

Now I need to find a minimum of this function so I use the following code 

GlobalOptimization:-GlobalSolve(Fun,x1,x2,u1,u2);

where 

x1:=-5..5;
x2:=-10..100;
u1:=-1..1;
u2:=-1..1;

And I have the problem with plot function Fun. How to plot function Fun???

Best

 

Dear Users!

Hope you would be fine with everying. I want to solve the following 2nd order linear differential equation. 

(1+B)*(diff(theta(eta), eta, eta))+C*A*(diff(theta(eta), eta)) = 0;
where A is given as

A := -(alpha*exp(-sqrt((omega+1)*omega*(M^2+alpha+1))*eta/(omega+1))*omega+alpha*exp(-sqrt((omega+1)*omega*(M^2+alpha+1))*eta/(omega+1))+exp(-sqrt((omega+1)*omega*(M^2+alpha+1))*eta/(omega+1))*omega-alpha*omega+exp(-sqrt((omega+1)*omega*(M^2+alpha+1))*eta/(omega+1))-alpha-omega-1)/sqrt((omega+1)*omega*(M^2+alpha+1));
I want solution for any values of omega, alpha, M, B, C and L. The BCs are below:

BCs := (D(theta))(0) = -1, theta(L) = 0.

I am waiting your response, 

I try to get real solutions for a PDE, i.e. real-valued functions depending on real variables. Maple computer complex solutions, i.e. complex-valued functions depending on complex variables.

Here is the example in question: (the four function f1, f2, f3, f4 depend on the four unknowns lam, mu, l, m)

`assuming`([pdsolve([diff(f2(lam, mu, l, m), m)-(diff(f1(lam, mu, l, m), l))-(diff(f4(lam, mu, l, m), mu))+diff(f3(lam, mu, l, m), lam) = 0, diff(f1(lam, mu, l, m), m)+diff(f2(lam, mu, l, m), l)-(diff(f3(lam, mu, l, m), mu))-(diff(f4(lam, mu, l, m), lam)) = 0])], [real])

`assuming`([pdsolve([diff(f2(lam, mu, l, m), m)-(diff(f1(lam, mu, l, m), l))-(diff(f4(lam, mu, l, m), mu))+diff(f3(lam, mu, l, m), lam) = 0, diff(f1(lam, mu, l, m), m)+diff(f2(lam, mu, l, m), l)-(diff(f3(lam, mu, l, m), mu))-(diff(f4(lam, mu, l, m), lam)) = 0])], [real])

How can I solve my problem and receive only real solutions to my PDE?

A similar problem had been posted before (see here), but I can only find a cached version of the post where no answers are displayed.

Dear Users!

Hope you would be fine. In the following maple code, I want to write the derivative of psi in term of psi like it did manually in red portion. For higher M and k it very hard to do it manully. It there any command to fix my problem for any value of k and M.

restart; k := 2; M := 4;

with(linalg); with(LinearAlgebra);

printlevel := 2;

for i while i <= 2^(k-1) do

for j from 0 while j <= M-1 do

psi[M*i+j-M+1] := simplify(2^((1/2)*k)*sqrt(GAMMA(j+1)*(j+alpha)*GAMMA(alpha)^2/(Pi*2^(1-2*alpha)*GAMMA(j+2*alpha)))*(sum((-1)^i1*GAMMA(j-i1+alpha)*(2*(2^k*x-2*i1+1))^(j-2*i1)/(GAMMA(alpha)*factorial(i1)*factorial(j-2*i1)), i1 = 0 .. floor((1/2)*j))));

`&psi;&psi;`[M*i+j-M+1] := simplify(diff(psi[M*i+j-M+1], x))

end do

end do; r := 2^(k-1)*M;

VV := Vector[column](r, proc (i) options operator, arrow; psi[i] end proc);

DV := Vector[column](r, proc (i) options operator, arrow; `&psi;&psi;`[i] end proc);

``&psi;&psi;`[2] := 8*sqrt((alpha+1)*(1/2))*sqrt(2)*sqrt(alpha*GAMMA(alpha)^2*4^alpha/GAMMA(2*alpha))/sqrt(Pi) = 8*sqrt((alpha+1)*(1/2))*psi[1];

`&psi;&psi;`[3] := 16*sqrt((2+alpha)*(alpha+1)/(1+2*alpha))/sqrt(2)*(2*sqrt(2)*sqrt((alpha+1)*GAMMA(alpha)^2*4^alpha/GAMMA(1+2*alpha))*alpha*(4*x+1)/sqrt(Pi)) = 16*sqrt((2+alpha)*(alpha+1)/(1+2*alpha))*psi[2]/sqrt(2)

I am waiting your response. Thanks

Dear Users! 

Hope you would be fine with everything. I want to define a matrix F of M+1 by M+1 order having element of the following form:

I derived the F[r,s] but confuse who to generate matrix now.

restart; M := 5; printlevel := 3; for r from 2 while r <= M+1 do for s while s <= r-1 do if type(r+s, odd) then F[r, s] := 2^(k+1)*sqrt((2*r-1)*(2*s-1)) end if end do end do

First 18 19 20 21 22 23 24 Last Page 20 of 72