nm

8552 Reputation

19 Badges

12 years, 347 days

MaplePrimes Activity


These are replies submitted by nm

@ecterrab 

"And the option useInt is an option of dsolve, not odetest"

You are correct, sorry, my mistake. I was reading about useInt in the help for odetest, that is why.

But then odetest() has an options parsing problem? If it had given me an error about invalid option, I would have realized right away that I was using this option on the wrong Maple command.

Why does it not check that the options it is given are valid? All these calls below produce no error about an invalid option supplied: (the setup is as given in my initial post above). Should not a Maple command first check the arguments its is passed are valid before processing the call?

odetest(sol1,ode1,useInt);
odetest(sol1,ode1,implicit);
odetest(sol1,ode1,"why odetest accept anything here??");
odetest(sol1,ode1,1,2,3,4,4,5,6,7,8,9);
odetest(sol1,ode1,seriesXXXXXXXXXXXXX);
odetest(sol1,ode1,seriesXXXXXXXXXXXXX,zzzzzzz,yyyyyyy);

all of these produce the same result as

odetest(sol1,ode1);

thank you

@ecterrab 

I did not try the Int option on all of them, I was tired and by random tried it on one or two. Those happened to be the ones that did not work. Same for implicit. Then I gave up and just ran odetest() on all as is.

The problem is that as user, it is hard to just keep trying things like this. The steps you show above are not something a normal new user (student for example) would know how to do unless they have lots of experience with Maple.

It will be nice if Maple can automate internally all these steps. For example, odetest() can have an option, "try_all=true" and let odetest() internally try useInt and if that does not work, try implicit or any other option there is. I found by trial and error that using implicit option worked even if the solution was not implicit in y(x). Having "try_all=true" will make this function easier to use. Most of the time, the user just want to know if the solution satisfies the ode or not, they really do not care at that moment at least, what method Maple uses to obtain this result.

This is btw, similar to user getting ODESolStruct as solution from an ODE. The steps to go from ODESolStruct to construct an actual solution are not easy and complicated. Adding more examples in the help will also be useful.

Similarly, it will also be useful if this can also be automated and so a user can just ask Maple to give a final solution without them having to do so many other manual steps and trial and error to get a final solution, which requires lots of Maple skills to do as well. But this might be much harder to automate than having odetest() try useInt and try implicit automatically.

Thanks again for your help. This was very useful. As a student, I find Maple DSolve to be very good and very fast as well.

@ecterrab 

I installed DEsAndMathematicalFunctions18-5.4 and it now returns 0 from the odetest.

I assumed since odetest() did not return zero, then a solution could not be found and so ODESOlStruc was similar to DESol which is returned when no solution is found.

I need to study more about ODESOlStruc.

Thank you

@Alejandro Jakubi 

thanks. now it worked.

 

@Alejandro Jakubi 

thanks. But I lose the 2D display in this case. I'd like to keep that as well. Similar to what is shown when solution has "DESol" in it

 

It will be better to type the actual maple code so one can better understand what is the question asking for.

\frac {}{}, which isn't valid latex syntax

 

The above is valid latex syntax.

@acer 

All this mixing and insertion of 2D/ clickable things, menus based math entry, and funny fonts into the notebook is running Maple.

Input code should always be done using plain text. Output can be 2D or 3D or 4D, I do not care. But Mathematical programming should be independent of the notebook or the worksheet itself. One should be able to copy the source code and use the same code in vi or emacs or any plain text editor as is and it should look and behave the same way.

Given this, I have never seen a function name being `Δε`. Only in a Maple document this can happen.

 

Try to write normal looking code instead. No one writes a function name with a name like `Δε`(T, z). This is absolutely ridiculous.

@Preben Alsholm 

fyi, I found another one:

ode:=(-x^2+y(x))*(diff(y(x), x))-x;
sol:=dsolve(ode=0,y(x));
latex(sol);

y \left( x \right) ={x}^{2}+1/2\,{\rm W} \left(

Error, (in fprintf) string expected for string format

I used this subs on this to make it happy:

latex(subs(erf=Erf,arctanh=Artanh,LambertW=lambertW,sol));

y \left( x \right) ={x}^{2}+1/2\,{\it lambertW} \left( -4\,{\it \_C1}
\,{{\rm e}^{-2\,{x}^{2}-1}} \right) +1/2

 

@Preben Alsholm 

thanks., Those subs did help indeed to resolve few of the problems in conversion.

@nm 

Ok, solved. Needed to clear the variable. Like this:

restart;
with(CodeTools):
ode:=diff(y(x), x)+a*y(x)-c*exp(b*x);
result:=Usage(assign(resultOfSolve=dsolve(ode=0,y(x))),output='cputime');
resultOfSolve:='resultOfSolve';
ode:=diff(y(x), x)+a*y(x)-c*exp(b*x);  #this can be different ode
result:=Usage(assign(resultOfSolve=dsolve(ode=0,y(x))),output='cputime');

solved :)

@Mac Dude 

It fails when I call it again. I am running in a loop making such calls to different ode's. Do you why it fails and how to fix it please?

restart;
with(CodeTools):
ode:=diff(y(x), x)+a*y(x)-c*exp(b*x);
result:=Usage(assign(resultOfSolve=dsolve(ode=0,y(x))),output='cputime');

ode:=diff(y(x), x)+a*y(x)-c*exp(b*x);  #this can be different ode
result:=Usage(assign(resultOfSolve=dsolve(ode=0,y(x))),output='cputime');

Error, (in CodeTools:-Usage) invalid left hand side in assignment

@Preben Alsholm 

thanks. Yes needed the output in a variable. Using assign solved the problem for me.

@Mac Dude 

thanks. It is the assign trick that I needed.

First 62 63 64 65 66 67 68 Page 64 of 71