8 years, 64 days

## MaplePrimes Activity

### These are replies submitted by nm

in math, you can not take derivative with respect to a sum. So

diff( f(a,b), a+b)

makes no sense. (At least at school the teacher never mentioned such a case)

The argument to diff needs to be a symbol.

"Thus, it's safer to use x__1."

This is good to know. This is what I ended up using. I also found that x__(t) is a little easier to read in the editor than x[1](t)

## @Carl Love " There is an algor...

"

• There is an algorithm to generate another (linearly independent) eigenvector from this same eigenvalue called the defective eigenvalue method.

The algorithm that you speak of does not generate (true) eigenvectors; rather, it generates generalized eigenvectors. Given the matrix A and vector v__2 from your example, you can easily check that A.v__2 <> 3*v__2, and thus v__2 is not an eigenvector."

Yes, they are called generalized eigenvectors and this is what our textbook uses. So I am following it.

I was asking if Maple implements this algorithm. i.e. I give it v1, and the number of missing eigevectors needed, or giving it A, and the defective eigenvalue, and it will generate all the eigenvectors associated.

I know how to do it by hand, (solved many problems like this) but I wanted to automate/program it.

I have to use this algorithm and not Jordan form method since this is what our text uses. It is not hard to code it. I just wanted to know if Maple has a package that allready does it.

Reference: Differential equations and linear algebra. 4th edition. Edwards,Penney, Calvis.

Thanks, I did not know about "PDEtools/max_C". That is a good function.

"suppose you know the differential order of the equations you are handling"

I do not know for sure. These ode's are read from different textbooks by a program I wrote. In general, these will be low order ODE's, since the books I use are for undergraduate.  Also, there are systems of linear ode's, and not just one single ODE. The A matrix for the system of linear ode's can be large.

So I thought it will be better to be general on the largest number for _Cn.  I do not like to hardcode numbers inside a program if I can avoid it.

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.

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

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.

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

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

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.

"If you get italicized and bold,"

Please see below if this is what you wanted

\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage{maplestd2e}

\begin{document}

$$\boldsymbol{\mathit{This\,is\,text}}$$

\end{document}

\usepackage{amsmath}
\usepackage{maplestd2e}

\begin{document}

$$\boldsymbol{\mathit{K}}\left(z \right)$$

\end{document}

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 :)

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.

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))