Preben Alsholm

13743 Reputation

22 Badges

20 years, 340 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@Alejandro Jakubi If we assume that x>0 it suffices to use Parts:

restart;
with(IntegrationTools):
J:=Int(ln(1+sqrt((x+1)/x)),x):
J1:=Parts(J,ln(1+sqrt((x+1)/x)));
simplify(J1) assuming x>0;
value(%);


@jjcp You are not doing anything wrong, but if you only carry 4 digits in a complex computation it is not surprising  ( or rather it should be expected) that the result obtained is not the same as the one obtained by rounding to 4 digits a result computed carrying 10 digits.

Could you explain why you are asking?

After all what does it mean to set Digits to 4 or 10 (the default)? Surely you know of rounding?

In case the point is that not even the first 4 digits in the first result are all correct then remember that setting Digits to 4 does not guarantee 4 correct significant digits in the result.

Trivial example:
Digits:=10:
evalf(Pi)-3.14159;
evalf(Pi-3.14159); #Same result, but the point is that there are only 4 significant digits, not 10


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

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