nm

11353 Reputation

20 Badges

13 years, 12 days

MaplePrimes Activity


These are replies submitted by nm

to get better help you should post complete code in plain text that one can copy and run to see the issue.

Putting a link to a page where one has to search the page and cut and paste pieces of code just to try to stitch togother something that might look like what you have as an image is not the right way to get help.

 

 

@Carl Love 

What makes you "sure" that there is a "special case" solution to this? Have you actually ever seen a Maple plot with a correctly placed stacked legend?

As I said, I am newbie in Maple. I just said this assuming there could be another special "patch" fix for this or some option somewhere hidden in some function. My point is that again, there is no common data structure and a way of viewing things that works the same for all cases, packages and functions as the case with Mathematica. That is all what I meant.  This is not just for legened, but for many other things I find in Maple. It seems maple was put togother as collection of different packages each does things its own way, instead of building things all using the same common design and way of doing things.

@Carl Love 

thanks, but I am finding Maple to be not consistent in many of the things it does. I am documenting many of these inconsistencies as I learn it. I have few pages filled so far.

What if one wants to have the lgened below the x-axis as before, but be stacked up as well? Trying your solution with location "bottom" does not work. With Mathematica, I found it to be much more streamlined in how it handles all these issues. With Maple it seems to be different way to do something in different cases with no overall theme or process that one can follow, and different packages seem to do things differently.  No single overall design seems to exist. But Maple is really good in differential equations, so may be it all balances out at the end.

Here is an example of inconsistent behaviour, or at least, an unexpected.  Plotting the same thing, with legend on the right vs. legend as default (bottom) gives different size plot. It seems the legend size is counted as part of the plot itself. This is not what one normally would expect.

restart:
alias(DS=DynamicSystems):
sys := DS:-TransferFunction(1/(s^2+0.2*s+1)):
p1:=DS:-ResponsePlot(sys, sin(t),duration=25,color=black,legend="response"):
p2:=plot(sin(t),t=0..25,color=red,legend="input",size=[300,200]):
plots:-display([p2,p1],axes=boxed, title="step and impulse reponses",legendstyle= [location=right]);



Now using

plots:-display([p2,p1],axes=boxed, title="step and impulse reponses",legendstyle= [location=bottom]);

 

I am sure there is another special case solution for this. I tried putting an explicit size on the first plot to fix the plot size, but it seems legened size is an issue. So different, special case, solution is needed again.

 

@Carl Love 

a follow up: Is there a way using this method to arrange the legends to be on top of each others (column wise) instead of next to each others as is now? In normal use of legend(), one can use Array() I think to change the arrangement, but how would one do it in this case?

thanks

you should show the exact code you typed.  You could not have typed "for t<10 and 0 for t>10" since this is not valid Maple code.  ALso you need to use := for assignment, not "="

@liushunyi 

If you want an expression sequence vs. a list, then do

r:=map(i->coeff(p,x,i),[seq(i,i=0..n)]);
op(r)

whattype(%);

      exprseq

The 3 main basic data types in Maple are list (thing with []) and set (thing with {}) and expression sequence.

@Joe Riel 

thanks, it worked. This should be the default actually. I hope someone at Maplesoft changes this for version 19 to make it so.

fyi, the example I showed above, now looks like this. I did not expect this result:

_LatexSmallFractionConstant := 0:
latex(diff(y(x), x)+y(x)*cos(x)-(1/2)*sin(2*x) = 0);

{\frac {\rm d}{{\rm d}x}}y \left( x \right) +y \left( x \right) \cos
 \left( x \right) -{\frac {\sin \left( 2\,x \right) }{2}}=0

What I really wanted is this:

Which is produced by this latex:

{\frac {\rm d}{{\rm d}x}}y \left( x \right) +y \left( x \right) \cos
 \left( x \right) -\frac{1}{2} \,\sin \left( 2\,x \right) =0

i.e. simply changing 1/2 to \frac{1}{2}. But as you can see, Maple did not do this in this case. i.e. when 1/2 is inside a more complex expression, it decided to do something else.

Well., still better than before, but not the correct way to do it.

 

@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 `&Delta;&epsilon;`. Only in a Maple document this can happen.

 

First 82 83 84 85 86 87 88 Page 84 of 91