nm

11483 Reputation

20 Badges

13 years, 83 days

MaplePrimes Activity


These are replies submitted by nm

You have so many mistakes in just writing what you want solved.

1) v shows as function of z only. So why use partial derivatives? Where will you use  v(z,0) =0 ?

2) There is no K1 in the equations

3) There is no alpha3 in the equations

4) There is no thetab in the equations.

5) There is no eta1 in the equations.

Trying to make the symbols that show in your equations latex match the numerical values you give will be a good start.

@Rouben Rostamian  

Would you know why it works with no error with plus but not with minus?

i.e. it works with  1+p.q but not with 1-p.q  ?

@acer 

good improvement.

@Carl Love 

Hello;

I just always thought of Mathematica Together as similar to Maple's combine, simply because Mathematica has no combine command, only Together command, that is all.

@Preben Alsholm 

Ok, thanks, normal works, so is numer/denom

I still do not understand why combine does not work as expected. I guess this is just how it was designed. 

@ecterrab 

Hello;

Based on what you said, this is why I always wondered why Maple sometimes changes the implicit solution to explicit one when adding initial conditions, which will cause odetest not to verify the solution then.

Using same ODE I gave, this is Maple's solution

ode:=sqrt(y(x))+(1+x)*diff(y(x),x)=0:
ic:=y(0) = 1:
sol:=dsolve([ode,ic]);

But this does not verify as is

odetest(sol,[ode,ic])

It will verify, by getting the correct region (in this case when csgn() is -1), But this requires more work from the user to figure that out.

I wonder why Maple did not solve the constant of integration from the general solution (which is implicit, good) and kept the IVP solution implicit? This would cause odetest to verify it as is, with no more post-processing. For the above:

ode:=sqrt(y(x))+(1+x)*diff(y(x),x)=0:
ic:=y(0) = 1:
sol:=dsolve(ode); #solve with no IC

Which is implicit. Now solve for _C1 but keep the solution implicit, something like

eq:=eval(sol,[y(x)=1,x=0]);
the_constant:=PDEtools:-Solve(eq,_C1);
new_sol := eval(sol,the_constant)

Now the IVP solution remained implicit. The difference, is that now odetest verifies it as is

odetest(new_sol,[ode,ic])

 

Any insight why dsolve does not do this instead of making the final IVP explicit which makes it harder to odetest it?  I do know that one can force the IVP solution to be implicit using

sol:=dsolve([ode,ic],'implicit');

But why not do this by default in such cases, since it generates solution that will odetest to 0 as is.Notice in this case, the general solution came out implicit on its own, without using the option 'implicit'. But not the IVP solution. There one had to force the solution to show as implicit.

This is what I do not understand why.

 

Maple 2022.1 on windows 10

@vv 

Well, then Reduce must have used magic to find out. 

As a user, I do not care what methods are used under the cover. If it had to use heuristics, tricks or just math, the point is, as a user there should not be a need for one to spend time doing many trial and error and tricks to find this out.

Maple is simply weak here. No point of definding it. Maple is good also in many other areas, but not in this area.

@vv 

Thanks, but this approach might work for interactive trial and error by looking at the expression,.

In a program, when the expression can be anything, this is not practical approach to do something like this.

 simplification is sometimes "art and craft":

Or one can just use the Reduce command to find where it is zero. No need for trials, art or craft. Just math is needed.

Maple is a little weak in this area. 

@vv 

Unfortunately, your trick did not work on another case I found

Here is Maple code.  Would you know of another trick to use? Thanks.
 

restart;

r:=sqrt(-x + 1/2 - sqrt(-4*x + 1)/2) + 1/2 - sqrt(-4*x + 1)/2 ;
simplify(combine(r)) assuming x<=0;
simplify(r) assuming x<=0;
simplify(r,symbolic) assuming x<=0;
simplify(r,sqrt) assuming x<=0;
simplify(expand(r)) assuming x<=0;

(1/2)*(-4*x+2-2*(-4*x+1)^(1/2))^(1/2)+1/2-(1/2)*(-4*x+1)^(1/2)

(1/2)*(-4*x+2-2*(-4*x+1)^(1/2))^(1/2)+1/2-(1/2)*(-4*x+1)^(1/2)

(1/2)*(-4*x+2-2*(-4*x+1)^(1/2))^(1/2)+1/2-(1/2)*(-4*x+1)^(1/2)

(1/2)*(-4*x+2-2*(-4*x+1)^(1/2))^(1/2)+1/2-(1/2)*(-4*x+1)^(1/2)

(1/2)*(-4*x+2-2*(-4*x+1)^(1/2))^(1/2)+1/2-(1/2)*(-4*x+1)^(1/2)

(1/2)*(-4*x+2-2*(-4*x+1)^(1/2))^(1/2)+1/2-(1/2)*(-4*x+1)^(1/2)

 

plot(r,x=-5..1)

 


 

Download show_it_is_zero_2.mw

@Preben Alsholm 

Thanks, I did not know about 

frontend(solve,[eq,A],[{`=`}]);

I do not think I want to replace solve with isolate. I had cases where isolate did not do as well as solve in all case.

But do you recommend then changing solve to use frontend in front of it as you show? I am not sure now what the ramification of doing this. Will solve still work the same as before, but without the auto simplication part? If that is the only difference, then I will switch to using frontend(solve...) but since I never used it before like this, I need to first find out if it will have any negative effects in other cases or not.

 

 

@Rouben Rostamian  

You are "misleading" Maple into looking at the ODE as one of the d'Alembert type. 

but it is d'Alembert ode. Maple itself says so

restart;
ode:=diff(y(x),x)=sqrt(1+x+y(x)):
DEtools:-odeadvisor(ode)

Another point, is that surely Maple will not have given a solution using a method if the method is not applicable to the ODE?

Maple ode solver is the best in the industry, and will not just use the wrong method on an ode and give wrong solutions without any checking internally that the method is applicable to the ode.

 don't impose the dalembert requirement.  

I am not imposing anything. When the advisor gives the types of the ode, then a user can select which method to apply. Without this, Maple internally chooses one. 

restart;
ode:=diff(y(x),x)=sqrt(1+x+y(x)):
DEtools:-odeadvisor(ode);
dsolve(ode);

sol:=DEtools:-dalembertsol(ode);
sol:=DEtools:-genhomosol(ode);

 

 

If one tries to tell Maple to use a method not applicable to the ode, it will produce no solutions as expected. But it can't just make up ones.

ode:=diff(y(x),x)=sqrt(1+x+y(x)):
DEtools:-abelsol(ode)

fyi, ,I found a workaround.

restart;
ode:=diff(y(x),x)=x*(y(x)^2-1)^(2/3);
sol:=DEtools:-exactsol(ode);
odetest(sol,ode);

diff(y(x), x) = x*(y(x)^2-1)^(2/3)

{-(1/2)*(y(x)^2-1)^(2/3)*x^2/((y(x)-1)^(2/3)*(y(x)+1)^(2/3))+Intat(1/((_a-1)^(2/3)*(_a+1)^(2/3)), _a = y(x))+_C1 = 0}

0

 

Download workaround.mw

@Carl Love 

Yes, the first and second trivial solutions y=1, and y=-1 do verify the original ode ofcourse.

But the third solution from the your cubed ode did not verify the original before cubing it. It does verify the cubed ode.

btw, you have small typo  

odetest~(sol);

should be 

odetest~(sol,ode);

my code:

restart;
original_ode:=diff(y(x),x)=x*(y(x)^2-1)^(2/3);
ode:= diff(y(x),x)^3 = x^3*(y(x)^2-1)^2;
sol:= [dsolve(ode)];
odetest~(sol,ode);  #verifies all 3 for the cubed ode

odetest(sol[1],original_ode);  #verifies (trivial sol)
odetest(sol[2],original_ode);  #verifies (trivial sol)
odetest(sol[3],original_ode);  #does not verify

I tried your method on simpler ode. Cubing the ode gives 3 solutions, and one general solution of these is expected to verify the original ode.  Here is an example below. But in the above example, we see that the third general solution from the cubed ode did not verify the original ode. So that is still a problem.

original_ode:=diff(y(x),x)=x^(2/3);
cubed_ode:=diff(y(x),x)^3=x^2;
dsolve(original_ode);
sol:=[dsolve(cubed_ode)];
odetest(sol[1],original_ode);  #verifies OK (general solution)
odetest(sol[2],original_ode);
odetest(sol[3],original_ode);

@Axel Vogt 

Thanks for the workaround. Although it helped in few verifications that failed earlier to verify, I found cases where it still fail. Here is an example below.

I really think Maple's odetest with series method should be much improved for series solutions. It is supposed to verify series solution. A user should not have to go through all of this to verify a series solution to an ODE, specially if the solution is Maple's own solution.
 

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

restart;

Example 7

 

Order:=6;  
ode:=x^2*diff(y(x), x$2) + (cos(x)-1)*diff(y(x), x) + exp(x)*y(x) = 0;
sol:=dsolve(ode,y(x),type='series',x=0): # simplify(%):
sol1:=eval(%, _C2=0):
sol2:=eval(%%, _C1=0):
'rhs(sol1)+rhs(sol2)= rhs(sol)';
is(%);

6

x^2*(diff(diff(y(x), x), x))+(cos(x)-1)*(diff(y(x), x))+exp(x)*y(x) = 0

rhs(sol1)+rhs(sol2) = rhs(sol)

true

rhs(sol1):
Y:= unapply(%, x):
eval(lhs(ode), y=Y):
MultiSeries:-asympt(%, x);
#convert(%,polynom);

Error, (in simpl/min) complex argument to max/min: -13/2+1/2*I*3^(1/2)

rhs(sol2):
Y:= unapply(%, x):
eval(lhs(ode), y=Y):
MultiSeries:-asympt(%, x);
#convert(%,polynom);

Error, (in simpl/min) complex argument to max/min: -13/2-1/2*I*3^(1/2)

 


 

Download method_not_verified_for_all.mw

 

@vv 

"It is obvious that the result of odetest cannot be 0, because sol is a truncated series."

Humm. But odetest in this case knows this is series solution, so it is not comparing it with an exact solution,

It knows the order (which is same). I've used odtest to verify my series solution to ode for years.

Then how do you explain that odetest works on thousands of cases of series solutions and give zero, except for only few (for reasons I do not know).
 

restart;

Order:=6;
ode:=(4*x^2+16*x+17)*diff(y(x),x$2)=8*y(x);
sol:=dsolve(ode,y(x),type='series',x=-2);
odetest(sol,ode,'series','point'=-2);

6

(4*x^2+16*x+17)*(diff(diff(y(x), x), x)) = 8*y(x)

y(x) = series(y(-2)+(D(y))(-2)*(x+2)+(4*y(-2))*(x+2)^2+((4/3)*(D(y))(-2))*(x+2)^3-((16/15)*(D(y))(-2))*(x+2)^5+O((x+2)^6),x = -2,6)

0

restart;

Order:=6;
ode:=12*x^2*(1+x)*diff(y(x),x$2)+x*(11+35*x+3*x^2)*diff(y(x),x)-(1-10*x-5*x^2)*y(x)=0;
sol:=dsolve(ode,y(x),type='series',x=0);
odetest(sol,ode,'series','point'=0);

6

12*x^2*(1+x)*(diff(diff(y(x), x), x))+x*(3*x^2+35*x+11)*(diff(y(x), x))-(-5*x^2-10*x+1)*y(x) = 0

y(x) = _C1*(series(1-x+(7/8)*x^2-(19/24)*x^3+(283/384)*x^4-(1339/1920)*x^5+O(x^6),x,6))/x^(1/4)+_C2*x^(1/3)*(series(1-x+(28/31)*x^2-(1111/1333)*x^3+(57493/73315)*x^4-(3668716/4912105)*x^5+O(x^6),x,6))

0

restart;

Order:=6;
ode:=10*x^2*(1+x+2*x^2)*diff(y(x),x$2)+x*(13+13*x+66*x^2)*diff(y(x),x)-(1+4*x+10*x^2)*y(x)=0;
sol:=dsolve(ode,y(x),type='series',x=0);
odetest(sol,ode,'series','point'=0);

6

10*x^2*(2*x^2+x+1)*(diff(diff(y(x), x), x))+x*(66*x^2+13*x+13)*(diff(y(x), x))-(10*x^2+4*x+1)*y(x) = 0

y(x) = _C1*(series(1+x+(14/13)*x^2-(556/897)*x^3-(5314/9867)*x^4+(2092186/2121405)*x^5+O(x^6),x,6))/x^(1/2)+_C2*x^(1/5)*(series(1+(3/17)*x-(7/153)*x^2-(547/5661)*x^3+(26942/266067)*x^4+(200432/3991005)*x^5+O(x^6),x,6))

0

Order:=6;
ode:=2*x^2*(3+x)*diff(y(x),x$2)+x*(1+5*x)*diff(y(x),x)+(1+x)*y(x)=0;
sol:=dsolve(ode,y(x),type='series',x=0);
odetest(sol,ode,'series','point'=0);

6

2*x^2*(3+x)*(diff(diff(y(x), x), x))+x*(1+5*x)*(diff(y(x), x))+(1+x)*y(x) = 0

y(x) = _C1*x^(1/3)*(series(1-(4/9)*x+(14/81)*x^2-(140/2187)*x^3+(455/19683)*x^4-(1456/177147)*x^5+O(x^6),x,6))+_C2*x^(1/2)*(series(1-(3/7)*x+(15/91)*x^2-(15/247)*x^3+(27/1235)*x^4-(297/38285)*x^5+O(x^6),x,6))

0

 


 

Download series_ode_test_work_examples.mw

First 31 32 33 34 35 36 37 Last Page 33 of 91