nm

8552 Reputation

19 Badges

12 years, 353 days

MaplePrimes Activity


These are replies submitted by nm

@Pascal4QM 

thanks for the suggestion. But the main issue is how to avoid hardcoding how many _Cn there are? In your example you used 1..3.

Acer's solution works for any value.

Using your solution works, but for 3.

restart;
replace_all_C:=proc(expr::anything)
local c,k;
alias(seq(c[k]=_C||k,k=1..3));

    return Physics:-Latex(expr,output=string);
end proc:

sol:=dsolve(diff(x(t),t$4) = x(t));
s:=replace_all_C(sol)

s := "x \\left(t \\right) = c_{1} {\\rm e}^{-t}+c_{2} {\\rm e}^{t}+c_{3} \\sin \\lef\
t(t \\right)+\\mathit{\\_C4} \\cos \\left(t \\right)

"

In the above _C4 was not changed.

I can change the function to use 1..4 but then it will not work if there happened to be more constants.

So even though using alias works, the issue is in using that hardcoded number, as I had with my original solution which I wanted to avoid.

 

@ecterrab 

Thanks fo the quick fix.I updated to 806 and problem is no longer there.

 

 

@Jean-Michel Collard 

I am on windows 10. Maple 2020.1.  I used to have many problems before with Physics update (posted about it) but not many issues any more.

Only thing I noticed, is that sometimes (may be 1 out of 5 times) when I click the install button to install latest version of Physics from the GUI, and even though I made sure to click restart in my worksheet before doing this, I get error, permission denied

ERROR: The package could not be installed.
error PackageTools:-Install, "permission denied when trying to copy to 
%1", "C:\Users\me\maple\toolbox/Physics Updates/lib/Physics Updates.maple"

But each time this error happens, it is fixed by closing Maple, and restarting it, then clicking on the "reinstall" icon below the Physics package and now it always works with no error.

Interesting it always thinks last attempt was installed OK, because I do not see the red marker next to the Physics package saying that an update is available. So Maple think it was installed OK, even though there was an error.

That is why I have to select "reinstall" to make sure it was installed OK. To be safe.

 

 

@Carl Love 

Thanks. "...may include ODEs or algebraic equations". made it more clear what it meant.

 

@ecterrab 

Thanks. I did not know about PDEtools:-Infinitesimals

You said "Basically all the symmetry commands in (O)DEtools have an equivalent in PDEtools. For symgen, the equivalent is Infinitesimals"

Do you suggest then to use PDEtools:-Infinitesimals instead of DEtools:-symgen for find the symmetries?

I Just did quick test (without knowing too much about all the other options for PDEtools:-Infinitesimals since I never used it before), I  noticed for some cases, symgen gives result, where PDEtools:-Infinitesimals seems to hang. For example

restart;
ode :=diff(y(x),x)=(x+cos(exp(-x)*(1+x)+exp(y(x))))/(exp(x+y(x)));
DEtools:-symgen(ode,HINT=[f(x),x*g(y)]);

But

PDEtools:-Infinitesimals(ode,HINT=[f(x),x*g(y)])

just says "evaluating....". I waited for long 5 minutes and nothing happened.  May be I need to look at the other options to see why this happened and figure what is going on...

ps. I do not understand this line in the help page for ?PDEtools:-Infinitesimals

where it says 

"PDESYS- PDE or a set or list of PDEs; it can include ODEs and not differential equations"

What is the difference between ODEs and differential equations in the above?

Thanks

 

@ecterrab 

I am glad you found the combination you like.

I was using advice I read from a known Latex expert here and in other places where I saw it used:

"Another possibility is \boldmath, though I would prefer \boldsymbol of amsmath as well."

https://tex.stackexchange.com/questions/595/how-can-i-get-bold-math-symbols/38631

Yes,  \boldsymbol needs a package, but it is amsmath. Which is needed to compile almost anything in Latex and comes with all Latex distrubutions.

But whatever solution works, it is good you will be using \mathit now as this should make the latex a little better.

 

 

 

 

@ecterrab 

"If you get italicized and bold,"

Please see below if this is what you wanted

\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage{maplestd2e}

\begin{document}

\begin{equation}
\boldsymbol{\mathit{This\,is\,text}}
\end{equation}

\end{document}

\usepackage{amsmath}
\usepackage{maplestd2e}

\begin{document}

\begin{equation}
\boldsymbol{\mathit{K}}\left(z \right)
\end{equation}

\end{document}

@ecterrab 

Hello;

"Any combination of bf or textbf with mathit does not render bold and italicized"

For math mode, mathbf  should be used and not textbf. 

I am not an expert in Latex, but if you could post an example code which is causing the issue you mention, I will try to find more.

ps. Physics:-Latex is working very well. Thank you for that. Finally Maple is generating good looking Latex after so many years :)

 

@itsme 

May be in the future Maple can add a Latex only option setting call. 

But setting imaginary unit in interface is not causing me any problem at all now, since I do this only inside the worksheet which runs a long script that I run which generates the Latex. This is not for interactive use.

Once the script is finished, I close the worksheet or click the restart bottom and Maple is back to normal setting for interactive use, where UpperCase I is better.

 

@Joe Riel 

You said "Note that the cancellation option is normally false; it is used to actively cancel pole/zero pairs that are within a given distance, set by the relativeerror option.  So that won't help you."

But that is not what the help page gives the impression. It says 

https://fr.maplesoft.com/support/help/Maple/view.aspx?path=DynamicSystems/SystemOptions

"The default value for the option cancellation, which determines whether pole-zero cancellation is applied to the transfer function of a system during creation. The default is false."

When reading the above, it seems to mean there is no pole/zero cancelation in the transfer function. There is no mention of relativeerror or such. 

I took the above to mean, if I enter tf 

tf:=(s - 1)/(s^2 - 3*s + 2)

which does have one pole/zero cancelation in it, since denomator factors to (s-1)*(s-2), then Maple DynamicSystem will not do the cancelation since the option is set to false.  But now it does. 

So may be help should make things more clear.  I also think DynamicSystem should not do pole/zero cancelation in this case, but it does now. 

tf:=(s - 1)/(s^2 - 3*s + 2);
DynamicSystems:-PrintSystem(DynamicSystems:-TransferFunction(tf))

@Joe Riel 

thanks for the workaround. But it is much more convenient to use transfer function (since this is how the textbook shows it) than having to manually convert to zpk form each time.

 

@Carl Love 

I am sorry, I am not following you when you say  "you'll still need to expand the denominator."

restart;
alias(DS=DynamicSystems):
DS:-SystemOptions(cancellation=false,complexfreqvar=s):
tf:=DS:-TransferFunction(-(s - 1)/expand(((-2 + s)*(s - 1)))):
DS:-PrintSystem(tf)

This simplification cause big problems in control system, since it gives different state space model.

I basically want to type the transfer function (as it shows in textbook) without it being simplified., i.e. pole/zero cancelation done. If you know how to do that, may be you could show me what exactly I needed to type?

Thanks

@Carl Love 

Actually it was expanded originally, and it still did the cancelation. I wrote it above in this form later on to make it clear the reader there is pole/zero cancelation.

alias(DS=DynamicSystems):
DS:-SystemOptions(cancellation=false,complexfreqvar=s):
tf:=DS:-TransferFunction(-(s - 1)/(s^2 - 3*s + 2)):
DS:-PrintSystem(tf)

Compare to 

Clear["Global`*"];
sys = TransferFunctionModel[-(s - 1)/(s^2 - 3*s + 2), s]

@itsme 

May be Physics:-Latex  should have its own options setting, done once at global level.

Having to add  imaginaryunit="i" at each call to Physics:-Latex() is a little too much work, but setting it at global level, where it only affects Latex generation, leaving normal Maple code as is, is a good idea.

This is how DynamicSystem does it also. It has it own option setting call. 

 

   https://fr.maplesoft.com/support/help/Maple/view.aspx?path=DynamicSystems%2fSystemOptions

 

@ecterrab 

As a temporary solution, one can also modify this in their latex as follows. By changing the definition in the peramble

\renewcommand{\textit}{\mathit}

And now 

y \left(x \right) = \textit{\_C1} {\rm e}^{\arctan \left(x \right)}

Will give same output as  when using \mathit

I think this should work but I need to try it on my main large file as well.

 

First 29 30 31 32 33 34 35 Last Page 31 of 71