Preben Alsholm

13471 Reputation

22 Badges

20 years, 212 days

MaplePrimes Activity


These are answers submitted by Preben Alsholm

In Maple 13 you can do

solve(cos(2*theta)=1/2,theta,AllSolutions);

I don't think you can do that in Maple 10, but you can do this (also in Maple 13) (notice the underscore):

_EnvAllSolutions:=true:
solve(cos(2*theta)=1/2,theta);

Here B1 can be 0 or 1 and Z1 represents an (arbitrary) integer.

Preben Alsholm
 

 

Your equation 12 should have ( ) instead of [ ].

Preben Alsholm

 

I don't know exactly what you mean by saying "it is for x = 0", since in fact you plot for x = 0..10.

However, your functions drops in magnitude really fast, so plotting in the interval x = 0..0.001 makes it possible to actually see waves.

restart;
u:=A*exp(-sqrt(w/(2*a^(2)))*x)*cos(-sqrt(w/(2*a^(2)))*x+w*t);
w:=10;
A:=4;
a:= 4*10^(-3);
plot3d(u, x = 0..0.001, t = 0 .. 2,axes=boxed);

Preben Alsholm
 

You may do something like this: Start orbits in directions of eigenvectors of the jacobian at the saddle point and close to it (epsilon below).

with(LinearAlgebra):
G:=(k,c)->c*(alpha*k^(alpha-1)-delta-rho-theta*g)/theta;
F:=(k,c)->k^alpha-c-(n+g+delta)*k;
J:=unapply(VectorCalculus:-Jacobian([F(k,c),G(k,c)],[k,c]),k,c):
J(25,3.5);
Lambda,V:=op(simplify([Eigenvectors(%)]));
#Using simplify to remove 0.*I
eps:=.01:
ivp:=[[k(0) = kss+Column(V,1)[1]*eps, c(0) = css+Column(V,1)[2]*eps],[k(0) = kss-Column(V,1)[1]*eps, c(0) = css-Column(V,1)[2]*eps],[k(0) = kss+Column(V,2)[1]*eps, c(0) = css+Column(V,2)[2]*eps],[k(0) = kss-Column(V,2)[1]*eps, c(0) = css-Column(V,2)[2]*eps]];
phase := DEplot(RAMSEY, [k(t), c(t)], t = -200 .. 100, k = 0 .. 100, c = 0 .. 10, ivp,arrows = small, title = `Ramseyho model`, color = magnitude,linecolor=red,stepsize=.1);
display({nulc, nulk, phase});
 

Preben Alsholm

Since the expression ((10.-t*n)/n)^1.5 appears in your expression r, you need  t*n <=10.

You can try this, where I let n take the integral values k = 1, 2, 3, 4, 5.

seq(Optimization:-NLPSolve(r,{a<=b,n=k,a>=4,t*n<=9.99} , assume=nonnegative,maximize),k=1..5);

Preben Alsholm

It is NEVER a good idea to use t and t[1] in the same calculations. t[1]:=67; is an implicit assignment to a table called t.

Change t[1] to t1 and start over.

Preben Alsholm

 

 

Are there no other restrictions than a, b, n, t positive and a < b? What about n?

Any reason to believe that there is a minimum?

Preben Alsholm

Sometimes it takes a long time for Maple to figure out how to write output to the screen. If you have no need to see it anyway, then suppress it by using colon.

I have added an axes option so you see something also in the first frame of the animation. Also I have used a list in display instead of a set.

restart;
with(plots):
with(plottools):
a := seq(sphere([1, 1, 1], 5*i), i = 0 .. 10):
b := seq(sphere([3, 3, 3], 5*i), i = 0 .. 10):
display(a[4]);
display([a, b], insequence = true,axes=normal);
 

Preben Alsholm

Try the following:

240*t^3 + 144*t^2- 135*t -52 =0:
solve(%,t):
simplify(evalc([%]));
         

Preben Alsholm

You can also do like this, where I avoid D and use B (irrelevant here, but remember that D has a special meaning in Maple):

e1 := 1.74*10^(-15) = B*exp(-Q/(8.31*1473));
e2 := 7.1*10^(-15) = B*exp(-Q/(8.31*1573));
solve(convert({e1, e2},rational), {B, Q});
evalf(%);

Preben Alsholm
 

There are two cases, if you want an arctan with one argument.

y:=cos(w*t-arctan(2*s0^3*w, -s0^2*(-s0^2+w^2)));

simplify(y) assuming s0>w,w>0;
simplify(y) assuming s0<w,s0>0;
 

Preben Alsholm

I have used D1 instead of D, since D is used for differentiating functions (procedures).

A:=B+C*Z+D1^2*Z^2;
S:={B=0.01, C=0.2, D1=0.3};
eval(A,S union {Z=1});
SBC:=remove(has,S,D1);
plot(eval(A,SBC union {Z=1}),D1=0..1);

Preben Alsholm
 

Since you didn't provide the form of the input to dsolve I'll have to guess.

Here is a very simple example that results in a similar error message.

eq:=diff(x(t),t)=x(t):
dsolve({eq,x(0)=1},x(t),y(t),numeric);
Error, (in dsolve/numeric/process_input) received more than one indication of the dependent vars [x(t), y(t)]

The correct syntax is

dsolve({eq,x(0)=1},x(t),numeric);

or just

dsolve({eq,x(0)=1},numeric);

See line 24 of the procedure `dsolve/numeric/process_input` :

showstat(`dsolve/numeric/process_input`);
 

Here is a system version:

eq1:=diff(x(t),t)=y(t):
eq2:=diff(y(t),t)=-x(t):
dsolve({eq1,eq2,x(0)=1,y(0)=0},x(t),y(t),numeric);
Error, (in dsolve/numeric/process_input) received more than one indication of the dependent vars [x(t), y(t)]

Correct syntax:

dsolve({eq1,eq2,x(0)=1,y(0)=0},[x(t),y(t)],numeric);

or just

dsolve({eq1,eq2,x(0)=1,y(0)=0},numeric);

Preben Alsholm

Could you give us a, maybe simplified, version of the actual code that provokes this?

The following returns true

evalb(0. < 59.92088005+55.46829645*ln(.4804980261));

but this

evalb(0. < 59.92088005+55.46829645*ln(Pi));
returns the inequality, so that

if 0. < 59.92088005+55.46829645*ln(Pi) then "OK" end if;

results in an error message, because evalb is used in the 'if' statement.
 

Preben Alsholm

Maybe I don't get your point, but the output of the procedures don't have to depend on all parameters. 

Here I have chosen an example from the help page for NLPSolve and turned it into a procedural version with 4 superfluous arguments.

with(Optimization);
p:=proc(x,y,z,v,w,d1,d2,d3,d4)::float[8] ;w^3*(v-w)^2+(w-x-1)^2+(x-y-2)^2+(y-z-3)^2 end proc:
p1:=proc(x,y,z,v,w,d1,d2,d3,d4)::float[8]; w+x+y+z-5 end proc:
p2:=proc(x,y,z,v,w,d1,d2,d3,d4)::float[8]; 3*z+2*v-3 end proc:
res:=NLPSolve(p, {p1}, {p2}, assume = nonnegative,initialpoint=[1,1,1,1,1,0,0,0,0]);

Preben Alsholm
 

First 152 153 154 155 156 157 158 Page 154 of 158