Maple 2020 Questions and Posts

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

Warning, data could not be converted to float Matrix

Hi friends

Could you please give hints to solve the integral

int(exp(I*k*x)*sech(x),x=-infinity..infinity)

Thanks

) Write a procedure that generates a plot of a ‘rose’. If the number of petals is even, have your procedure colour in the petals aquamarine, if the number of petals is odd, colour in the petals pink.

Test your procedure by generating two flowers, one with an even number of petals and one with an odd number of petals.

Why Maple returns empty solution (see eq. (5))? Also, is it possible that Maple not only gives us the explit solution but also the solution steps?

restart

with(PDEtools, TWSolutions, declare)

[TWSolutions, declare]

(1)

with(DEtools, diff_table)

[diff_table]

(2)

U := diff_table(u(x, t))

table( [(  ) = u(x, t) ] )

(3)

sys := {U[]*U[x]+U[t]-pU[x, x]+qU[x, x, x] = 0}

{u(x, t)*(diff(u(x, t), x))+diff(u(x, t), t)-pU[x, x]+qU[x, x, x] = 0}

(4)

TWS_sol := TWSolutions(sys)

(5)

map(pdetest, [TWS_sol], sys)

[]

(6)

``

Download twsol.mw

Hi,

I am fairly new to Maple and trying to figure out how to output text to a file, but nothing seems to be working. I would like to generate code files for Julia using Maple expressions.

I am in worksheet mode, using a 'code edit' region. If I do:

jlfile := fopen("./juliafunc.jl",WRITE,TEXT);

then the file is created, as intended. However, neither of the following commands seem to write any text to the file:

writeline(jlfile,"This is a test.");
fprintf(jlfile,"This is a test.\n");

(these are similar to the examples in the dcumentation)

Is there something I am doing wrong? I am using Maple 2020 on Linux.

Hi

My third-party soft is fussy: it will only accept pasted plaintext, with no spaces in between, for example:

1407,1411,2,1408,1409,0
1407,1408,2,1409,1411,0

#My input is 
ans1 := [1407, 1408, 2, 1409, 1411, 0], [1407, 1409, 2, 1408, 1411, 0], [1407, 1411, 2, 1408, 1409, 0];

#I am "trying" to remove the whitespace and convert it to plain text

with(StringTools):
for i to 3 do
seq(parse(DeleteSpace(convert(ans1[i][j],string))),j=1..6);
next i
od;

#But the whitespace is still there....

lprint(%%%);lprint(%%);lprint(%)
ans1 := [1407, 1408, 2, 1409, 1411, 0], 

  [1407, 1409, 2, 1408, 1411, 0], [1407, 1411, 2, 1408, 1409, 0]


                  1407, 1408, 2, 1409, 1411, 0

                  1407, 1409, 2, 1408, 1411, 0

                  1407, 1411, 2, 1408, 1409, 0

Please answer the commented questions in the uploaded worksheet.

Binary_search.mw

Hi

I'm trying to automate this production of doubles combinations with a set scoreline in between. The minimum is 4 players, but we could have many more players, producing many combinations. 

example: 4 players, set score 2-0 for each match

with(combinat):
DBL:=choose([Novice,Weak_Intermediate,Strong_Intermediate,Advanced], 2);
DBL[1],2,DBL[6],0;DBL[2],2,DBL[5],0;DBL[3],2,DBL[4],0

#and the reverse
DBL[6],2,DBL[1],0;DBL[5],2,DBL[2],0;DBL[4],2,DBL[3],0
 

#the output contains square brackets. How do I remove them?

"Warning, unable to evaluate 2 of the 6 functions to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct" How to fix it?

mww.mw

I inadvertently discovered that the save command (and probably read, write, export and import commands too?) returns an error (something like "can't write ...") when the file length is too large (265 in my case).

Is this documented somewhere?
Is there a way to exceed this limit?
Assuming D=".../" and F="xxx.m", can we set the path of the directory D to some value and then use save something, F instead of save something cat(D, F) ?

Thanks in advance

How to draw a phase portrait of (2) same as in the attached figure? I tried it by using dsolve, but couldn't redraw it.  

restart

with(DEtools); with(plots)

alias(phi = phi(xi))

phi

(1)

eq := (1/2)*m*(diff(phi, xi))^2+`Φ__∓` = h

(1/2)*m*(diff(phi, xi))^2+`Φ__∓` = h

(2)

NULL

`Φ__∓` = `&-+`(1-cos(phi))

`Φ__∓` = `&-+`(1-cos(phi))

(3)

``

Download PP.mw

Hi,

everyone! I want to get a system of equations (Fig. 1). But my result is a table (Fig. 2), so I wonder how to convert a table into a sequence or a system. And I am very sorry that my code is not concise, since I am a beginner. Thank you very much!

Download Equations.mw

I solved the differential equation using 'dsolve' and Maple returns it with fiver possible solutions. How can we get the single possible solution for w(x) if we assume c, g (constants) are positive? Also, can we convert JacobiSN() to a simple trigonometric or algebraic function?

restart

with(DEtools)

``

q := (1/2)*(diff(w(x), x))^2+(1/8)*w(x)^4-(1/2)*c*w(x)^2-g = 0

(1/2)*(diff(w(x), x))^2+(1/8)*w(x)^4-(1/2)*c*w(x)^2-g = 0

(1)

dsolve((1/2)*(diff(w(x), x))^2+(1/8)*w(x)^4-(1/2)*c*w(x)^2-g = 0, {w(x)})

w(x) = (2*c+2*(c^2+2*g)^(1/2))^(1/2), w(x) = (-2*(c^2+2*g)^(1/2)+2*c)^(1/2), w(x) = -(2*c+2*(c^2+2*g)^(1/2))^(1/2), w(x) = -(-2*(c^2+2*g)^(1/2)+2*c)^(1/2), w(x) = 2*JacobiSN((1/2)*(-2*c+2*(c^2+2*g)^(1/2))^(1/2)*x+_C1, ((c*(c^2+2*g)^(1/2)-c^2-g)*g)^(1/2)/(c*(c^2+2*g)^(1/2)-c^2-g))*g/(g*(-c+(c^2+2*g)^(1/2)))^(1/2)

(2)

``

``

Download solve.mw

Is it possible to integrate eq (1) in such a way that the final result will be of 1st order differential equation? 

 


 

restart

with(PDEtools)

eq := (diff(U(z), z))^3*(diff(U(z), z, z))+(diff(U(z), z))*(diff(U(z), z, z, z, z))-(diff(U(z), z, z))*(diff(U(z), z, z, z)) = 0

(diff(U(z), z))^3*(diff(diff(U(z), z), z))+(diff(U(z), z))*(diff(diff(diff(diff(U(z), z), z), z), z))-(diff(diff(U(z), z), z))*(diff(diff(diff(U(z), z), z), z)) = 0

(1)

eq1 := map(convert, eq, diff); eq2 := map(int, lhs(eq1), z)-C1 = 0

(diff(U(z), z))^3*(diff(diff(U(z), z), z))+(diff(U(z), z))*(diff(diff(diff(diff(U(z), z), z), z), z))-(diff(diff(U(z), z), z))*(diff(diff(diff(U(z), z), z), z)) = 0

 

(1/4)*(diff(U(z), z))^4-(diff(diff(U(z), z), z))^2+(diff(diff(diff(U(z), z), z), z))*(diff(U(z), z))-C1 = 0

(2)

``


 

Download inttegration.mw

The wikipedia website below contains a general description of Doyle spirals but not the full mathematics of their construction.  

https://en.wikipedia.org/wiki/Doyle_spiral

The website below apparently contains the html coding for an animated display of Doyle spirals, but I am not familiar with this coding language.

https://bl.ocks.org/robinhouston/6096950

Can anyone direct me to 1) the complete mathematics describing the construction of a Doyle spiral and/or

                                        2) a Maple worksheet which codes for the display of a Doyle spiral?

1 2 3 4 5 6 7 Last Page 1 of 52