Maple 2022 Questions and Posts

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

I have string of length

StringTools:-Length(str);
                            1073105

When doing

p:=StringTools:-LengthSplit(str,100):

Maple gives

 

From help:

LengthSplit
split a string into equal length pieces

 

This is all done in .mpl  file actually, not interactive, but I made the above worksheet to show  the problem. The string is read from a file by a program and it wants to split it to 100 length smaller strings.

I have lots of RAM. 128 GB.  So why does Maple crash and is there a workaround this?

This string was generated by another software.

I have attached the above example below as worksheet.  Maple 2022.1 on windows 10.

Here is a simpler way to generate this problem

restart;
str:=StringTools:-Random(1073104,'upper'):
str[1..10];

StringTools:-Length(str);
p:=StringTools:-LengthSplit(str,100):

 

Using trial and error, the crash happens when the length reaches 1073101. At 1073100 there was no crash.

 

 

Found case where PDEtools:-Solve gives exception but not solve.

Is this known issue?

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

restart;

result:=1/2*(Dirac(1,-t+4+k)+Dirac(1,t-4+k)-Dirac(1,-t+4+k)*cos(-t+4+k)+2*Dirac(-t+4+k)*sin(-t+4+k)+2*sin(t-4+k)*Dirac(t-4+k)-Dirac(1,t-4+k)*cos(t-4+k))/k;
result:=simplify(result) ;
PDEtools:-Solve(result = 0,t) assuming t::real

(1/2)*(Dirac(1, -t+4+k)+Dirac(1, t-4+k)-Dirac(1, -t+4+k)*cos(-t+4+k)+2*Dirac(-t+4+k)*sin(-t+4+k)+2*sin(t-4+k)*Dirac(t-4+k)-Dirac(1, t-4+k)*cos(t-4+k))/k

(1/2)*(Dirac(1, -t+4+k)+Dirac(1, t-4+k)-Dirac(1, -t+4+k)*cos(-t+4+k)+2*Dirac(-t+4+k)*sin(-t+4+k)+2*sin(t-4+k)*Dirac(t-4+k)-Dirac(1, t-4+k)*cos(t-4+k))/k

Error, (in assuming) when calling 'RootOf'. Received: 'expression independent of, _Z, RootOf'

solve(result = 0,t) assuming t::real

 

Download exception_from_Solve_august_8_2022.mw

UNIVERSIDAD AUTÓNOMA METROPOLITANA
UNIDAD XOCHIMILCO

15º Foro de Investigación de las Matemáticas Aplicadas a las Ciencias Sociales "Reflexiones sobre Educación y Matemáticas”,

"Learning of mathematical functions using applications with Maple, for students of Social Sciences"

The students of the first cycles have a low level of learning in the subject of functions, and the arrival of the pandemic worsened the understanding of this content. Increasing the use of ICT in great magnitude improving learning.
To determine the relationship between learning and mathematical functions using applications with Maple, for students of Social Sciences. The experimental method was used using the scientific software Maple applied to students of Social Sciences.

In Spanish.

 

Lenin Araujo Casillo

Ambassador of Maple

 

 

I create a plot, then later on, I want to use the same view for a second plot or using the same starting x, ending x and starting y and ending y. For reasons no need to get into into, I need to do this and I have no access to this information at this time. I only have access to the p variable used to store the plot into as in this example below.

I am not sure what is the correct way to do read this information from the PLOTS structure as I never used it before. 

Help describes the PLOTS structure under "PLOT and PLOT3D Data Structures" , but do not see how is one supposed to read different parts of it. I could have missed it. Maple help pages are very hard for me to read in order to obtain the information needed. From help it says:

The Maple plotting functions, plot, plot3d, and others, produce PLOT and PLOT3D data structures describing the images to be displayed.

By trial and error, for standard plot this worked

p:=plot(sin(x),x=-1..10):
op([4,1,2,2],p)

returns

           "originalview" = [-0.9862500000 .. 9.9862500000, -1.0000000000 .. 1.0000000000]

I see also that command plottools:-getdata(p):  returns the data. So I could also do (it is stored in matrix, in third entry):

p0:=plottools:-getdata(p);
startingx:=p0[3][1,1];
startingy:=p0[3][1,2];
endingx:=p0[3][-1,1];
endingy:=p0[3][-1,2];

Will the above work all the time? should this command be used to obtain this information or is there a better way?

When I lprint(p) I see these fields have actual names. For example  , here is screen shot of lprint(p)  

 

it looks like  a RECORD data structure. But when I tried p:-originalview  Error, `p` does not evaluate to a module 

The question is: What is the correct way to find what x range and y range was used for an earlier plot, given one has access only to p variable used to store the output of the plot command?  This is for 2D plot only.

I have differential equation with x as independent variable that I want to convert to state space representation.

But DynamicSystems will not accept y(x) as the output variable, since it defaults to y(t).

Help under "Description of the Model of a Linear System Object" says it is possible to change the independent variable by changing continuoustimevar setting. But help does not give an example how to do this and all my tries failed.

How to do this? Attached is worksheet showing the problem

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

restart;
ode:=diff(y(x),x$2)+y(x) = 0;
DynamicSystems:-DiffEquation(ode,'outputvariable'=[y(x)]);

diff(diff(y(x), x), x)+y(x) = 0

Error, (in DynamicSystems:-DiffEquation) missing output(s): {y(t)}

restart;
ode := diff(y(t),t$2) + y(t) =0;
sys:=DynamicSystems:-DiffEquation(ode,'outputvariable'=[y(t)]);

ode := diff(y(t), t, t)+y(t) = 0

_m2541722345344

Download DS_problem.mw

 

Using t=0 .. 3*Pi the plot is truncated. Changing the 3*Pi to a number, then the full plot shows.

Also keeping 3*Pi but changing y=-1..1 to y=-1.01 .. 1.01 now the full plot shows again.

Is the above normal behaviour or it it a bug?


 

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

restart;
ode := diff(y(t), t$2) + y(t)=0;
DEtools:-DEplot(ode, y(t), t=0 .. 3*Pi, y=-1 .. 1,[[y(0)=1,D(y)(0)=0]],linecolor=blue);

diff(diff(y(t), t), t)+y(t) = 0

#replacing 3*Pi by a number, then it shows the full plot
restart;
ode := diff(y(t), t$2) + y(t)=0;
DEtools:-DEplot(ode, y(t), t=0 .. 10, y=-1 .. 1,[[y(0)=1,D(y)(0)=0]],linecolor=blue);

diff(diff(y(t), t), t)+y(t) = 0

#keeping 3*Pi but changing the y range, it now also show the full plot
restart;
ode := diff(y(t), t$2) + y(t)=0;
DEtools:-DEplot(ode, y(t), t=0 .. 3*Pi, y=-1.01 .. 1.01,[[y(0)=1,D(y)(0)=0]],linecolor=blue);

diff(diff(y(t), t), t)+y(t) = 0

 


 

Download strange_result_of_DEplot.mw

 

I want to collect up the equation terms by the numerical value of the terms coefficient? Have tried sort collect combine...
So far the best I have come up with is nops(indets(on each term). And put them in seperate lists. This still doesn't quiet do the trick.
I am looking to achieve. Would to happy to have then as seperate l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[3]^4*a[4]+10*a[3]^3*a[4]^2+10*a[3]^2*a[4]^3+5*a[3]*a[4]^4+a[4]^5

L1 := []; L2 := []; L3 := []; L4 := []; for i to nops(els) do if nops(indets(els[i])) = 1 then L1 := [op(L1), els[i]] elif nops(indets(els[i])) = 2 then L2 := [op(L2), els[i]] elif nops(indets(els[i])) = 3 then L3 := [op(L3), els[i]] else L4 := [op(L4), els[i]] end if end do; L1; L2; L3; L4

[60*a[1]*a[2]*a[3]*a[4]^2, 60*a[1]*a[2]*a[3]^2*a[4], 60*a[1]*a[2]^2*a[3]*a[4], 60*a[1]^2*a[2]*a[3]*a[4]]

indets(els[7])

{a[1], a[4]}

NULL

indets(els(5))

{}

`~`[op](1 .. -1, L2)

[5, a[1], a[2]^4, 5, a[1], a[3]^4, 5, a[1], a[4]^4, 10, a[1]^2, a[2]^3, 10, a[1]^2, a[3]^3, 10, a[1]^2, a[4]^3, 10, a[1]^3, a[2]^2, 10, a[1]^3, a[3]^2, 10, a[1]^3, a[4]^2, 5, a[1]^4, a[2], 5, a[1]^4, a[3], 5, a[1]^4, a[4], 5, a[2], a[3]^4, 5, a[2], a[4]^4, 10, a[2]^2, a[3]^3, 10, a[2]^2, a[4]^3, 10, a[2]^3, a[3]^2, 10, a[2]^3, a[4]^2, 5, a[2]^4, a[3], 5, a[2]^4, a[4], 5, a[3], a[4]^4, 10, a[3]^2, a[4]^3, 10, a[3]^3, a[4]^2, 5, a[3]^4, a[4]]

NULL

op(2, L2[1])

a[1]

op(3, L2[1])

a[2]^4``

Download 30-7-22_Q_sort_equation_by_numerical_coeffs.mw

I am dealing with a system of differential equations and this method is galerkin method i just cant understand why it is not working for positive Rn parameter value.

NULL

restart; with(LinearAlgebra); with(plots); with(plottools); n := 8; M1 := Matrix(n, n); M2 := Matrix(n, n); M3 := Matrix(n, n); M4 := Matrix(n, n); M5 := Matrix(n, n); M6 := Matrix(n, n); M7 := Matrix(n, n); M8 := Matrix(n, n); M9 := Matrix(n, n); M := Matrix(3*n, 3*n); Na := 5; Nb := 75*(1/10000); Rn := 1/10*0; Q = 100; Le := 5*10^3

n := 8

 

Matrix(8, 8, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0})

 

Matrix(8, 8, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0})

 

Matrix(8, 8, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0})

 

Matrix(8, 8, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0})

 

Matrix(8, 8, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0})

 

Matrix(8, 8, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0})

 

Matrix(8, 8, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0})

 

Matrix(8, 8, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0})

 

Matrix(8, 8, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 0, (5, 8) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 0, (8, 4) = 0, (8, 5) = 0, (8, 6) = 0, (8, 7) = 0, (8, 8) = 0})

 

_rtable[36893490338932329636]

 

5

 

3/400

 

0

 

Q = 100

 

5000

(1)

w := unapply(z^(i+1)-2*z^(i+2)+z^(i+3), i)

proc (i) options operator, arrow; z^(i+1)-2*z^(i+2)+z^(i+3) end proc

(2)

theta := unapply(z^i-z^(i+1), i)

proc (i) options operator, arrow; z^i-z^(i+1) end proc

(3)

phi := unapply(Na*(z^(i+1)-z^i), i)

proc (i) options operator, arrow; 5*z^(i+1)-5*z^i end proc

(4)

f1 := simplify(expand((diff(w(j), `$`(z, 4))-2*a^2*(diff(w(j), `$`(z, 2)))+a^4*w(j)-Q*(diff(w(j), `$`(z, 2))))*w(i))); F1 := unapply(int(f1, z = 0 .. 1), i, j)

f2 := simplify(expand(-R*a^2*theta(j)*w(i))); F2 := unapply(int(f2, z = 0 .. 1), i, j)

f3 := simplify(expand(Rn*a^2*phi(j)*w(i))); F3 := unapply(int(f3, z = 0 .. 1), i, j)

f4 := expand(w(j)*theta(i)); F4 := unapply(int(f4, z = 0 .. 1), i, j)

f5 := expand((diff(theta(j), `$`(z, 2))-a^2*theta(j)-Na*Nb*(diff(theta(j), `$`(z, 1)))/Le)*theta(i)); F5 := unapply(int(f5, z = 0 .. 1), i, j)

f6 := expand(-Nb*(diff(phi(j), `$`(z, 1)))*theta(i)/Le); F6 := unapply(int(f6, z = 0 .. 1), i, j)

f7 := expand(-Na*w(j)*phi(i)); F7 := unapply(int(f7, z = 0 .. 1), i, j)

f8 := expand(Na*(diff(theta(j), `$`(z, 2))-a^2*theta(j))*phi(i)/Le); F8 := unapply(int(f8, z = 0 .. 1), i, j)

f9 := expand((diff(phi(j), `$`(z, 2))-a^2*phi(j))*phi(i)/Le); F9 := unapply(int(f9, z = 0 .. 1), i, j)

for i from 1 by 1 to n do;

for j from 1 by 1 to n do;

M1[i,j]:=F1(i,j);M2[i,j]:=F2(i,j);M3[i,j]:=F3(i,j);;M1;M2;M3;

M4[i,j]:=F4(i,j);M5[i,j]:=F5(i,j);M6[i,j]:=F6(i,j);;M4;M5;M6;

M7[i,j]:=F7(i,j);M8[i,j]:=F8(i,j);M9[i,j]:=F9(i,j);;M7;M8;M9;

end do;

end do;

 

 

M[1 .. n, 1 .. n] := M1 : M[1 .. n, n+1 .. 2*n] := M2 :  M[1 .. n, 2*n+1 .. 3*n] := M3:

M[n+1 .. 2*n, 1 .. n] := M4  :  M[n+1 .. 2*n, n+1 .. 2*n] := M5 : M[n+1 .. 2*n, 2*n+1 .. 3*n] := M6 :

M[2*n+1 .. 3*n, 1 .. n] := M7 : M[2*n+1 .. 3*n, n+1 .. 2*n] := M8  :  M[2*n+1 .. 3*n, 2*n+1 .. 3*n] := M9:

 

 

NULL

NULL

NULL

NULL

NULL

T1:=[];T2:=[];

for Q from 0 by 20 to 100 do;

eq := LinearAlgebra:-Determinant(M)= 0;

m:=solve(eq, R):

mi:=Optimization[Minimize](m, k = 0 .. 7);

T1:=[op(T1),[Q,rhs(mi[2][1])]];

T2:=[op(T2),[Q,mi[1]]];

end do:

p1:=evalm(T1);

p2:=evalm(T2);

writedata("p1-Peinf-x00001.txt", p1, float);

writedata("p2-Peinf-x00001.txt", p2, float);

 

T1 := []

 

T2 := []

 

p1 := Matrix(6, 2, {(1, 1) = 0, (1, 2) = 3.11632362135016, (2, 1) = 20, (2, 2) = 3.39026717599406, (3, 1) = 40, (3, 2) = 3.59368803120848, (4, 1) = 60, (4, 2) = 3.75681900077073, (5, 1) = 80, (5, 2) = 3.89369539415967, (6, 1) = 100, (6, 2) = 4.01202866699959})

 

array( 1 .. 6, 1 .. 2, [( 4, 1 ) = (60), ( 4, 2 ) = (3000.645633), ( 5, 1 ) = (80), ( 1, 2 ) = (1707.763149), ( 6, 2 ) = (3757.233827), ( 6, 1 ) = (100), ( 2, 1 ) = (20), ( 2, 2 ) = (2171.788019), ( 1, 1 ) = (0), ( 3, 2 ) = (2598.344120), ( 5, 2 ) = (3385.567006), ( 3, 1 ) = (40)  ] )

(5)

NULL

NULL

plot(p1)

 

NULL

plot(p2)

 

NULL

NULL

NULL

Download code.mw

I just want to plot when Rn value is non-zero.

 

Dear All,

I have a question about "fraddiff" command to compute the fractional derivative of a function.
I need to produce  a procedure to manually compute Caputo fractional derivative of a function, instead of using "fracdiff", as the following:

Frac_C:=proc()
description "Frac_C(function,lower bound, variable (upper bound), order of differentiation)";
a:=args[2];
x:=args[3];
alpha:=args[4];
f:=unapply(args[1],args[3]);
m:=ceil(alpha);
return 1/GAMMA(m-alpha)*int((x-tau)^(m-alpha-1)*diff(f(tau),tau$m),tau=a..x);
end proc;

when I call the above procedure, as Frac_C(x^(3.4),0,x,3/4), Maple is not able to calculate the integral defined in the Caputo fractional derivative. However, I saw the pre-defined Maple command, namely fracdiff, is able to do.
Where is the trouble?
can anyone help me?

It is worth mentioning that I can calculate the fractional derivative of a functional by procedure "Frac_C()" when I try to use it at the given x as the following which is not desirable for me.
evalf(subs(x=2,Frac_C(x^(3.4),0,x,3/4)));
evalf(subs(x=2,fracdiff(x^(3.4),x,3/4)));

Best wishes

Download a.mw

The question is in the picture.

y(x) is the result of the last calculation. How do I apply diff to the last result?

Thanks!

Given two terms in expression of type  `+` where the first is rational and the second is not, I wanted to combine both under on common denominator to obtain one term (not `+` any more).

I expected that combine will do that.

restart;
expr:=A/B+C;
combine(expr);

But the above leaves the original expression as is. Ofcourse I can just do

numer(expr)/denom(expr);

Here is screen shot

My question is why combine does not do that automatically? For reference, Mathematica command Together is the equivalent to Maple combine and this is what it does

Which is what one would expect to happen. 

I am just trying to understand the logic why Maple's combine did not work as one would expect. That is all. I looked at help and tried different option to combine, but non worked.

Is there  a specific type name for vectors in Physics[Vectors]?  Specifically, Let's say we want to write a proc whose argument is expected to be a (Physics) Vector, as in  these (trivial) demos:

with(Physics[Vectors]);

f := proc(a_::???)
    return a_ . a_;
end proc:

g := proc(a_::???, b_::???)
    return a_ &x b_;
end proc:

What do we put in place of "???".

Maple knows how to obtain differntials using D.

So typing  D(x*y) it gives   D(x)*y+x*D(y)

But what I want is given as input  D(x)*y+x*D(y) have Maple return back D(x*y)

Nothing I tried work. I tried simplify and convert(...,D) 

I am looking for a function that