Preben Alsholm

MaplePrimes Activity

These are answers submitted by Preben Alsholm

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):

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:
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:



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


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:


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
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:


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:

## Testing the solution given in the pdf file:
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:



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".

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:

sol:=dsolve(SYS union {ics},numeric,[sv(x),sh(x),L(x),Jir(x),u(x)],output=listprocedure);
plots:-odeplot(sol,[x,sv(x)],x=0..5000); # Just to see that dsolve/numeric works

Now do the (first) loop.


Replacing int with an approximate integrator and using LSSolve I find for the updated system this answer from LSSolve:
sol := [5.53989661895405, [d1 = -0.000305007492156158, d2 = 12.0947160055038, mu = -1894.38456773538]].
sol[1] is the sum of squares divided by 2. Thus Eq1^2+Eq2^2+Eq3^2 > 11 for the values found for d1, d2, and mu.
The signs of d1 and d2 are irrelevant since only their squares appear in the equations.
This doesn't prove that there is no solution, but it raises that suspicion.

An example of what I'm talking about is the following which uses a different integrator than I used for the result above:

RES_AP:=eval([Eq1, Eq2, Eq3],int=rcurry(Student:-Calculus1:-ApproximateInt,method=simpson,partition=51)):
sol:=Optimization:-LSSolve(RES_AP, variables={d1, d2, mu},iterationlimit=2000);
eval([Eq1, Eq2, Eq3],sol[2]);

The result here is
sol := [5.53989661896720, [d1 = -0.000973253903034116, d2 = -12.0947149137687, mu = -1894.38455370635]]
and the 3 residuals (i.e. Eq1,Eq2,Eq3)  are
[2.3533083414644, -2.3540885251539, -0.0005510445]

You could try a Riemann sum, i.e. replace the integral with one of the two sums

add( a2F[i]/w[i]*(w[i+1]-w[i]), i=1..N-1);
add( a2F[i]/w[i]*(w[i]-w[i-1]), i=2..N);

where N = 500.  As the final result you may choose the average of the two.
If the w-values are too far apart for that approch to make sense you could find a spline approximation for a2F using CurveFitting:-Spline. Then just integrate that approximation.

A home made example, where I construct my own data: W and F.
F is just sin applied to the values in W.

W:=[seq(1..N1/10,0.1)] + ['r()'$N1-9]: 
int(f/w,w=min(W)..max(W),numeric); # Takes a little while.
int(sin(w)/w,w=min(W)..max(W)); # For comparison.


In your worksheet Q is being defined as a function.
Try after the lines you have to write Q(t);
Then your integral is evaluated.
In Maple input (1D input and preferred by many) you could do:

P := t->r*Q[inf]/(2 + 2*cosh(-r*t + b));
int(P(s), s = 0 .. t);

Then you can try various simplifications.

You can do like this:


ini1:= x(0)=0.5,y(0)=0.5,z(0)=0;
dsys:={diff(z(t),t)=-(N1+M*cos(2*w*t))*z(t)-1+f*(x(t)+y(t)), diff(x(t),t)=-(N1-I*w-2*M*exp(-2*I*w*t))*x(t)-f*(N1+(z(t)))-2*f*M*exp(2*I*w*t),diff(y(t),t)=-(N1+I*w-2*M*exp(2*I*w*t))*y(t)-f*(N1+(z(t)))-2*f*M*exp(-2*I*w*t)};
### The crucial difference:
res:=dsolve(dsys union {x(0)=0.5,y(0)=0.5,z(0)=0},numeric,output=listprocedure);


plots[odeplot](res,[[t,zd]],0..6,axes=boxed,color=blue,tickmarks=[3, 4],thickness=2,title=tit,size=[700,default],numpoints=1000);

4 5 6 7 8 9 10 Last Page 6 of 149