nm

11353 Reputation

20 Badges

13 years, 14 days

MaplePrimes Activity


These are replies submitted by nm

@Christian Wolinski 

I see that 

indets(expr, 'ln(anything)')

works. This is little strange, since second argument should be type name. I did not now that ln(anything) is a name of type. I know that anything is, but not ln(anything).

Btw, Is there a reason why you did not just type the above? I do not know what Frontend and the other commands you used are. Little too advanced for me at this stage. But good to know that 'ln(anything)' works as well.

@Carl Love 

so I had a typo all this time. spend more than 30 or 40 minutes because of a typo :)  

I wish Maple complained, but it took the command and said nothing. 

The problem was I typed ?specfun and got the help page open, and because of this I did not notice I needed extra "c". I need better glasses.

No error here.  Maple 2019.1 with Physics 395.

It does not solve it. But no error either.

@ecterrab 

Thanks for the information. You said "The discussion about general versus singular cases is standard in the literature (most textbook on DEs talk about them, Clairaut's equation is one example)."

Actually, the ones I've seen just give the definition and say that singular solutions are ones that can't be obtained from general solution by giving specific values to the constant of integrations. But they do not show how to actually find them in algorithimc way.

I found one old book that shows how to do it for Clairaut, that is how I knew this.

Another book I found that even tries to show how to find singular solutions in general,  is called "differential and integral calculus, vol 2, by N. Piskunov".  around page 40. When he talkes about finding envelope of the family of solutions. The envelope is the singular solution. But it was brief discussions, only 4-5 pages and little hard to follow for me and did not know how to implement it yet.

If you know of a book that talk more about how to actually find singular solutions for ODE's (if they exist), with examples, that would be great. I would buy it.  (may be you could write one :)

I asked once a teacher at school about this subject, but they did not know much about this either.  I'll look at PDEtools:-casesplit, and see if I can trace it to learn how. But even though one can see Maple source code, I find it very hard to follow and understand still as it is way too advanced and there are no comments in it to read and understand what it is doing.

 

 

@Rouben Rostamian  

For the first one I got y(x)=sin(x+C1), y(x)=-sin(x+C1)

And for the second got y(x)=-x^2/2, and y(x)=C1*(2*x+C1)/2 just like Maple, since this is Clairaut and I happened to know how to find special solution for this one.

For the first, I did not find y(x)=-1,y(x)=1 like Maple did.

I do not think the teacher will take too much marks off if one does not find those special solutions for each ODE.

The text book does not even mention how to find these, and I do not know how Maple finds these. Book only talks about finding general solutions and that is what I care about now.

@vv 

Ok, that is good example. So both my solution and Maple's are correct then. Just that one form allows Maple to "see" more special solutions than mine. 

 

@vv 

I am confused. I am trying to find out what if anything I did wrong. If doing this by hand, and one solves for y'(x) first, then solves the resulting ODE, the solution is y(x)=C x^(3/2).  

This is what I do for each ODE, to put it in the form y'=F(x,y) before solving it.  I do not actually understand how Maple got the solutions it did. If I know, I would try to duplicate it.

How could moving one expression from one side of the equation to the other side results in different solution? If some cancelations happens when doing this that should not have happened, then Maple would not have done the cancelation, right? I did not using any  assumptions when doing this either.

So my solution is correct, And so is Maple's. But which one would be considered the "better" one?  or the more "correct" one? and why? If both solutions are equally correct, then I am OK with that, and will just continue to do what I have been doing.
 

restart;

Typesetting:-Settings(typesetprime=true):

ode:= 1/2*(2*x^(5/2)-3*y(x)^(5/3))/x^(5/2)/y(x)^(2/3)+1/3*(-2*x^(5/2)+3*y(x)^(5/3))*diff(y(x),x)/x^(3/2)/y(x)^(5/3) = 0;

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

#do it by hand. Solve for y'(x)
the_rhs:= - (2*x^(5/2) - 3*y(x)^(5/3))/(2*x^(5/2)*y(x)^(2/3))*((3*x^(3/2)*y(x)^(5/3))/(-2*x^(5/2) + 3*y(x)^(5/3)))

-(3/2)*(2*x^(5/2)-3*y(x)^(5/3))*y(x)/(x*(-2*x^(5/2)+3*y(x)^(5/3)))

dsolve(diff(y(x),x)=the_rhs)

y(x) = _C1*x^(3/2)

 

Download strange_ode_answer.mw

 

btw, it is not good idea to use I(t) in there since I is the complex number in Maple. Use different symbol. Say u(t)

other than all the typos in your code, how did you manage to overwrite equation? Since this is protected name in Maple

equation:=1
Error, attempting to assign to `equation` which is protected.  Try declaring `local equation`; see ?protect for details.

type(equation,'protected')
                              true
 

 

@tomleslie 

The second method you showed seems to work. But strange, I had to add extra simplify at end to get same output you show. How come it worked for you without that extra simplify?

restart;
expr := (x^2 - 1)/x^2*y + (x^2 - 1)/x^2:
r    := (x^2-1)/x^2:
Z    := freeze(r):
simplify(collect( algsubs( r=Z,expr),Z)):
thaw(%);

You see? Now adding simplify to the above gives desired result

simplify(%)

Lots of gymnastics there.  I think applyrule is much simpler :)

Thanks for the illustrations.

@tomleslie 

Thanks, but that is not what I wanted to do. I wanted to replace (x^2 - 1)/x^2  by one symbol Z in expr using algsubs like with applyrule.

How would one use this thaw and freeze trick to do this? 

I know you obtained the same final result I want, by inspection. But for what I am doing, I need to replace the other expression (x^2 - 1)/x^2 by one symbol first. Can your method work for this also?

 

@Carl Love 

Thanks. This version seems to work well. I'll report here if I find any bug. But so far, no problems.

restart;

Typesetting:-Settings(typesetprime=true):
tests:=[
[diff(y(x),x)=y(x)^(1/2),1],
[diff(y(x),x$2)+diff(y(x),x)^(1/2)=y(x),2],
[(1+diff(y(x),x)^2)^(3/2)=diff(y(x),x$2),2],
[3*y(x)^2*diff( y(x),x)^3- diff(y(x),x$2)=sin(x^2),1],
[sqrt(1+ diff(y(x),x)^2)=y*diff(y(x),x$3),2],
[sqrt(1+ diff(y(x),x)^2)=y*diff(y(x),x$3),2],
[sin(diff(y(x),x))+ diff(y(x),x$2)+3*x,FAIL],
[exp(diff(y(x),x$2))+sin(x)*diff(y(x),x)=1,FAIL],
[k*diff(y(x),x$2)^2=(1+ diff(y(x),x$2)^2)^3,6],
[x*diff(y(x),x$2)^3*diff(y(x),x)-5*exp(x)*diff(y(x),x$2)+y(x)*ln(y(x)),3],
[2*ln(x)*diff(y(x),x)^2+7*cos(x)*diff(y(x),x$2)^4*diff(y(x),x)^7+x*y(x)=0,4]
];

for i from 1 to nops(tests) do
  deg:= ODEdegree(tests[i,1]);
  if deg <> tests[i,2] then
     print("Failed on ",tests[i,1]," .Expected degree ",tests[i,2]," got ",deg);
  else
     print("Passed on ",tests[i,1]," .Expected degree ",tests[i,2]," got ",deg);
  fi;
od:

"Passed on ", diff(y(x), x) = y(x)^(1/2), " .Expected degree ", 1, " got ", 1

"Passed on ", diff(diff(y(x), x), x)+(diff(y(x), x))^(1/2) = y(x), " .Expected degree ", 2, " got ", 2

"Passed on ", (1+(diff(y(x), x))^2)^(3/2) = diff(diff(y(x), x), x), " .Expected degree ", 2, " got ", 2

"Passed on ", 3*y(x)^2*(diff(y(x), x))^3-(diff(diff(y(x), x), x)) = sin(x^2), " .Expected degree ", 1, " got ", 1

"Passed on ", (1+(diff(y(x), x))^2)^(1/2) = y*(diff(diff(diff(y(x), x), x), x)), " .Expected degree ", 2, " got ", 2

"Passed on ", (1+(diff(y(x), x))^2)^(1/2) = y*(diff(diff(diff(y(x), x), x), x)), " .Expected degree ", 2, " got ", 2

"Passed on ", sin(diff(y(x), x))+diff(diff(y(x), x), x)+3*x, " .Expected degree ", FAIL, " got ", FAIL

"Passed on ", exp(diff(diff(y(x), x), x))+sin(x)*(diff(y(x), x)) = 1, " .Expected degree ", FAIL, " got ", FAIL

"Passed on ", k*(diff(diff(y(x), x), x))^2 = (1+(diff(diff(y(x), x), x))^2)^3, " .Expected degree ", 6, " got ", 6

"Passed on ", x*(diff(diff(y(x), x), x))^3*(diff(y(x), x))-5*exp(x)*(diff(diff(y(x), x), x))+y(x)*ln(y(x)), " .Expected degree ", 3, " got ", 3

"Passed on ", 2*ln(x)*(diff(y(x), x))^2+7*cos(x)*(diff(diff(y(x), x), x))^4*(diff(y(x), x))^7+x*y(x) = 0, " .Expected degree ", 4, " got ", 4

 

 

Download test_1.mw

@Carl Love 

I've been playing with indets, found that this seems to work also

expr := y^2*sin(1/y) + y^(3/2)  + x*y^7;
indets[flat]( expr,  {`^`('identical'(y),algebraic),'identical'(y)} );

gives

{y^(3/2), 1/y, y^2, y^7}

Do you see anything wrong with the above?  I used flat to prevent Maple from giving y as also a possible match.

@Christian Wolinski 

"Should y be included in the answer to the following expression: 

expr := y^2*sin(1/y) + y^(3/2) + x*y^7;

"

The result of the above should be {y^2, y^(-1), y^(3/2), y^7}  only.  So y should not show there.

@Rouben Rostamian  

"You may rearrange that equation into (y')^(/1/2)=y-y'' then square both sides"

Yes. good point. So degree is 2 and not undefined as I said above. Will correct now. I'll also check for this case in my Maple function that it handles this case Ok also.

First 60 61 62 63 64 65 66 Last Page 62 of 91