Maple 2015 Questions and Posts

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

Hi everybody, 

Here is a piece of a more important worksheet where I need to push the number of Digits farther (Digits:=30:) than the default value.
Nevertheless I don't want to be annoyed by excessively lengthy outputs and I use interface(displayprecision=6).

It seems that the result of an operation which contains only floats is a 6 digits precision number but, as soon as the same operation contains an integer, the displayed precision equals the value of Digits  ???
To be honnest, simpler situations do not exhibit the behaviour shown in the attached file.

Can anyone explain me why I get tho wifferent displays for the quantity names xi__d ? 

As always, great thanks in advance

displayprecision.mw

 

PS : I use Maple 2015.2 on Mac OSX El Capitan

 

I am having some issues with NLPSolve (the code follows). As far as I can tell from the documentation, what is entered is syntactically correct.

 

with(Optimization)
[ImportMPS, Interactive, LPSolve, LSSolve, Maximize, Minimize, 

  NLPSolve, QPSolve]
nlc:={0<=d*(c-a) + c*(b-d), 0<=d*(c-e)+ c*(f-d), 0>=f*(e-a)+e*(b-f), (b-d)<=d*(c-a)+c*(b-d),(f-d)<=d*(c-e)+c*(f-d),(b-f)>=f*(e-a)+e*(b-f),(c-a)<=d*(c-a) + c*(b-d), (c-e)<=d*(c-e)+ c*(f-d), (e-a)>=f*(e-a)+e*(b-f),(c-a)+(b-d)<=d*(c-a) + c*(b-d), (c-e)+(f-d)<=d*(c-e)+ c*(f-d), (e-a)+(b-f)>=f*(e-a)+e*(b-f),2*(c-a)+(b-d)<=d*(c-a) + c*(b-d), 2*(c-e)+(f-d)<=d*(c-e)+ c*(f-d), 2*(e-a)+(b-f)>=f*(e-a)+e*(b-f)}

p:=2*(f-a)*(d-b) - [(d-b)*(c-a) + (d-f)*(e-c) + (f-b)*(e-a)]

NLPSolve(p,nlc)
Error, (in Optimization:-NLPSolve) non-numeric result encountered
 

Any help is much appreciated.

I am working on problems in identifiability and I am interested in how many Lie derivatives of two kinds are required to get a full result for a simple system, and more interestingly a way of visualising what comes out when too few Lie derivatives are used. 

The method is simple, I use Lie derivatives my own program GTS2 to get relationships that must be conserved for the output for two parameter vectors to give the same output (you can find it along with everything else for this question here.

An example of a list of parameter relationships is: 

[{R = R, Rh = Rh, alpha = alpha, C[T] = C[T], Ch[T] = Ch[T], k[a1] = -(k[a2]*C[T]*R-kh[a1]*Ch[T]*Rh-kh[a2]*Ch[T]*Rh)/(R*C[T]), k[a2] = k[a2], k[d1] = k[d1], k[d2] = k[d2], kh[a1] = kh[a1], kh[a2] = kh[a2], kh[d1] = -(k[d1]*x[2]-k[d1]*xh[1]-k[d1]*xh[2]-k[d2]*x[2]+kh[d2]*xh[2])/xh[1], kh[d2] = kh[d2], x[1] = -x[2]+xh[1]+xh[2], x[2] = x[2], xh[1] = xh[1], xh[2] = xh[2]},{...},{...}]

i.e. they will show that there are multiple relationships that satisfy the Lie derivative conditions (each relationship is in a seperate set within the list) and within each set some parameters can vary freely (like R and Rh in the above) and others are determined by the ones that vary freely (like k[a1] and kh[a2]).
 
I want to count the numbers of parameters that have their relationships determined in three different ways so i can plot these numbers as the numbers of both types of Lie-Derivatives vary. These numbers are:
 

  1. N_i number of identifiabile parameters; parameters that in all solutions are of the form {p=ph or ph=p}
  2. N_l number of locally identifiable parameters; parameters that in all solutions take either the form {p=ph or ph=p} or {p=some function of the parameters with hs at the end of their names or ph=some function of exclusively the parameters without hs at the end of their names}
  3. N_u number of unidentifiable parameters; parameters that are neither identifiable or n locally-identifiable. 

    I think its nice to have a link to a worksheet at the end of a question, so here_it_is_again.

Acknowledgement: most of the code in the above was based on snippets written by @Carl Love in response to my previous questions.

EDIT: I had some teaching to do, so uploaded the question early as i was writing in a computer room- as a result the maple worksheet I originally included was confusing, the worksheet I've included in this edit is much easier to understand.

TLDR: i am looking a way to count the numbers of outputs of various types from a program that is built around maples solve feature, and stuck

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*(`&theta;w`-1)^3*theta(eta)^3+3*Rd*T[infinity]^3*(`&theta;w`-1)^2*theta(eta)^2+(3*(Rd*T[infinity]^3+(1/3)*epsilon*k[nf]))*(`&theta;w`-1)*theta(eta)+Rd*T[infinity]^3+k[nf]) = (-3*Rd*T[infinity]^3*(`&theta;w`-1)^3*theta(eta)^2-6*Rd*T[infinity]^3*(`&theta;w`-1)^2*theta(eta)+(-3*Rd*T[infinity]^3-epsilon*k[nf])*(`&theta;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/((-`&theta;w`+1)*T[infinity])-2*a*nu[f]*mu[nf]*(diff(g(eta), eta))*(diff(f(eta), eta))/((`&theta;w`-1)*T[infinity])+a*nu[f]*mu[nf]*(diff(g(eta), eta))^2/((-`&theta;w`+1)*T[infinity])

 

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

 

diff((theta(eta)*`&theta;w`-theta(eta)+1)^3*(diff(theta(eta), eta))*Rd*T[infinity]^3, eta)+diff((epsilon*theta(eta)*`&theta;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, 

First 17 18 19 20 21 22 23 Last Page 19 of 71