Maple 2024 Questions and Posts

These are Posts and Questions associated with the product, Maple 2024

I need to seperate vectors  from projective geometry vectors in my package. I am experimenting with using row and column matrices for projective points and lines reppresentation. Two approaches are use here. The 1st converts the Matrices to Vectors and back in the procedure. I dont like that way. The 2nd approach, I worked out the equivalent of CrossProduct and DotProduct for the row and column matrices. That I think is better.

1st Question are there any other approaches worth looking at?Is there something in the Physics package that could be of use?

2nd Qusetion could a new data type be made with the properties of a vector that could be displayed differently.?

Say, for a point [ x : y : z ] and a line < x : y : z >, because projecive quantities as basically ratios..


 

restart

with(LinearAlgebra):

 

#

projcross:=overload([

proc(A::Matrix(1,3),B::Matrix(1,3))
option overload;
description "join of points";
local a:=convert(A,Vector[row]),b:=convert(B,Vector[row]);
uses LinearAlgebra;
print("line thro' points");
convert((a &x b)^%T,Matrix);
end proc,

proc(A::Matrix(3,1),B::Matrix(3,1))
option overload;
description "meet of lines";
local a:=convert(A,Vector[column]),b:=convert(B,Vector[column]);
uses LinearAlgebra;
print("intersect point");
convert((a &x b)^%T,Matrix);
end proc,

proc(A::{Matrix(1,3),Matrix(3,1)},B::{Matrix(1,3),Matrix(3,1)})
option overload;
description "incidence of point and line";
uses LinearAlgebra;
local a,b;
if type(A,'Matrix'(1,3))and type(B,'Matrix'(3,1)) or type(A,'Matrix'(3,1))and type(B,'Matrix'(1,3))  then #not working
a:=convert(A,Vector[row]);
b:=convert(B,Vector[row]);
end if;
print("if = 0 coincident");
a.b ;
end proc


]):

projcross(<<1|2|4>>,<<3|-5|7>>)

"line thro' points"

 

Matrix([[34], [5], [-11]])

(1)

projcross(<<1,2,4>>,<<3,-5,7>>)

"intersect point"

 

Matrix([[34, 5, -11]])

(2)

projcross(<<1|2|4>>,<<34,5,-11>>)

"if = 0 coincident"

 

0

(3)

projcross(<<34,5,-11>> ,<<3|-5|7>> )

"if = 0 coincident"

 

0

(4)

#This section is to derive a CrossProduct and DotProduct for row and column matrix inputs

M:=<A[1,1]|A[1,2]|A[1,3]> ; #point

M := Vector[row](3, {(1) = A[1, 1], (2) = A[1, 2], (3) = A[1, 3]})

(5)

N:=<B[1,1]|B[1,2]|B[1,3]> ; #point

N := Vector[row](3, {(1) = B[1, 1], (2) = B[1, 2], (3) = B[1, 3]})

(6)

(M &x N)^%T ; #line thro' points

3

(7)

R:=<A[1,1],A[2,1],A[3,1]> ;# line

R := Vector(3, {(1) = A[1, 1], (2) = A[2, 1], (3) = A[3, 1]})

(8)

S:=<B[1,1],B[2,1],B[3,1]> ;# line

S := Vector(3, {(1) = B[1, 1], (2) = B[2, 1], (3) = B[3, 1]})

(9)

(R &x S)^%T  ;# intersect point

[`?`]

(10)

 

T:=<A[1,1]|A[1,2]|A[1,3]>  ;#point

T := Vector[row](3, {(1) = A[1, 1], (2) = A[1, 2], (3) = A[1, 3]})

(11)

U:=<B[1,1],B[2,1],B[3,1]>  ;# line

U := Vector(3, {(1) = B[1, 1], (2) = B[2, 1], (3) = B[3, 1]})

(12)

DotProduct(T,U,conjugate=false) ; #check coincidence of point and line

A[1, 1]*B[1, 1]+A[1, 2]*B[2, 1]+A[1, 3]*B[3, 1]

(13)

V:=<A[1,1],A[2,1],A[3,1]> ;# line

V := Vector(3, {(1) = A[1, 1], (2) = A[2, 1], (3) = A[3, 1]})

(14)

 

W:=<B[1,1]|B[1,2]|B[1,3]> ;#point

W := Vector[row](3, {(1) = B[1, 1], (2) = B[1, 2], (3) = B[1, 3]})

(15)

DotProduct(V,W,conjugate=false)  ; #check coincidence of line and point

A[1, 1]*B[1, 1]+A[2, 1]*B[1, 2]+A[3, 1]*B[1, 3]

(16)

# CrossProduct and DotProduct procedure for matrix inputs

 

ProjCp:=overload([

proc(a::Matrix(1,3),b::Matrix(1,3))
option overload;
description "join of points";
local A:=a,B:=b;
print("line thro' points");
<<A[1, 2]*B[1, 3] - A[1, 3]*B[1, 2],-A[1, 1]*B[1, 3] + A[1, 3]*B[1, 1],A[1, 1]*B[1, 2] - A[1, 2]*B[1, 1]>>;
end proc,

 

proc(a::Matrix(3,1),b::Matrix(3,1))
option overload;
description "meet of lines";
local A:=a,B:=b;
print("intersect point");
<<A[2, 1]*B[3, 1] - A[3, 1]*B[2, 1] | -A[1, 1]*B[3, 1] + A[3, 1]*B[1, 1] | A[1, 1]*B[2, 1] - A[2, 1]*B[1, 1] >>;
end proc,

proc(A::{Matrix(1,3),Matrix(3,1)},B::{Matrix(1,3),Matrix(3,1)})
option overload;
description "incidence of point and line";
local dp;
uses LinearAlgebra;
if type(A,'Matrix'(1,3))and type(B,'Matrix'(3,1))   then
dp:=A[1, 1]*B[1, 1] + A[1, 2]*B[2, 1] + A[1, 3]*B[3, 1];

elif type(A,'Matrix'(3,1))and type(B,'Matrix'(1,3)) then
dp:=A[1, 1]*B[1, 1] + A[2, 1]*B[1, 2] + A[3, 1]*B[1, 3];

end if;
print("if = 0 coincident");
return dp
end proc,

proc(A::{Matrix(1,3),list})
option overload;
description "convert to/from cartesian";
if type(A,'Matrix'(1,3)) and A[1,3]<>0 then
[A[1,1]/A[1,3],A[1,2]/A[1,3]];
elif A::list then
<<A[1]|A[2]|1>>;
end if;
end proc,

proc(A::{Matrix(3,1)},{vars:=[x,y]})
option overload;
description "convert to expression";

A[1,1]*vars[1]+A[2,1]*vars[2]+A[3,1];

end proc
 

]):

p1:=<<1|2|4>>:p2:=<<3|-5|7>>:p3:=a*p1-b*p2:

L1:=<<5,7,-8>>:L2:=<<-1,4,-6>>:

L3:=ProjCp(p1,p2)

"line thro' points"

 

L3 := Matrix(3, 1, {(1, 1) = 34, (2, 1) = 5, (3, 1) = -11})

(17)

ProjCp(L1,L2)

"intersect point"

 

Matrix([[-10, 38, 27]])

(18)

ProjCp(p1,L3)

"if = 0 coincident"

 

0

(19)

ProjCp(L3,p1)

"if = 0 coincident"

 

0

(20)

ProjCp(ProjCp(p1,p2),p3)

"line thro' points"

 

"if = 0 coincident"

 

0

(21)

Cartlist:=ProjCp~([p1,p2,p3])

[[1/4, 1/2], [3/7, -5/7], [(a-3*b)/(4*a-7*b), (2*a+5*b)/(4*a-7*b)]]

(22)

ProjCp~(Cartlist)

[Matrix(1, 3, {(1, 1) = 1/4, (1, 2) = 1/2, (1, 3) = 1}), Matrix(1, 3, {(1, 1) = 3/7, (1, 2) = -5/7, (1, 3) = 1}), Matrix(1, 3, {(1, 1) = (a-3*b)/(4*a-7*b), (1, 2) = (2*a+5*b)/(4*a-7*b), (1, 3) = 1})]

(23)

ProjCp~([L1,L2,L3])

[5*x+7*y-8, -x+4*y-6, 34*x+5*y-11]

(24)

 

 

 

 

 

 

 


 

Download 2024-08-16_Projective_Vectors_as_Matrices.mw

What are the best techniques/tools/functions for rendering tabular data in more human-friendly ways within the Maple graphical user interface?

I work with large tables that would be too long to render completely in the interface, and doing so would not be an effective way to represent the data to readers of a Maple Document. However, rendering subsets of the data with headers, captions, colors, and footnotes would be beneficial. It would also be helpful to ensure each data type, such as dates, integers, and strings, was rendered appropriately. Ideally, the table would be rendered with sizing to fit the data rather than always the full width of the Maple Document.

Subsetting the data seems to be straightforward by indexing against the underlying variable. However, the operations available to define the rendering are unclear.

I see that the "Maple 2024 Help" includes documentation for "DocumentTools,Layout,Table." This appears to be the function to focus on specifically, and the DocumentTools Package seems to be the Package where control over layout is provided. Is this the only Package and Function to focus on, or are there alternative techniques?

I found a case where PDEtools:-Solve fail and solve works. I do not understand why. 

Is this a bug or what is going on? I thought they should give same result.


 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1787 and is the same as the version installed in this computer, created 2024, August 10, 8:50 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

eqs:=[-2*arctanh((_C1-1)^(1/2)/_C1^(1/2)) = _C2, 0 = _C1^(3/2)*tanh(1/2*_C2)*sech(1/2*_C2)^2];
unknowns:={_C1,_C2};

[-2*arctanh((_C1-1)^(1/2)/_C1^(1/2)) = _C2, 0 = _C1^(3/2)*tanh((1/2)*_C2)*sech((1/2)*_C2)^2]

{_C1, _C2}

sol1:=solve(eqs,unknowns);

{_C1 = 1, _C2 = 0}

sol2:=PDEtools:-Solve(eqs,unknowns);

 


 

Download why_PDEtools_Solve_fail_august_14_2024.mw

 

I am very confused about this result. 

I call the result of odetest the residual. Which should be zero or simplifies to zero if dsolve solution is correct.

Now, if I do     odetest(solution,ode), I get residual which simplifies to zero. OK. But doing odetest(solution,[ode,IC]) now gives output for the ode residual (first entry) completely different than the first case and which can't be simplified to zero any more. 

odetest also says the solution satisfies the IC, since the second entry of the residual is zero.     

So we have case where the solution satisfies the ODE itself and also satisfies the IC. But when calling odetest with both the ode and the IC, now it says the solution does not satisfiy the ode.

How could this be? What Am I overlooking here? Should not the ode residual remain the same in both calls?

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1787 and is the same as the version installed in this computer, created 2024, August 10, 8:50 hours Pacific Time.`

restart;

ode:=diff(y(x), x, x) = sqrt(1 + diff(y(x), x)^2);

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

IC:=y(0)=1;

y(0) = 1

sol:=[dsolve([ode,IC])][-1]; #just interested in last solution now

 

y(x) = cosh(x+c__1)+1-cosh(c__1)

residual:=odetest(sol,ode)

cosh(x+c__1)-(1/2+(1/2)*cosh(2*x+2*c__1))^(1/2)

simplify(residual) assuming positive;

0

#Why now the residual changes on the ode??
residual:=odetest(sol,[ode,IC])

[cosh(c__1)*cosh(x)+sinh(c__1)*sinh(x)-(1+sinh(x)^2*cosh(c__1)^2+2*sinh(x)*cosh(c__1)*cosh(x)*sinh(c__1)+cosh(x)^2*sinh(c__1)^2)^(1/2), 0]

#no longer simplifes to zero.
map(X->(simplify(X) assuming positive),residual)

[cosh(c__1)*cosh(x)+sinh(c__1)*sinh(x)-(1+sinh(x)^2*cosh(c__1)^2+2*sinh(x)*cosh(c__1)*cosh(x)*sinh(c__1)+cosh(x)^2*sinh(c__1)^2)^(1/2), 0]

 

 

Download odetest_problem_august_14_2024.mw

Hello

I need to use the Ritt algorithm to find the characteristic sets of a set of differential equations. In the past, it seems there was a Maple package by D. Wang available through Maple Applications, but this no longer appears to be the case. I managed to download an old set of files from the author’s site, dated February 1996, which is a Maple V3 package. The instructions in the Readme file mention that using the provided Makefile, an m-file containing all the functions will be created, which can then be loaded into Maple. Unfortunately, running make -f Makefile did not create anything, so I am wondering if I could get some assistance on how to convert this package to something compatible with the latest Maple releases.

The source (txt) files are structured as follows:

Example: 


1) Comments
2) Definition of the User functions - something like

 

dcharsets[dcharset] := proc() `charsets/d_charset`(args) end:

dcharsets[dmcharset] := proc() `charsets/d_mcharset`(args) end:

dcharsets[dcs] := proc() `charsets/d_charser`(args) end:

dcharsets[dmcs] := proc() `charsets/d_mcs`(args) end:

dcharsets[dics] := proc() `charsets/d_ics`(args) end:

and

read `charsets.m`:

# set of non-zero remainders of d-polys in ps wrt d-ascending set as
#       user level function
`charsets/d_remset` :=

subs(`charsets/class`=`charsets/d_class`,
     `charsets/remseta`=`charsets/d_remseta`,
     `charsets/premas`=`charsets/d_premas`,op(`charsets/remset`)):

and lots of Maple procedures - Example below

 

`charsets/d_charset` := proc(ps,lst,medset)

....

end:

the source file ends with the following lines.

read dhelp;
save `dcharsets.m`:
quit

Many thanks

 

Note: Before posting this question here, I tried to contact the author but received no response.

Hi,
 i observe this error as if a sum() was used instead of a add() in dsolve

> assume(g > 0): dsolve({diff(r(t), t$2) + g * t * r(t), r(0) = r0, D(r)(0) = r1},  r(t));
Error, (in dsolve) unsupported type of index, _a

any help or advice, please ?

Sincerely.

I noticed sometimes Maple dsolve solves an ode using a method different than what odeadvisor says it is.

In this example ode, advisor said it is separable. But when solving it, dsolve actually solved it as dAlembert.

Why is that? Should not these be the same?

I also noticed Maple does not verify the solution of the ode when asked to solve it as separable, which is what the advisor says. But it does verify the solution using dAlembert.

So in this example, should not advisor have said this ode is dAlembert and not separable then?

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1786 and is the same as the version installed in this computer, created 2024, August 10, 8:50 hours Pacific Time.`

ode:=y(x) = x + 3*ln(diff(y(x), x));
DEtools:-odeadvisor(ode);

y(x) = x+3*ln(diff(y(x), x))

[_separable]

infolevel[dsolve]:=5:
sol_1:=dsolve(ode);

Methods for first order ODEs:

-> Solving 1st order ODE of high degree, 1st attempt

trying 1st order WeierstrassP solution for high degree ODE

trying 1st order WeierstrassPPrime solution for high degree ODE

trying 1st order JacobiSN solution for high degree ODE

trying 1st order ODE linearizable_by_differentiation

trying differential order: 1; missing variables

trying d'Alembert

<- d'Alembert successful

y(x) = x, y(x) = x+3*ln(exp(-(1/3)*x)*c__1/(-1+exp(-(1/3)*x)*c__1))

map(X->odetest(X,ode),[sol_1]);

[0, 0]

sol_2:=dsolve(ode,[separable]);

Classification methods on request

Methods to be used are: [separable]

----------------------------

* Tackling ODE using method: separable

--- Trying classification methods ---

trying separable

<- separable successful

y(x) = -3*ln(exp(-(1/3)*x)-(1/3)*c__1)

#notice, solution does not verify.
odetest(sol_2,ode);

-3*ln(3*exp(-(1/3)*x)-c__1)-x-3*ln(exp(-(1/3)*x)/(3*exp(-(1/3)*x)-c__1))

 

 

Download why_different_method_used_august_13_2024.mw

I use a procedure called Isee  to print to screen procedures from my packages.

However if the procedure is overloaded it Isee doesn't print it. Is there a way around this.
I have inserted screen shots to show the outputs for the package.

restart

Test:=proc(a::{vector})
print(a);
end proc;

proc (a::{vector}) print(a) end proc

(1)

Test1:=overload([ proc(a::{vector})
                  option overload;
                  print(a);
                  end proc,

                  proc(a::{Matrix})
                  option overload;
                  print(a);
                  end proc
                ])

proc () option overload; [proc (a::{vector}) option overload; print(a) end proc, proc (a::{Matrix}) option overload; print(a) end proc] end proc

(2)

Isee := proc(a)
interface(verboseproc = 3);
printf("%P", eval(a));
end proc;

proc (a) interface(verboseproc = 3); printf("%P", eval(a)) end proc

(3)

Isee(Test)

proc(a::{vector})
    print(a);
end proc

 

Isee(Test1)

proc()
    option overload;
    [proc(a::{vector}) option overload; print(a); end proc,
        proc(a::{Matrix}) option overload; print(a); end proc];
end proc

 

#with(Routines);
#

#An non overloaded procedure in a package

Isee(ConicMatrix);
#

 

                                  ConicMatrix

 

#An overloaded procecure in a package

Isee(FactReduce);
#

                                  FactReduce

 
 

 

Download 2024-08-12_print_overloaded_procedure.mw

I was looking at the application center about attractors and found the Rossler attractor app that illustrates the Rossler Attractor with animations, as you can see below. But when I try to run it on my laptop  the two last plots remain empty. Why is this happening?

Rossler Flow System - Rossler Attractor

by Yufang Hao, <yhao@student.math.uwaterloo.ca>

This worksheet contains the images of the Rossler Attractor and the animations that follow the trajectory.

restart; with(DEtools): with(plots):

Warning, the name changecoords has been redefined

 

The Rossler attractor is defined by a set of three Differential equations:

x' = -(y+z)

y' = x+a*y

z' = b + x*z - c*z

where the coefficients a, b, and c are adjustable constants.

rosslerEqns := [
diff(x(t),t) = -(y(t)+z(t)),
diff(y(t),t) = x(t) + a*y(t),
diff(z(t),t) = b + x(t)*z(t) - c*z(t) ];

rosslerEqns := [diff(x(t), t) = -y(t)-z(t), diff(y(t), t) = x(t)+a*y(t), diff(z(t), t) = b+x(t)*z(t)-c*z(t)]

(1)

a:=0.17: b:=0.4: c:=8.5:
DEplot3d(rosslerEqns, {x(t),y(t),z(t)}, t=0..300,
         [[x(0)=0, y(0)=0, z(0)=0]],
         x =-15..15, y=-15..15,z=-5..25,
         stepsize=0.05, linecolour=1+sin(t*Pi/3)/2,
         thickness=1, orientation = [-110,71]);

 

a:=0.17: b:=0.4: c:=8.5:
display(
  [seq(
    DEplot3d(rosslerEqns, {x(t),y(t),z(t)}, t=0..4*i,
         [[x(0)=0, y(0)=0, z(0)=0]],
         x =-15..15, y=-15..15,z=-5..25,
         stepsize=0.05, linecolour=1+sin((i-t)*Pi/5)/2,
         thickness=2, orientation = [-110,71]),
    i=1..25) # end seq
  ], # end DEplot3d list
insequence=true);

 

a:=0.17: b:=0.4: c:=8.5:
display(
  [seq(
    DEplot3d(rosslerEqns, {x(t),y(t),z(t)}, t=0..4*i,
         [[x(0)=0, y(0)=0, z(0)=0]],
         x =-15..15, y=-15..15,z=-5..25,
         stepsize=0.05, linecolour=1+sin((i-t)*Pi/5)/2,
         thickness=2, orientation = [-110,71]),
    i=1..25) # end seq
  ], # end DEplot3d list
insequence=true);

 

 

 

 


 

Download rossler_attractor.mws

How to get Li(x) to display as result of int(1/ln(x),x) in Maple instead of -Ei(1,-ln(x))

I'd like to match result of Maple with another software I use and it is also simpler to look at

int(1/ln(x),x)

Now gives

             -Ei(1,-ln(x))

How to make it show  Li(x) instead?

The Maple help page for Li is this

And the other software Li help page is this

I tried simplify in Maple but it does not do anything. How to get Li(x) in Maple for int(1/ln(x),x);  instead of -Ei(1, -ln(y)) ?

Note that 

diff(Li(x),x)

Gives 1/ln(x) so Li(x) is the correct antiderivative.

Here is also the wiki page

I know that Maple's result is correct, I am just asking about the form it is shown. Since Maple has Li(x) function, why not use it for this result?

 

Maple 2024.1


 

An attractor is called strange if it has a fractal structure, that is if it has a non-integer Hausdorff dimension. This is often the case when the dynamics on it are chaotic, but strange nonchaotic attractors also exist.  If a strange attractor is chaotic, exhibiting sensitive dependence on initial conditions, then any two arbitrarily close alternative initial points on the  attractor, after any of various numbers of iterations, will lead to  points that are arbitrarily far apart (subject to the confines of the attractor), and after any of various other numbers of iterations will  lead to points that are arbitrarily close together. Thus a dynamic system with a chaotic attractor is locally unstable yet globally stable: once some sequences have entered the attractor, nearby points diverge  from one another but never depart from the attractor.


The term strange attractor was coined by David Ruelle and Floris Takens to describe the attractor resulting from a series of bifurcations of a system describing fluid flow. Strange attractors are often differentiable in a few directions, but some are like a Cantor dust, and therefore not differentiable. Strange attractors may also be found  in the presence of noise, where they may be shown to support invariant  random probability measures of Sinai–Ruelle–Bowen type.


Examples of strange attractors include the  Rössler attractor, and Lorenz attractor.

 

 

THOMAS``with(plots); b := .20; sys := diff(x(t), t) = sin(y(t))-b*x(t), diff(y(t), t) = sin(z(t))-b*y(t), diff(z(t), t) = sin(x(t))-b*z(t); sol := dsolve({sys, x(0) = 1.1, y(0) = 1.1, z(0) = -0.1e-1}, {x(t), y(t), z(t)}, numeric); odeplot(sol, [x(t), y(t), z(t)], t = 0 .. 600, axes = boxed, numpoints = 50000, labels = [x, y, z], title = "Thomas Attractor")

 

 

 

Dabras``

with(plots); a := 3.00; b := 2.7; c := 1.7; d := 2.00; e := 9.00; sys := diff(x(t), t) = y(t)-a*x(t)+b*y(t)*z(t), diff(y(t), t) = c*y(t)-x(t)*z(t)+z(t), diff(z(t), t) = d*x(t)*y(t)-e*z(t); sol := dsolve({sys, x(0) = 1.1, y(0) = 2.1, z(0) = -2.00}, {x(t), y(t), z(t)}, numeric); odeplot(sol, [x(t), y(t), z(t)], t = 0 .. 100, axes = boxed, numpoints = 35000, labels = [x, y, z], title = "Dabras Attractor")

 

Halvorsen

NULLwith(plots); a := 1.89; sys := diff(x(t), t) = -a*x(t)-4*y(t)-4*z(t)-y(t)^2, diff(y(t), t) = -a*y(t)-4*z(t)-4*x(t)-z(t)^2, diff(z(t), t) = -a*z(t)-4*x(t)-4*y(t)-x(t)^2; sol := dsolve({sys, x(0) = -1.48, y(0) = -1.51, z(0) = 2.04}, {x(t), y(t), z(t)}, numeric, maxfun = 300000); odeplot(sol, [x(t), y(t), z(t)], t = 0 .. 600, axes = boxed, numpoints = 35000, labels = [x, y, z], title = "Halvorsen Attractor")

 

Chen

 

 

with(plots); alpha := 5.00; beta := -10.00; delta := -.38; sys := diff(x(t), t) = alpha*x(t)-y(t)*z(t), diff(y(t), t) = beta*y(t)+x(t)*z(t), diff(z(t), t) = delta*z(t)+(1/3)*x(t)*y(t); sol := dsolve({sys, x(0) = -7.00, y(0) = -5.00, z(0) = -10.00}, {x(t), y(t), z(t)}, numeric); odeplot(sol, [x(t), y(t), z(t)], t = 0 .. 100, axes = boxed, numpoints = 35000, labels = [x, y, z], title = "Chen Attractor")

 

References

1. 

https://www.dynamicmath.xyz/strange-attractors/

2. 

https://en.wikipedia.org/wiki/Attractor#Strange_attractor

``


 

Download Attractors.mw

Hi everyone...

How can I remove the warning (Warning, (in anonymous procedure created in Typesetting:-FI) `m` is implicitly declared local
) from this for command in Maple 2024? I know the warning can be ignored but I want to remove it anyway.

for k from 1 to 4 do
    A[k] := Matrix(k, k, (i, j) -> local m; ifelse(i + j < k + 2, add(Y[i - m + j - 1]*binomial(i - 1, m)*(-1)^m, m = 0 .. i - 1), 0));
end do

tnx...

I do not think I ever saw this warning messages from dsolve. This is _Clairaut first order ode. When adding the option singsol=all in the dsolve call, Maple replies with 

I do not have earlier version of Maple to try as my C: drive died and lost all my Maple's installed versions. I need to to try to install older version of Maple sometime and check.

Is this new warning and why does it show? Is this suppose to happen? 


 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1782 and is the same as the version installed in this computer, created 2024, August 8, 16:5 hours Pacific Time.`

restart;

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

a*(1+(diff(y(x), x))^3)^(1/3)+x*(diff(y(x), x))-y(x) = 0

dsolve(ode,y(x),singsol=all)

Warning, only 1 systems are considered

Warning, only 1 systems are considered

y(x) = a*(c__1^3+1)^(1/3)+x*c__1

 


 

Download strange_warning_message_from_dsolve.mw

I also noticed these warning messages show up only the first time dsolve is called on this ode.

Calling it again right after, using the same command, the warning messages no longer show up, which is  even more strange.

 

I am plotting phase plot of two first order ode's.

I noticed when added +t to one ode, the plot generated losses all the slope fields. Any one knows why and if this is just limitation of DEplot or if there is a way to workaround it. 

THis worksheet has first example showing expected output, then second example where +t was added first ode. Now same code generates plot will all the slope field gone.


 

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

sys:=[diff(x(t),t)+diff(y(t),t) = x(t)+y(t), 2*diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)];
DEtools:-DEplot(sys,[x(t), y(t)],
        t = 0 .. 200,x = -1000 .. 1000,y = -1000 .. 1000,
        [[x(0)=1, y(0)=2]],
        labels = [x(t), y(t)],
        linecolor =red,arrowsize = 1.5,axes = boxed,
        color = 'magnitude[legacy]')

[diff(x(t), t)+diff(y(t), t) = x(t)+y(t), 2*(diff(x(t), t))+diff(y(t), t) = 2*x(t)+3*y(t)]

#added +t to the RHS of one ode. Everything else the same.
sys_2:=[diff(x(t),t)+diff(y(t),t) = x(t)+y(t)+t, 2*diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)];
DEtools:-DEplot(sys_2,[x(t), y(t)],
        t = 0 .. 200,x = -1000 .. 1000,y = -1000 .. 1000,
        [[x(0)=1, y(0)=2]],
        labels = [x(t), y(t)],
        linecolor =red,arrowsize = 1.5,axes = boxed,
        color = 'magnitude[legacy]')

[diff(x(t), t)+diff(y(t), t) = x(t)+y(t)+t, 2*(diff(x(t), t))+diff(y(t), t) = 2*x(t)+3*y(t)]

dsolve([op(sys),x(0)=1, y(0)=2]);

{x(t) = 3*exp(t)-2*exp(-t), y(t) = 2*exp(-t)}

dsolve([op(sys_2),x(0)=1, y(0)=2]);

{x(t) = 4*exp(t)-4*exp(-t)+1-3*t, y(t) = 4*exp(-t)-2+2*t}

 


 

Download strange_DEplot.mw

update

if someone is interested, I found Maple has builtin function to check if system of ode's is autonomous or not. So changed my code to check first. Here is how to check:


 

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

restart;

sys:=[diff(x(t),t)+diff(y(t),t) = x(t)+y(t), 2*diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)];
if DEtools:-autonomous(sys,[x(t),y(t)],t) then
    DEtools:-DEplot(sys,[x(t), y(t)],
        t = 0 .. 200,x = -1000 .. 1000,y = -1000 .. 1000,
        [[x(0)=1, y(0)=2]],
        labels = [x(t), y(t)],
        linecolor =red,arrowsize = 1.5,axes = boxed,
        color = 'magnitude[legacy]');
else
  print("WARNING, non-autonomous system. Will not do phase plot");
fi;

[diff(x(t), t)+diff(y(t), t) = x(t)+y(t), 2*(diff(x(t), t))+diff(y(t), t) = 2*x(t)+3*y(t)]

#added +t to the RHS of one ode. Everything else the same.
sys_2:=[diff(x(t),t)+diff(y(t),t) = x(t)+y(t)+t, 2*diff(x(t),t)+diff(y(t),t) = 2*x(t)+3*y(t)];
if DEtools:-autonomous(sys_2,[x(t),y(t)],t) then
   DEtools:-DEplot(sys_2,[x(t), y(t)],
        t = 0 .. 200,x = -1000 .. 1000,y = -1000 .. 1000,
        [[x(0)=1, y(0)=2]],
        labels = [x(t), y(t)],
        linecolor =red,arrowsize = 1.5,axes = boxed,
        color = 'magnitude[legacy]');
else
  print("WARNING, non-autonomous system. Will not do phase plot");
fi;

[diff(x(t), t)+diff(y(t), t) = x(t)+y(t)+t, 2*(diff(x(t), t))+diff(y(t), t) = 2*x(t)+3*y(t)]

"WARNING, non-autonomous system. Will not do phase plot"

 


 

Download strange_DEplot_V2.mw

 

 

 

I found that  DynamicSystems package uses global variable called s

THis makes zero design sense. Why would a package use a global variable that could have been used by a user? 

What is the correct way to prevent this warning message from showing up, as I have no control over what variable can be used in global space.  I also tried to declare as local to the function that is using the package, but that did not help. Only way was to remove variable from global space before.

Any suggestions?  And why DynamicSystems is even using global symbols in first place?


 

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

restart;

z

foo:=proc()
 local sv;

 DynamicSystems:-SystemOptions('statevariable'=sv);

end proc;
 

proc () local sv; DynamicSystems:-SystemOptions('statevariable' = sv) end proc

s:="test";
foo();

"test"

Warning, the global variable(s) {s} used by DynamicSystems are assigned values.  They must be unassigned to load DynamicSystems.  DynamicSystems:-SystemOptions may be used to reassign the options that use these variable(s):
  complexfreqvar = s

x

restart;

foo:=proc()
 local sv;
 local s;

 DynamicSystems:-SystemOptions('statevariable'=sv);

end proc;

proc () local sv, s; DynamicSystems:-SystemOptions('statevariable' = sv) end proc

s:="test";
foo();

"test"

Warning, the global variable(s) {s} used by DynamicSystems are assigned values.  They must be unassigned to load DynamicSystems.  DynamicSystems:-SystemOptions may be used to reassign the options that use these variable(s):
  complexfreqvar = s

x

restart;

#warnign goes away when there is no global used  s before the call is made
foo:=proc()
 local sv;
 local s;

 DynamicSystems:-SystemOptions('statevariable'=sv);

end proc;

proc () local sv, s; DynamicSystems:-SystemOptions('statevariable' = sv) end proc

foo();

x

 


 

Download dynamic_systems_uses_gloabl_s.mw

 

First 26 27 28 29 30 31 32 Last Page 28 of 41