Preben Alsholm

13728 Reputation

22 Badges

20 years, 251 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

Yes, this is a mess:

solve([cos(x)=1/2, x>0, x<2*Pi], x, allsolutions, explicit); #OK
      {x = (1/3)*Pi}, {x = (5/3)*Pi}
solve([cos(x)=1/2,  x>-4*Pi, x<-5*Pi/2], x, allsolutions, explicit); #Ignoring the inequalities
      {x = -(2/3)*Pi*_B2+(1/3)*Pi+2*Pi*_Z2}

@Dmitry I'm not about to speculate on this. I'd like to see an example of what you mean by really different?

@Dmitry The only difference between the 2 regimes is the appearance/disappearance of upsilon in the K-equation. That is handled by piecewise. Thus there is only one system.

Notice now that dsolve/bvp works with the change from psi[S] to psi[s] as mentioned in my answer above.

You want to apply this D to a function L of 2 variables (x and y). So what is d/dy1 supposed to mean?

@Carl Love Thanks for calling my attention to frem.

I suppose something like
mp:=(x,p)->frem(x+p/2,p)+p/2;

might work OK in the present context (if 2*Pi is replaced by evalf(2*Pi)).

That mp(8,2) returns 2. and not 0. seems to be irrelevant here.

@GeorgeReynolds It seems that you misunderstood my latest reply.
My example was intended to show that an error (a strange one) results when using D-format, i.e. when pdeD is used, whereas pde (in diff-format) gives an answer.

@leosh The variable _Z appears in the RootOf expressions in answer

indets([answer],RootOf);
     {RootOf(-L^2*cos(xi)^2+_Z^2+w^2), RootOf(_Z^2-2), RootOf(-L^2+_Z^2+w^2), RootOf(-L^2+_Z^2+2*w^2)}

RootOf(_Z^2-2) (as an example) stands for the roots of the polynomial _Z^2-2, thus stands for sqrt(2) and -sqrt(2).

Use allvalues to get all the roots:

map(allvalues,{answer});

You can avoid the RooOfs by using
answer := solve({equ1, equ2, equ3, equ4, equ5, equ6}, {alpha, sigma, xi, lambda__1, lambda__2, beta__f},explicit=true);

Notice that the two variable arctan is used:  arctan(y,x)
In the help page for arctan you find this:
"For real arguments x, y, the two-argument function arctan(y, x), computes the principal value of the argument of the complex number x + I y , so -Pi < arctan(y, x) and arctan(y, x) <= Pi. "






I had problems with equ6. When I copied your input line to a 1D math line I got the following weird stuff (well, I hate 2D math input with a passion):
`#mi("equ6")` := `#mi("L")`*`#mi("sin",fontstyle = "normal")`(sigma)*cos(xi)-w*alpha*v^2*sin(sigma)/(g*l*cos(xi)^2)

After having corrected that I could concentrate on the problem.
The answer is that solve simply doesn't find any solution, therefore it returns NULL (i.e. nothing).

Could you edit this so we only get the input? As it is now it is unreadable.

In Maple go to Edit/Remove Output/From Worksheet

After that copy all the lines and paste them into the MaplePrimes editor.

@Rouben Rostamian  And the logarithmic plot:

plots:-logplot(abs(myx1(t) - myx2(t)), t=0..4*Pi);


@GeorgeReynolds 
1. Consider the following simple example:
restart;
pde:=diff(u(x,t),t)=diff(u(x,t),x,x);
pdsolve(pde,{u(x,0)=x,u(0,t)=0,D[1](u)(1,t)=1},numeric); ## OK
pdeD:=convert(pde,D);
pdsolve(pdeD,{u(x,0)=x,u(0,t)=0,D[1](u)(1,t)=1},numeric);

Error, (in pdsolve/numeric/process_PDEs) number of dependent variables and number of PDE must be the same

This is clearly a limitation in the implementation of pdsolve/numeric. It is stated explicitly in the help:
?pdsolve,numeric
"The PDE system PDEsys must be specified in diff notation."

There is no complaint from the symbolic solver:
pdsolve(pdeD); #Separates variables
pdsolve({pdeD,u(x,0)=x,u(0,t)=0,D[1](u)(1,t)=1}); #No error, but no result (as I expected)

2. No, surely not. I'm pretty certain that it uses discretization in space as well as in time.



@GeorgeReynolds You cannot use numerical solution unless the parameters are given numerical values. You have 4 parameters with no values given. One is I which you surely don't mean to be the imaginary unit that Maple takes it to be.
There are several solutions to this problem. The simplest (to me) is to rename your I to II or whatever you like.
There are 3 more:

indets(PDE1,name) minus {xi,vartheta};

Output:      {E, a, omega}

########### After that you will run into other problems. To avoid one of them correct your line
convert(PDE1, diff);
## to
PDE1 := convert(PDE1, diff);
## Next problem: Maple's numerical solver is time based. Let us assume that vartheta is your time. Thus it starts from initial values given on the xi interval xi=0..1 (in your case) and proceeds in time from there satisfying whatever boundary conditions are given at xi=0 and xi=1. You don't have any initial values, only boundary conditions.

##Example, where I have replaced I with II:
PDE1 := convert(PDE1, diff);
params:=indets(PDE1,name) minus {xi,vartheta};
parvals:=params=~1; #Setting all 4 parameters to 1
eval(PDE1, parvals); #Just to have a look
#ic:={V(xi,0)=xi,D[2](V)(xi,0)=0}; #An example
ic:={V(xi,0)=xi^2*(1-xi),D[2](V)(xi,0)=0}; #Maybe a better example
pds := pdsolve(eval(PDE1, parvals), bc union ic,numeric);
pds:-plot(vartheta=1);

 

@GeorgeReynolds To use Worksheet interface and 1D math input (in the session or globally) go to (in Windows):


Tools/Options/Display/Input display. Choose Maple Notation.  (i.e. 1D math).
Tools/Options/Interface/Default format for new workswheets. Choose Worksheet.

Finally press either Apply to Session or Apply Globally.

The changes only affects new worksheets.
There is no danger in choosing the latter since the change can always be reverted.  

First 96 97 98 99 100 101 102 Last Page 98 of 230