Preben Alsholm

13471 Reputation

22 Badges

20 years, 211 days

MaplePrimes Activity


These are answers submitted by Preben Alsholm

The initial conditions should be given as a list of lists even when there is only one point ( here (1,1) ).
 

restart;
with(DEtools):
LC := [diff(x(t), t) = x(t)*(1-x(t)^2-y(t)^2)+y(t)*((1-x(t))^2+y(t)^2), diff(y(t), t) = y(t)*(1-x(t)^2-y(t)^2)-y(t)*((1-x(t))^2+y(t)^2)];
p1 := DEplot(LC, {x(t), y(t)}, t = 0 .. 100, [[x(0) = 1, y(0) = 1]]); ## list of list

 

At least in your simple example converting to Heaviside works:
 

F := a*X+piecewise(Y<0, X, b);
FH:=convert(F,Heaviside);
type(FH, linear(X));

 

There is no need for that kind of requirement.

Your ode has two constant solutions: x(t) = a and x(t) = b/2.

Your ode satisfies requirements for existence and uniqueness of intitial value problems.
Thus a solution starting with x(0) = 0 cannot ever hit x(t) = a or b/2, since this would violate uniqueness.

I once asked Edgardo Cheb-Terrab (in this forum, I think) why the unknown function (here y(t)) had to be given when the series and laplace methods are used while it is not in general necessary otherwise.
In his answer he explained that the code for those two methods were not written by him, but by other people.

So probably the simple answer to your question is that those "other people" didn't implement the eval-variant.
If you try:

dsolve([ode,bc_form_1],y(t),method=laplace);

then you get a rather misleading error message:

Error, (in dsolve/inttrans/solveit) transform method can only be applied to linear ODE
 

 

 

 

Actually Maple 2018 comes up with the correct solution , {T(x, t) = x}, {V(x, t) = 1+cos(w*t)} ,

but Maple 2019 says no solution (i.e. NULL):

restart;
sys_Pde := diff(V(x, t), x, x) = 0, diff(T(x, t), x, x) = 0; 
BC := eval(diff(V(x, t), x), x = 1) = 0, eval(V(x, t), x = 0) = 1+cos(w*t), eval(T(x, t), x = 0) = 0, eval(T(x, t), x = 1) = 1;

res:=pdsolve({sys_Pde}); # General solution
pdsolve({BC, sys_Pde}); # 2018 OK, 2019 NOT OK.
## Check:
Vsol:=subs(res,V(x,t));
Tsol:=subs(res,T(x,t));
res1:=diff(Vsol,x)=0; # So _F3(t) = 0.
res2:=eval(Vsol,x=0)=1+cos(w*t); # So _F4(t) = 1 + cos(w*t).
res3:=eval(Tsol,x=0)=0; # So _F2(t)=0.
res4:=eval(Tsol,x=1)=1; # So _F1(t)+_F2(t)=0. Thus _F1(t) = 1.  (!)
sol:=eval(res,{res1,res2,res3,res4});  # Both missing that _F1(t)=1.
pdetest(sol,{BC, sys_Pde});                # Both missing that _F1(t)=1       

Which Maple version are you using?

OK, I see that the error that you report comes up in Maple 2017.

Notice that your procedure gra only works for the integers 1..200000 (nmax). It doesn't work for e.g. the float 88.0.
The easiest way out of that is to use plots/insequence:

plots:-display([seq(gra(h),h=0..200000,1000)],insequence=true);

 

I shall assume that E = R^3, so just do:
 

int(exp(-x^2-y^2/4-z^2/9),[x=-infinity..infinity,y=-infinity..infinity,z=-infinity..infinity]);

Answer: 6*Pi^(3/2)

If E is not R^3 you should tell us what it is.

@ALIKHADEMI Your boundary conditions (which you call ics) are incorrectly formed.
If I understand your intention then the bollowing would be the correct formulation:
 

bcs:=(D@@2)(ws)(a/2)-lambda=0,(D@@2)(ws)(-a/2)-lambda=0,(D@@3)(ws)(a/2)-lambda=0,(D@@3)(ws)(-a/2)-lambda=0;

Notice that I have left out your 'd' since it is just a factor in all 4 and doesn't depend on y.

With this change there is no solution.
That is not surprising since the general solution of eq9 is a polynomial of degree 5. After 2 differentiations the general solution has lost 2 arbitrary constants leaving us with 2 only, but with 4 requirements.
 

dsolve([eq9, bcs]); # NULL, i.e. no solution
sol:=dsolve(eq9);
collect(rhs(sol),y,factor); # Polynomial of degree 5.

Thus you need to reconsider your boundary conditions.

After the lines with assume and additionally try inserting the lines:
 

addressof(a);
addressof(b);

and you will see that both addresses have changed after addtionally. The assumptions create local variables printed with the tilde.
The global versions evaluate to the latest tilde local.
f and g were created when the second a and b locals were not born only the first.
h was created after additionally, so the b introduced on the right of h is the second local, whereas the b and a in f are still the first.

anames(user) reports the global names, but if you follow with %, you will see what they evaluate to.

You are forgetting a multiplication sign in eq2.
It should be:
 

eq2 := (-beta*x+1)*(-beta*y+1);

Moreover, there is no need for firstequation and secondequation to be functions.
If you want to anyway you should use unapply, otherwise your function only works as you expect if the arguments are literally (rho1,rho2) and that is useless.
 

Try this and you will see that the problem isn't really solved:
 

restart;
eq:=diff(u(x,t),t)+I*diff(u(x,t),x,x)=0;
ic:=u(x,0)=1+cosh(2*x);
sol:=pdsolve({eq,ic});
with(inttrans);
sol;
## Testing the solution given in the pdf file:
sol1:=u(x,t)=1+cosh(2*x)*exp(-4*I*t);
pdetest(sol1,[eq,ic]); # OK

I was using Maple 2018. Maybe Maple 2019 can do better. I don't have access to that.

You should take a look at the help page for evalf/Sum, where it states:


"In the case of infinite sums, Levin's u-transform is used, which has the additional effect that sums that formally diverge may return a result that can be interpreted as evaluation of the analytic extension of the series for the sum (see the examples below).
This behavior can be controlled through the use of the formal option or the _EnvFormal environment variable. If this variable is assigned the value false, or formal=false is specified, then this command will apply some (numeric) convergence tests to determine if the infinite sum in question is convergent, divergent, or otherwise non-convergent."

Try this:
 

S:=Sum((-1)^n*n^2/(n+1),n=1..infinity,formal=false);
evalf(S);

 

You could use:
 

sol1 := dsolve({DE1, DE2, ICs}, numeric, events = [[[x(t)-2, diff(x(t),t)<0], halt]]);

 

In Maple 8 this certainly works: [$65..95]; and I don't get any errors from running your worksheet.
I get the error you have if I try $[65..95];

Could your error message have been left from an earlier misplacement of the left bracket?
That the letter F shows up in the plot suggests that the answer to that question is "yes".

Suggestion:
Remove the error message from your worksheet. Then run the whole thing including restart once again.

You have a loop  running from i= 1 to i= nnp+1 and nnp is set to 10.
The ode system doesn't depend on any parameters including i, thus keep dsolve outside of the loop.
Handle dsolve first. There is indeed a problem with convertsys for some reason. (A bug I suppose).
You can get around that by solving for the derivatives first:

dvars:=indets({sys_ode},specfunc(anything,diff));
SYS:=solve({sys_ode},dvars):
sol:=dsolve(SYS union {ics},numeric,[sv(x),sh(x),L(x),Jir(x),u(x)],output=listprocedure);
SV,SH,LA,JIR,U:=op(subs(sol,[sv(x),sh(x),L(x),Jir(x),u(x)])):
plots:-odeplot(sol,[x,sv(x)],x=0..5000); # Just to see that dsolve/numeric works

Now do the (first) loop.

 

First 13 14 15 16 17 18 19 Last Page 15 of 158