nm

11353 Reputation

20 Badges

13 years, 20 days

MaplePrimes Activity


These are questions asked by nm

Using latest Physics, I found case where it is not giving the Latex.

Please see attached worksheet.  This is on windows 10, Maple 2020.1.1

 

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 804 and is the same as the version installed in this computer, created 2020, September 7, 12:31 hours Pacific Time.`

ode:=diff(y(t),t) = -2*arctan(y(t))/(1+y(t)^2);

diff(y(t), t) = -2*arctan(y(t))/(1+y(t)^2)

sol:=dsolve(ode)

t+Intat((1/2)*(_a^2+1)/arctan(_a), _a = y(t))+_C1 = 0

Physics:-Latex(sol)

Error, (in unknown) invalid range for string subscript

latex(sol)

t+\int ^{y \left( t \right) }\!{\frac {{{\it \_a}}^{2}+1}{2\,\arctan
 \left( {\it \_a} \right) }}{d{\it \_a}}+{\it \_C1}=0

 


By trial and error, I found that the error was introduced in Physics 797. Since in Physics 796 it did work.

Here is screen shot

Download latex_issue_11.mw

When I give symgen a HINT, using functional form f(x),g(x)*y it does not generate the infinitesimals of the Lie group for this ODE.

But from the answer given using way=abaco1 it is clear they have this form, where f(x)=-1/x and g(x)=1/x^2

From help, it says

HINT=[e1,e2], indicates to the solver that it should take e1 and e2 as the infinitesimals, where e1 and e2 can contain a maximum of two indeterminate functions. The solver tries to determine the infinitesimals to solve the problem.

And I am using only two indeterminate functions. These are f(x) and g(x)

Am I making a mistake somewhere? Please see worksheet below.


 

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 801 and is the same as the version installed in this computer, created 2020, September 7, 14:32 hours Pacific Time.`

restart;
ode:=diff(y(x),x)=(1-y(x)^2)/(x*y(x))+1;
#why this below do not give result?
DEtools:-symgen(ode,HINT=[f(x),g(x)*y]);

diff(y(x), x) = (1-y(x)^2)/(x*y(x))+1

DEtools:-symgen(ode,way=abaco1);

[_xi = -1/x, _eta = y/x^2]

#it works for this though. May be the two functions
#can  not be both functions of x at same time?
#one function must be function of x and the other of y?
#But help does not say that.

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

diff(y(x), x) = (x+cos(exp(-x)*(1+x)+exp(y(x))))/exp(x+y(x))

[_xi = exp(x), _eta = x*exp(-y)]

 


 

Download symgen_issue_2.mw

Any idea why symgen hangs when using formal algorithm on this first order ode? I was just comparing the Lie symmetries generated for this ode using different algorithms when I noticed this hang on formal.

The textbook gives this result btw

From help on symgen it says

The first algorithms, called formal, formulates a linear PDE system for the infinitesimals [xi, eta], then formally triangularize this system - using differential algebra techniques - finally tacking the resulting uncoupled system. When successful, this algorithm returns the complete set of point symmetries admitted by a given ODE of order 2 or higher. NOTE: this algorithm is advantageous mainly for 2nd and higher order ODEs. The algorithm works as well in the case of first order ODEs, but in this case the subproblems it will need to solve to find the symmetries are as difficult to solve as the first order ODE itself.
 

But on Maple 2020.1 server seems to hang, taking 100% CPU. I had to terminate mserver.exe manually since clicking on interreupt button from worksheet has no effect. This only happens with formal algoritm. All others work very fast. 

I know help says this is meant for second order ODE's, but it also says it works  well for first order.  It seems to be stuck in solve call somewhere. Is this to be expected sometimes when using formal algo in symgen for first order ode's?

Maple can solve the ODE very quickly otherwise.


The following ode also hangs in symgen

ode:=diff(y(x),x)=x*y(x)^2-2*y(x)/x-1/x^3;


 

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 794 and is the same as the version installed in this computer, created 2020, September 3, 23:37 hours Pacific Time.`

#hangs on formal, why?
restart;
ode:=diff(y(x),x)=(y(x)-4*x*y(x)^2-16*x^3)/(y(x)^3+4*x^2*y(x)+x);
DEtools:-symgen(ode,y(x),way=formal)

diff(y(x), x) = (y(x)-4*x*y(x)^2-16*x^3)/(y(x)^3+4*x^2*y(x)+x)

restart;
ode:=diff(y(x),x)=(y(x)-4*x*y(x)^2-16*x^3)/(y(x)^3+4*x^2*y(x)+x);
sol:=dsolve(ode,implicit)

diff(y(x), x) = (y(x)-4*x*y(x)^2-16*x^3)/(y(x)^3+4*x^2*y(x)+x)

(1/2)*y(x)^2+(1/2)*arctan((1/2)*y(x)/x)+2*x^2-_C1 = 0

 


 

Download symgen_issue_1.mw

The following transfer function has zero/pole cancelation. I am trying to create a transfer function object, but Maple automatically simplifies the transfer function before it gets to the DynamicSystem call, which result in different output than what I expected.

I do set the cancellation=false option, even though this is the default. The problem is Maple does pole/zero cancelation before the call.

I tried to add '' around it to delay evaluation, but it did not work.  

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

You can see it did pole/zero cancelation.

In Matlab and Mathematica, this does not happen. For example

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

Same with Matlab:

>> s=tf('s');
>> sys_tf =-(s - 1)/((-2 + s)*(s - 1))

sys_tf =
 
     -s + 1
  -------------
  s^2 - 3 s + 2
 
Continuous-time transfer function.

What do I need to do in Maple to keep the transfer function without pole/zero cancelation (this affects the state space realization later on when this cancelation happens)

I am using Maple 2019 at this moment as Maple 2020 is busy.

 

As I was going over latest build using Physics:-Latex I noticed this.

The complex number I should be translated to lower case in latex.

This is what the original latex() does (and also what Mathematica TeXForm does).

It does not look good at all to have complex number I be translated to I and remain UPPER case I

Here is an example

expr:=[solve(x^2+2*x+2=0,x)];
Physics:-Latex(expr)

gives

[-1+I, -1-I]

While  latex(expr) gives the much better and more mathematical output:

[-1+i,-1-i]

 

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 790. The version installed in this computer is 789 created 2020, September 1.`

expr:=[solve(x^2+2*x+2=0,x)];
Physics:-Latex(expr)

[-1+I, -1-I]

[-1+I, -1-I]

latex(expr)

[-1+i,-1-i]

 


Is it possible to have Physics:-Latex translate complex numbers like latex() did?

Please see attached worksheet below.

Download latex_issue_9.mw

First 113 114 115 116 117 118 119 Last Page 115 of 199