nm

11413 Reputation

20 Badges

13 years, 72 days

MaplePrimes Activity


These are replies submitted by nm

I am interested in this, but I can't really follow all the above. Too complicated. I learn better from simple examples.

Is it possible to make a very simple one, showing just the code to generate it? 

I do these things all the time in Mathematica's Manipulate. How would the following be done in Maple? This is small app in Manipulate, which just plots sin(a*x) from -2 Pi to +2 Pi, where there is a slider that changes the value of a from say -1 to 1 by increments of 0.01. 

Each time the slider moves, the plot is updated.  The code to do this in Mathematica is only 3 lines. How would this be done in Maple?  Notice, no GUI is needed to build the acuall Manipulate. it is all plain text code. If I have to use GUI to help me build the math app itself, then I would not be interested.

I want to be able to make the complete app, using plain text Maple code, with no help from the user interface at all. Something I can write in text editor. Then read into Maple to run and it will then show up the app GUI at that moment.

Manipulate[
 Plot[Sin[a*x], {x, -2*Pi, 2 Pi}, PlotRange -> {Automatic, {-1, 1}}],
 {{a, .2, "a"}, -1, 1, .01,Appearance -> "Labeled"}
 ]

@ecterrab 

nice solution. I did not think of trying Lie methods. (too many dsolve options, too little time :)

These also work

sol:=dsolve(ode,can2,implicit);
sol:=dsolve(ode,gon2,useint,implicit)
sol:=dsolve(ode,dif,useint,implicit);

Noticed `dif` gives 3 solutions, while others one.

matlab has piecewise in its symbolic toolbox

https://www.mathworks.com/help/symbolic/piecewise.html

but can not be  used outside the toolbox.  You can plot the piecewise in Matlab using the fplot command. 

 

@ecterrab 

Thank you.  

But still not able to get all 3 roots in the same example. Please see worksheet.

Installed latest Physics OK. Restarted Maple. This option does not seem to do what it is suppoed to do. I must be doing something wrong in the following but do not know what
 

restart;

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 842 and is the same as the version installed in this computer, created 2020, October 13, 18:14 hours Pacific Time.`

eq:=x^3 - 3*x^2 + 3*x - 1=0;
solve(eq,x,dropmultiplicity=false);

x^3-3*x^2+3*x-1 = 0

1, 1, 1

PDEtools:-Solve(eq,x);

x = 1

PDEtools:-Solve(eq,x,dropmultiplicity=false);

x = 1

PDEtools:-Solve(eq,x,dropmultiplicity);

x = 1

 


 

Download pdetools_Solve_issue_1.mw

@vv 

I searched before asking. I searched the help page for "multiplicity" and it says no matches found. and also looked at all the top lines and read part of the description and did search. Nothing there about multiplicity.

Maple help pages are very hard to use to obtain information.

If one has to read every line on pages and pages to find what they want each time, this is not practical. 

 

 

@vv 

Appreciate the answer. But the question is asking about using PDEtools:-Solve and not solve 

@ecterrab 

Thanks for the forget command.

But I noticed I had to do Physics:-Latex:-Forget(): to make it work, and not just Latex:-Forget(): 

This is all in global context.   Not a big deal for me, since I like to prefix the full package name anyway. But thought you might like to know this.

Here are two worksheet. First uses Latex:-Forget():  and the second uses Physics:-Latex:-Forget(): . You can see the prime is not turned off in the first case. i.e. it did not forget. Only when used full name it did forget.


 

interface(version);

`Standard Worksheet Interface, Maple 2020.1, Windows 10, July 30 2020 Build ID 1482634`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 840 and is the same as the version installed in this computer, created 2020, October 12, 1:12 hours Pacific Time.`

restart

#Turn ON  prime, now Latex shows prime, good
previous_values := Typesetting:-Settings('prime' = x, 'typesetprime' = true):
expr:=diff(y(x),x);
Physics:-Latex(expr);

diff(y(x), x)

y^{\prime}\left(x \right)

true

#turn off prime in typesetting. Make sure to call forget first.
Latex:-Forget():
Typesetting:-Settings('prime' = previous_values[1], 'typesetprime' = previous_values[2]);  
expr:=diff(y(x),x);
Physics:-Latex(expr);  

x, true

diff(y(x), x)

y^{\prime}\left(x \right)

 


 

Download case_1_latex.mw

 


 

interface(version);

`Standard Worksheet Interface, Maple 2020.1, Windows 10, July 30 2020 Build ID 1482634`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 840 and is the same as the version installed in this computer, created 2020, October 12, 1:12 hours Pacific Time.`

restart

#Turn ON  prime, now Latex shows prime, good
previous_values := Typesetting:-Settings('prime' = x, 'typesetprime' = true):
expr:=diff(y(x),x);
Physics:-Latex(expr);

diff(y(x), x)

y^{\prime}\left(x \right)

true

#turn off prime in typesetting. Make sure to call forget first.
Physics:-Latex:-Forget():
Typesetting:-Settings('prime' = previous_values[1], 'typesetprime' = previous_values[2]);  
expr:=diff(y(x),x);
Physics:-Latex(expr);  

x, true

diff(y(x), x)

\frac{d}{d x}y \left(x \right)

 


 

Download case_2_latex.mw

@acer 

You should say that to the person BEFORE deleting their question, or copy the question over to here. You deleted my question twice without saying anything. You could have added a comment saying to copy the question here instead and that would have been OK.

Just deleting the question with no notification before or explaining why, is very rude and unprofessional act.  

What if someone had made no copy of the question? They would have then lost a lot of work and time becuase you just deleted it and there is no way to get it back.

This is not the first time you did this. You should learn that what you are doing gives bad reflection about this platform and Maple itself for users.

 

How to turn off prime setting in Latex?

when I first open Maple, and do  Physics:-Latex(diff(y(x),x)); it gives \frac{d}{d x}y \left(x \right) which is correct.

Now if I want the derivative in Latex to show as y' then I call Typesetting:-Settings('prime' = x, 'typesetprime' = true):  
and now, Physics:-Latex(diff(y(x),x)); generate  y^{\prime}\left(x \right) which is what I want.

Now when I turn off the Typesetting:-Settings effect, using answer 
in https://www.mapleprimes.com/questions/230764-How-To-Turn-Off-TypesettingSettings-Once-Set  
I find that Latex still geneates y'  where I expected it to be turned off as well.


 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2020.1, Windows 10, July 30 2020 Build ID 1482634`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 840 and is the same as the version installed in this computer, created 2020, October 12, 1:12 hours Pacific Time.`

restart;

#default setting, no prime, good
Physics:-Latex:-UseTypesettingCurrentSettings := false;
expr:=diff(y(x),x);
Physics:-Latex(expr);

false

diff(y(x), x)

\frac{d}{d x}y \left(x \right)

restart

#Turn ON  prime, now Latex shows prime, good
previous_values := Typesetting:-Settings('prime' = x, 'typesetprime' = true):
Physics:-Latex:-UseTypesettingCurrentSettings := true;
expr:=diff(y(x),x);
Physics:-Latex(expr);

true

diff(y(x), x)

y^{\prime}\left(x \right)

true

#turn off prime in typesetting. Latex still shows prime
Typesetting:-Settings('prime' = previous_values[1], 'typesetprime' = previous_values[2]);  
Physics:-Latex:-UseTypesettingCurrentSettings := true;
expr:=diff(y(x),x);
Physics:-Latex(expr);  

x, false

true

diff(y(x), x)

y^{\prime}\left(x \right)

 


 

Download turn_off_2.mw


 

@Kitonum 

Is it possible to combine both methods? Like this

restart;
Cs := (A::evaln,n)-> ['A'[..,i]$i=1..n];
A   := Matrix([[1,2,1,3,2],[3,4,9,0,7],[2,3,5,1,8],[2,2,8,-3,5]]);

Cs(A,op([1,2],A));

Does the performance degrade because of this?

 

@vv 

thanks,. I did not know about Basis. I was using the book definition of ColumnSpace. 

 I paste it into MathType, could not get the required equation

The Maple latex generated is valid. Compiled OK using TexLive on Linux and using MikTex on windows.

Therefore, I suggest contacting Microsoft  or MathType customer support asking them why it did not work in their software. This is not an issue with Maple that I could see.

why not give an small example of an input matrix, this way one does not have to make one up and guess wrong?

You could map type/numeric.

https://www.maplesoft.com/support/help/Maple/view.aspx?path=type%2Fnumeric 

"check for an object of type numeric"

@tomleslie 

Thanks for the observation. I used list for unknowns, to make the the order match the order of the ode's given which is also in a list and not a set. I do this all the time actually, I did not think this would make a difference. 

It is not a big problem, since both answers are correct, but it would be nice if same solutions came out the same.

 

 

First 48 49 50 51 52 53 54 Last Page 50 of 91