Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@zhkhan There appears a G, which apparently is just a name.

@zhkhan There appears a G, which apparently is just a name.

@zhkhan I'm not sure what you mean.

But the two larger roots start their existence at the following value for l: 

fsolve({diff((rhs-lhs)(A),sigma)=0,(rhs-lhs)(A)=0},{sigma,l=3.5});

 Output: {l = 3.531408488, sigma = -32.34143629}

I just used the default setting of Digits = 10.

Both roots can be found by RootFinding:-NextZero:

r1:='r1': r2:='r2':
for l from 3.7 by .1 to 5 do
   r1:=RootFinding:-NextZero(unapply((rhs-lhs)(A),sigma),-120);
   if r1<>FAIL then r2:=RootFinding:-NextZero(unapply((rhs-lhs)(A),sigma),r1) end if;
   print(l,r1,r2);
end do:
l:='l':

There will be numerical problems when the first of the two roots is close to the singularity of rhs(A), which happens for larger values of l.

@zhkhan I'm not sure what you mean.

But the two larger roots start their existence at the following value for l: 

fsolve({diff((rhs-lhs)(A),sigma)=0,(rhs-lhs)(A)=0},{sigma,l=3.5});

 Output: {l = 3.531408488, sigma = -32.34143629}

I just used the default setting of Digits = 10.

Both roots can be found by RootFinding:-NextZero:

r1:='r1': r2:='r2':
for l from 3.7 by .1 to 5 do
   r1:=RootFinding:-NextZero(unapply((rhs-lhs)(A),sigma),-120);
   if r1<>FAIL then r2:=RootFinding:-NextZero(unapply((rhs-lhs)(A),sigma),r1) end if;
   print(l,r1,r2);
end do:
l:='l':

There will be numerical problems when the first of the two roots is close to the singularity of rhs(A), which happens for larger values of l.

@zhkhan You may want to take a look at ExportMatrix.

@zhkhan You may want to take a look at ExportMatrix.

Since you are solving the ode numerically it may be a better idea to keep the second order equation (i.e. Newton's 2nd law). Your first order equation is obtained by multiplying the 2nd order equation by diff(theta(t),t) and integrating. This equation is not equivalent to the original.

Since you are solving the ode numerically it may be a better idea to keep the second order equation (i.e. Newton's 2nd law). Your first order equation is obtained by multiplying the 2nd order equation by diff(theta(t),t) and integrating. This equation is not equivalent to the original.

Could you provide the actual code?

You are right. One of my equations was wrong.

My system should have been

sys:={diff(y(t),t)=a*y(t)*x(t)^(3/2)-b*y(t)^(3/4),diff(x(t),t)=x(t)^2*(c*y(t)^(7/4)-d*sqrt(x(t)))};

The rewriting as a system is of course not uniquely given from dy/dx = g(x,y)/f(x,y) since we also have

dy/dx = g(x,y)*h(x,y)/(f(x,y)*h(x,y)).

 

You are right. One of my equations was wrong.

My system should have been

sys:={diff(y(t),t)=a*y(t)*x(t)^(3/2)-b*y(t)^(3/4),diff(x(t),t)=x(t)^2*(c*y(t)^(7/4)-d*sqrt(x(t)))};

The rewriting as a system is of course not uniquely given from dy/dx = g(x,y)/f(x,y) since we also have

dy/dx = g(x,y)*h(x,y)/(f(x,y)*h(x,y)).

 

Your problem is that x in F and G is not seen by the procedures f and g till it is too late.

A minimal change scenario:

F := sin(x);

G := cos(x);

f := proc (x1) options operator, arrow; eval(F,x=x1) end proc;

g := proc (x1) options operator, arrow; eval(G,x=x1) end proc;

h := proc (x) options operator, arrow; f(g(x)) end proc;

h(x);

@kms

Something like this:
eqn1 := u = V*cos(a)*cos(b);
eqn2 := v = V*sin(b);
eqn3 := w = V*sin(a)*cos(b);
res:=solve({eqn1,eqn2,eqn3},{V,a,b});
map(tan,res[2]);
map(x->x^2,res[1]);
simplify(%);
map(sin,res[3]);
simplify(%);

@kms

Something like this:
eqn1 := u = V*cos(a)*cos(b);
eqn2 := v = V*sin(b);
eqn3 := w = V*sin(a)*cos(b);
res:=solve({eqn1,eqn2,eqn3},{V,a,b});
map(tan,res[2]);
map(x->x^2,res[1]);
simplify(%);
map(sin,res[3]);
simplify(%);

@mois Acer's second objection seems relevant especially when using procedures not made by the user as in the following simple example,

Search(sin,[y>=1,y<=2]);
Search(sin,[x>=1,x<=2]);

The reason the latter works and not the former is because x is the name of the formal parameter used by Maple's sin procedure according to

op(1,eval(sin));

I have made a habit of telling my students that the function x - > x^2 is exactly the same as the function y - > y^2.

The variables option is a solution:

Search(sin,[y>=1,y<=2],variables=[y]);

But obviously in this case you could just do

Search(sin(y),[y>=1,y<=2]);

First 210 211 212 213 214 215 216 Last Page 212 of 231