Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@tomleslie Obviously the real value is wrong since it must be larger than -2 if the following plots can be believed:
 

int(-1/(1-x)^(1/2),x=0..1);
plot([Re(eval(W,{s=1,t=3,w=-2,m=-1})),-1/(1-x)^(1/2)],x=0..1);

 

@tomleslie laurent only exists as numapprox:-laurent and as such you can see that it relies entirely on the builtin procedure series.

showstat(numapprox:-laurent);

'laurent' is also a type:

showstat(`type/laurent`);

@pazduha Your k can be written simpler:
 

k2:=piecewise(t < t1, kmax, t < 2*t1 + sqrt(2)*t1, -kmax, t < 3*t1 + 2*sqrt(2)*t1, kmax, t < 4*t1 + 2*sqrt(2)*t1, -kmax, 0);

piecewise works this way: If the first condition is satisfied then you get the value given in the second argument no matter what the other conditions are.
If the first condition is not satisfied, then the next condition is considered: If true then the value following that condition is returned, if not then on to the third condition etc.
Since your times t1, 2*t1 + sqrt(2)*t1, 3*t1 + 2*sqrt(2)*t1, 4*t1 + 2*sqrt(2)*t1 are increasing (when t1 >0) then the "And" you are using is unnecessary.
Finally if the last condition (here  t < 4*t1 + 2*sqrt(2)*t1) is not satisfied, you don't need an extra condition together with a value. Just give the value (here 0). You can if that value is actually 0 leave it out; it will be assumed to be zero.

@Muhammad Usman
(1) Your triple loop begins with m = n = k = 0. thus exp(k*eta[3] + m*eta[1] + n*eta[2]) = 1.
     this explains the error.
(2) The first argument to coeff is supposed to be a polynomial in a variable or expression (your case).
     Your Eq1 is a fraction: try numer(Eq1) and denom(Eq1).
     So Eq1 is not a polynomial in exp(k*eta[3] + m*eta[1] + n*eta[2]) for any m,n,k with m+n+k>0.

You should let us know what you are actually looking for.

Eq2 is not defined in that worksheet.

@rcorless Actually odetest also works:
 

odetest(y(t)=theta,diff(y(t),t,t)+omega^2*sin(y(t))=0);  # 0

where theta is defined as in your worksheet.

@rcorless I managed to get zero by treating the two terms in the ode differently:
 

restart;
k := sin(alpha/2);
theta := 2*arcsin(k*JacobiSN(omega*t, k));
t1:=expand(omega^2*sin(theta));
t2:=simplify(diff(theta, t, t));
simplify(t1+t2);  # 0

 

@Muhammad Usman XJTU Since you say that you are new to Maple and have little knowledge of it, you probably shouldn't have just taken over the code written by somebody else for another ode.
Your ode as presented in Maple code is first order, so as pointed out by Tom Leslie and Rouben Rostamian you are only allowed one condition and shooting doesn't make any sense.
Rouben suggests that you present your problem in words and not in Maple code.
I think you should do that. Is your intended ode actually the one we see?

You don't seem to be defining the function PHIb anywhere. What is it?

Perhaps needless to say, but the user needs kernelopts(floatPi=true) as the code is written. That setting is the default.
I have chosen not to use it though,so I just replace 2.*Pi by twoPi, where twoPi is
local twoPi:=evalf(2*Pi).

@vv My guess is that he mistakenly thinks that the expression depends on the ratio L/z only.
That is not correct, which I guess is your reason for wondering.

A simple counterexample is given here:

restart;
ex := L/(z*sqrt(z^2 + L^2));
eval(ex,{L=1,z=1}); # L/z = 1
simplify(eval(ex,{L=2,z=2})); # L/z =1
## Those are not equal
##
simplify(eval(ex,L=LDZ*z)) assuming z>0; # LDZ=L/z


 

@Thomas Richard I quite agree! But in a moment of I don't know I did this:
 

restart;
eq2:=efe+x1*sinh(y1*l/r1)+x2*cosh(y1*l/r1)=0;
eq3:=efe+x1*sinh(-y1*l/r1)+x2*cosh(-y1*l/r1)=0;
solve({eq2,eq3},{x1,x2});
eq2+eq3;
eq2-eq3;

and we see that the last two lines confirm the solve result which is

{x1 = 0, x2 = -efe/cosh(y1*l/r1)}

Thus we really need to see that worksheet!

@Rouben Rostamian  As for the difficulty of using dsolve backwards in time because of instability we can use your x__ss integral instead.
For the present concrete case x__ss is even as a function of t:
 

x__ss := Int(exp(-s + 1/100*cos(10*t) - 1/100*cos(-10*t + 10*s)), s = 0 .. 10); # Using 10 instead of 7

This integral obviously can be computed numerically with equal ease for negative as well as positive t.

Picking x0 = 1.00997547504228, Digits = 15, abserr = 1e-18, relerr = 5e-13, and using 10 instead of 7 in x__ss makes the plots of x__ss and x_exact look the same on -13..10, but dsolve starts "falling down" after that. Your x__exact doesn't.

Graphing the difference between x__exact and x__ss on just t = -10 .. 2 we get


It gets much worse for on -13..2.

### Added.
Changing T to 20 we get this difference:

So using X__ss is the way to go!

@Rouben Rostamian  That is very nice indeed.
A comment:

1. It could be mentoned that while x(t) = xtr+xss is a solution to de neither xtr or xss is a solution to the de.
2. I do believe,however, that there must be a solution defined on the whole real axis. That solution is periodic. All other solutions will tend to either -infinity or +infinity as t -> -infinity.

## The argument for part of point 2 is that the the horizontal strip { (t,x) |  10/11 < x < 10/9 } is positively invariant. In fact the right hand side of the ode f(t,x) is negative for any x > 10/9 and positive for x < 10/11.
Outside the strip the solutions will grow exponentially backwards in time. The ones above the strip will go to +infinity, those below to - infinity.
Consider the x-interval  I = (10/11, 10/9). Starting at any arbitrary time t0 with x(t0) in that interval there are 3 possibilities when going backwards in time: Either the solution leaves the strip upwards to infinity (case 1), downwards to minus infinity (case 2), or stays in the strip for all times (case 3).

Using existence and uniqueness of the initial value problem for this ode we see that the solutions belonging to cases 1 and 2 correspond to non-overlapping open subintervals of the interval I.
The interval of x-values corresponding to case 3 must be closed and not empty, possibly consisting of just one point.
This still leaves open the possibilty that this last interval consisting of solutions that stay in the strip for all negative as well as positive times consists of more than one point.

In our present example surely it seems that there is only one point.


Notice that that x-point will depend on the chosen value of t0. When t0 = 0 is chosen it is something like x0 = 1.00997547504228. Because of the obvious instability in the negative direction solving numerically from (0, x0) will not give us the solution in that direction:

 

First 20 21 22 23 24 25 26 Last Page 22 of 231