Preben Alsholm

13728 Reputation

22 Badges

20 years, 254 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@Carl Love I find no visible difference for alpha, but a clear difference for beta.
Also I don't see any difference between method=rkf45_dae and method=rkf45 when using [diff(eq1, t), eq2, CI].
The reason for the latter must be that we got two second order equations for which the second derivatives can be isolated and we have the necessary initial conditions in CI. I guess then that rkf45_dae simply uses rkf45.

At this moment it is not clear to me why the solutions for alpha seem to be the very same. My eq3 contains alpha only, not beta. Thus it can be solved separately if one wishes.

There is no similar situation when using diff(eq1,t), eq2.
###
Looking somewhat closer at the values of alpha they do appear to be different in the two situations as one would expect.


 




@digerdiga In the expression D(x)(x) the first x must be a (mathematical) function (as sin is as opposed to sin(x)).
Thus D(x) is the first derivative of the function x. There is no name attached to the independent variable. Why should there be, and how could there be?  It would be irrelevant in any case.

D(x)(x) then is the derivative of the (not defined) function x applied to the variable name x which happens to be the same as the name of the function. This is obviously an oddity. With other letters: It is like f ' (f);
It is acceptable in Maple, but clearly does not mean the same as diff(x,x), where the first argument to diff is an expression (presumably, but not necessarily) dependent on the second argument to diff: the variable x. Obviously here, the expression x does depend on x, is in fact x, so the derivative is 1.

@Glowing Have you tried using assuming T1<T2 right after dsolve, as in

dsolve(ode) assuming T1<T2;

There are a couple of issues in addition to tomleslie's point 2.

1. Since z is time pdsolve/numeric will have to solve for diff(r(z,theta),z) one way or the other since the algorithm is time based. However, that could be a problem as you see by looking at the RootOf result here:
solve(PDE,{diff(r(z,theta),z)});
The result is RootOf of a polynomial of degree 8. Thus if for given numerical values there is a real root there is certainly at least one more, and of course there need not be a real root.
2. Replace epsilon by epsilon:=evalf(epsilon); The reason is that a test similar to the following is performed:
if sqrt(2)>1 then "yes" else "no" end if; #Try it!

@tomleslie It is usually the case that Maple treats an expression expr supposed to be an equation expr=0 as exactly that,

thus for e.g.
solve(x^2-2, x);
fsolve(x^2-2,x);
dsolve(diff(y(x),x)-y(x) );
pdsolve( diff(u(x,y),x)+diff(u(x,y),y) );
pdsolve(diff(u(x,y),x)+diff(u(x,y),y),{u(x,0)=1,u(0,y)=sin(y)},numeric,time=x,range=0..evalf(Pi));

@alla Do other requests for help work, e.g.

?int

?simplify

?diff

What are the error messages you receive?

@tomleslie It should be pointed out that the numerical solution for U(x) found by using SYSxt4 is not differentiable at x=2 (still using x0=1). That is, if we take the numerical solution to be an approximation of U(x)=0 for x>2. Otherwise one must say that the solution is wrong for x>2.

I was somewhat surprised that there weren't any error messages from the numeric solver as there was when considering the original system and using rkf45_dae.

This system was discussed earlier in a related question by patient and he gave a symbolic solution.
http://www.mapleprimes.com/questions/204142-Error-in-DEtoolsconvertsys-Unable

restart;
SYSxt4:={diff(S(x), x) = -(-2*sqrt(S(x))*U(x)+2*S(x))/x, diff(U(x), x) = -U(x)*(-4*U(x)^2*sqrt(S(x))+8*U(x)*S(x)+3*S(x)^(3/2)*x^2-4*S(x)^(3/2))/(S(x)*x*(8*U(x)+x^2*sqrt(S(x))-4*sqrt(S(x))))};
#The symbolic solution is
SOL:={S(x) = exp(-(1/4)*x^2), U(x) = -(1/4*(x^2-4))*exp(-(1/8)*x^2)};
#Check:
odetest(SOL,SYSxt4);
simplify(%) assuming real;
ICS:={S(1) = exp(-1/4), U(1) = (3/4)*exp(-1/8), (D(S))(1) = -(1/2)*exp(-1/4)};
subs(x=1,ICS[1..2],SOL);
#The solution SOL of SYSxt4 and ICS[1..2] is certainly the only one in the open interval (0,2).
At x=2, U(x)=0, so the numerator and denominator of the expression for diff(U(x),x) in SYSxt4 are both zero, which clearly would be a problem for the numerical solver.
The exact solution has limiting derivative at x=2 equal to -exp(-1/2), i.e. not zero.

How about making use of the examples in the help page for dsolve:

?dsolve

@momoklala I guess we can just keep going on forever with changing values for the parameters.

Basically you must study and try the different options for dsolve/numeric/bvp.

Solving bvp problems can be challenging.

So how do you propose to get rid of diff(S(x),x,x)?

If somebody is going to do anything on this, he will surely like code that can be copied and pasted!

@momoklala With (now S=0.5  !!!) you just need to add the option initmesh=512 to the dsolve command that I gave earlier.

@momoklala The image you provided just proves to me that somehow this error was produced.
But I cannot even see the whole worksheet.

To get anywhere from here we shall need the actual worksheet, not an image of it.
To upload a worksheet (i.e.. the mw-file itself) use the thick green arrow in the editor to the right.

@Alejandro Jakubi Thanks for digging deeper into this. The difference between pp and qq is illuminating.

I submitted a bug report about convertsys giving the example diff(x(t),t,t) + diff(a(t),t,t) = 0.

Although surely the procedure was intended primarily for dsolve/numeric, it is not mentioned in the documentation that known functions can contain no derivatives.
I ran into this problem several years ago as mentioned above, but cannot remember if I filed a bug report at that time.

@StefKi Your system is linear in the second derivatives, so it ought to be simple to solve for those (when possible).
convertsys has to do that.

I tried doing it myself:

res:=solve(Sys,diff(GenKo,t,t)):
nops(res); #7 as expected
length(res); #Huge so do indeed use colons
FirstOrdSys := convertsys(res, [], GenKo, t, Y, YP ): #working on res instead of Sys
whattype(FirstOrdSys); #list
nops(FirstOrdSys); #4 as expected
length(FirstOrdSys); #Huge
length(FirstOrdSys[1]); #The bulk of the length
FirstOrdSys[2]; #The 'translation'
FirstOrdSys[3..4];

The total time used was less than 2 minutes.

Finally, your system doesn't contain derivatives of known functions (i.e. functions that are not dependent variables). Therefore the handling (or lack thereof) of such systems is irrelevant for your system.

@momoklala I have no problem with S:=-0.5.  I get

[-1.18614066271840, -1.17788387531395, -1.16926687825642, -1.16025994699062, -1.15082789257908, -1.13052356717881]

I use Maple 2015. I shall test it in Maple 18 later.
"Later": Well, it gives me the exact same results without any problem.

So what are you doing?

First 116 117 118 119 120 121 122 Last Page 118 of 230