Ronan

1311 Reputation

14 Badges

13 years, 11 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are questions asked by Ronan

I have been trying to find a solution for the equation below. Is there a non numerical explicit solution?
 

restart

with(DEtools)

[AreSimilar, Closure, DEnormal, DEplot, DEplot3d, DEplot_polygon, DFactor, DFactorLCLM, DFactorsols, Dchangevar, Desingularize, FunctionDecomposition, GCRD, Gosper, Heunsols, Homomorphisms, IVPsol, IsHyperexponential, LCLM, MeijerGsols, MultiplicativeDecomposition, ODEInvariants, PDEchangecoords, PolynomialNormalForm, RationalCanonicalForm, ReduceHyperexp, RiemannPsols, Xchange, Xcommutator, Xgauge, Zeilberger, abelsol, adjoint, autonomous, bernoullisol, buildsol, buildsym, canoni, caseplot, casesplit, checkrank, chinisol, clairautsol, constcoeffsols, convertAlg, convertsys, dalembertsol, dcoeffs, de2diffop, dfieldplot, diff_table, diffop2de, dperiodic_sols, dpolyform, dsubs, eigenring, endomorphism_charpoly, equinv, eta_k, eulersols, exactsol, expsols, exterior_power, firint, firtest, formal_sol, gen_exp, generate_ic, genhomosol, gensys, hamilton_eqs, hypergeomsols, hyperode, indicialeq, infgen, initialdata, integrate_sols, intfactor, invariants, kovacicsols, leftdivision, liesol, line_int, linearsol, matrixDE, matrix_riccati, maxdimsystems, moser_reduce, muchange, mult, mutest, newton_polygon, normalG2, ode_int_y, ode_y1, odeadvisor, odepde, parametricsol, particularsol, phaseportrait, poincare, polysols, power_equivalent, rational_equivalent, ratsols, redode, reduceOrder, reduce_order, regular_parts, regularsp, remove_RootOf, riccati_system, riccatisol, rifread, rifsimp, rightdivision, rtaylor, separablesol, singularities, solve_group, super_reduce, symgen, symmetric_power, symmetric_product, symtest, transinv, translate, untranslate, varparam, zoom]

(1)

``

sol := (JacobiCN((1/10)*sqrt(5)*sqrt(2)*t, (1/3)*sqrt(3))*sqrt(5)+2*sqrt(2))/(JacobiCN((1/10)*sqrt(5)*sqrt(2)*t, (1/3)*sqrt(3))*sqrt(5)+5*sqrt(2))

(JacobiCN((1/10)*5^(1/2)*2^(1/2)*t, (1/3)*3^(1/2))*5^(1/2)+2*2^(1/2))/(JacobiCN((1/10)*5^(1/2)*2^(1/2)*t, (1/3)*3^(1/2))*5^(1/2)+5*2^(1/2))

(2)

sol1 := diff(psi(t), t) = sol

diff(psi(t), t) = (JacobiCN((1/10)*5^(1/2)*2^(1/2)*t, (1/3)*3^(1/2))*5^(1/2)+2*2^(1/2))/(JacobiCN((1/10)*5^(1/2)*2^(1/2)*t, (1/3)*3^(1/2))*5^(1/2)+5*2^(1/2))

(3)

odeadvisor(sol1, psi(t))

[_quadrature]

(4)

sol2 := dsolve({sol1, psi(0) = 0})

psi(t) = Int((JacobiCN((1/10)*_z1*10^(1/2), (1/3)*3^(1/2))*5^(1/2)+2*2^(1/2))/(JacobiCN((1/10)*_z1*10^(1/2), (1/3)*3^(1/2))*5^(1/2)+5*2^(1/2)), _z1 = 0 .. t)

(5)

``

``

sol3 := convert(sol, parfrac)

1-(3/5)*2^(1/2)*5^(1/2)/(JacobiCN((1/10)*5^(1/2)*2^(1/2)*t, (1/3)*3^(1/2))+2^(1/2)*5^(1/2))

(6)

sol4 := diff(psi(t), t) = sol3

diff(psi(t), t) = 1-(3/5)*2^(1/2)*5^(1/2)/(JacobiCN((1/10)*5^(1/2)*2^(1/2)*t, (1/3)*3^(1/2))+2^(1/2)*5^(1/2))

(7)

dsolve({sol4, psi(0) = 0})

psi(t) = Int(-(3/5)*10^(1/2)/(JacobiCN((1/10)*_z1*10^(1/2), (1/3)*3^(1/2))+10^(1/2)), _z1 = 0 .. t)+t

(8)

sol5 := diff(psi(t), t) = 3*sqrt(2)*sqrt(5)/(5*(JacobiCN((1/10)*sqrt(5)*sqrt(2)*t, (1/3)*sqrt(3))+sqrt(5)*sqrt(2)))

diff(psi(t), t) = 3*2^(1/2)*5^(1/2)/(5*2^(1/2)*5^(1/2)+5*JacobiCN((1/10)*5^(1/2)*2^(1/2)*t, (1/3)*3^(1/2)))

(9)

odeadvisor(sol5)

[_quadrature]

(10)

dsolve({sol5})

{psi(t) = Int((3/5)*10^(1/2)/(JacobiCN((1/10)*t*10^(1/2), (1/3)*3^(1/2))+10^(1/2)), t)+_C1}

(11)

``


 

Download Jacobi_Diff_eqn_Mapleprime_post.mw

 Question:- can the procedure given below called "epi" be speeded up by compiling/ using evhf.If so how? My paple code is at the bottom.

First some background information.

Recently I ran into a difference in usage of a couple of elliptical functions between Maple and Mathematica.  This first case concerned EllipticalPi. The author of the blog kindly wrote  a Maple procedure to produce the same results as Mathematica’s  usage of ElllipticalPi.

I tested the basic integral that produces the EllipticPi    Ell := int(1/(1-nu*JacobiSN(t, k)^2), t)  answer      Ell := EllipticPi(JacobiSN(t, k), nu, k). They do not produce the same outcome. Plots are in the document .  They agree in one quarter only.

 I then ran into a difference in usage of  EllipticF. This time I was able to get to same outcome myself using Maple’s help.

“It is worth noting the difference between the Legendre normal form of the Incomplete Elliptic integral of the first kind (see A&S 17.2.7), in Maple represented by EllipticF(z,k) but for the splitting of the square root in the denominator of the integrand (see definition lines above), and the normal trigonometric form of this elliptic integral (see A&S 17.2.6), in Maple represented by the InverseJacobiAM function
InverseJacobiAM(phi,k);

That worked fine.

There is no mention in the help for usage implementation of EllipticPi as opposed to different usages as there is with EllipticF. I do not know if there is a way in Maple of achieving the same enactment as Mathematica in this case, without the Procedure I  was  given.

 

 

Elliptic Pi in Mathematica and Maple

Posted on 2017/02/202017/02/23 by arkajad

We use EllipticPi when we write exact solutions of rotation of a free asymmetric top. While solving Euler’s equations for angular velocity or angular momentum in the body frame we need Jacobi elliptic functions \cn,\sn,\dn,solving the differential equation for the attitude matrix involves EllipticPi function. As I have explained it in Taming the T-handle continued we need the integral

(1)   \begin{equation*}\psi(t)=c_1 t+c_2\int_0^t \frac{1}{1+c_3\,\sn^2(Bs,m)}\,ds.\end{equation*}

In Mathematica this is easily implemented as

(2)   \begin{equation*}\psi(t)=c_1 t+\frac{c_2}{B}\,\Pi(-c_3;\am(Bt,m)|m).\end{equation*}

However, as pointed out by Rowan in a comment to Taming the T-handle continued , the same formula does not work with Maple.

While the documentations of both Mathematica and Maple contain links to Abramowitz and Stegun Handbook of Mathematical Functions, they use different definitions. Here is what concerns us, from p. 590 of the 10th printing:

http://arkadiusz-jadczyk.eu/blog/wp-content/uploads/2017/02/epiam.jpg

What we need is 17.2.16, while Maple is using 17.2.14. To convert we need to set x=\sn u,but such a conversion is possible only in the domain where \sncan be inverted. We can do it easily for sufficiently small values of u,but not necessarily for values that contain several quarter-periods.

The following Maple procedure does the job:


epi := proc (t::float, nu::float, k::float) local t2, n, dt, ep0, res; ep0 := EllipticPi(nu, k); t2 := EllipticK(k); n := floor(t/t2); dt := t-t2*n; if type(n, even) then res := Re(n*ep0+EllipticPi(JacobiSN(dt, k), nu, k)) else res := Re((1+n)*ep0-EllipticPi(JacobiSN(t2-dt, k), nu, k)) end if end proc

HAs an example here is the Maple plot for nu=-3, k=0.9:
plot(('epi')(t, -3.0, .9), t = -20 .. 20)
http://arkadiusz-jadczyk.eu/blog/wp-content/uploads/2017/02/epimap.jpg

And here is the corresponding Mathematica plot:
http://arkadiusz-jadczyk.eu/blog/wp-content/uploads/2017/02/epimat.jpg

The function epi(t,nu, k) defined above for Maple gives now the same result as EllipticPi(nu,JacobiAM(t,k^2),k^2) in Mathematica.

restart;
epi := proc (t, nu, k) local t2, n, dt, ep0, res; ep0 := EllipticPi(nu, k); t2 := EllipticK(k); n := floor(t/t2); dt := t-t2*n; if type(n, even) then res := Re(n*ep0+EllipticPi(JacobiSN(dt, k), nu, k)) else res := Re((1+n)*ep0-EllipticPi(JacobiSN(t2-dt, k), nu, k)) end if end proc;


Ell := int(1/(1-nu*JacobiSN(t, k)^2), t);
            Ell := EllipticPi(JacobiSN(t, k), nu, k)
k := .9;
                            k := 0.9
nu := -3;
                            nu := -3
plot([epi(t, nu, k), Ell], t = -8 .. 20);

 

I have noticed this a couple of times now. If I  do a Saveas on a workbook document A to a new name B. Close maple. Reopen and load the new workbook document B it retains the old file name in the header bar and at the top of the workbook document list. The new filename is shown across the dark part at the top along with the old file name. The only fix I found the last time was to export the workbook as  B.mw, then saveas to B.maple and reattach documents. Painful.

 

 

I can't get the Real and Imaginary parts of matrix to seperate out as required. It is an SU(2) matrix. Want to convert is to a 4 Vector (quaternion). I think because Maple doesnt know what psi(t) is being conservative so to speak. Tried assume, assuming...
 

restart

assume*{psi(t), 'real'}

assume*{real, psi(t)}

(1)

V := Matrix(2, 2, {(1, 1) = (1/4)*cos((1/2)*psi(t))*sqrt(2)*sqrt(4-2*sech((1/6)*sqrt(3)*t))-I*cos((1/2)*psi(t))*sqrt(2)*tanh((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t))-((1/2)*I)*sin((1/2)*psi(t))*sqrt(2)*sqrt(3)*sech((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t)), (1, 2) = (1/2)*cos((1/2)*psi(t))*sqrt(2)*sqrt(3)*sech((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t))+((1/4)*I)*sin((1/2)*psi(t))*sqrt(2)*sqrt(4-2*sech((1/6)*sqrt(3)*t))-sin((1/2)*psi(t))*sqrt(2)*tanh((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t)), (2, 1) = ((1/4)*I)*sin((1/2)*psi(t))*sqrt(2)*sqrt(4-2*sech((1/6)*sqrt(3)*t))+sin((1/2)*psi(t))*sqrt(2)*tanh((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t))-(1/2)*cos((1/2)*psi(t))*sqrt(2)*sqrt(3)*sech((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t)), (2, 2) = ((1/2)*I)*sin((1/2)*psi(t))*sqrt(2)*sqrt(3)*sech((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t))+(1/4)*cos((1/2)*psi(t))*sqrt(2)*sqrt(4-2*sech((1/6)*sqrt(3)*t))+I*cos((1/2)*psi(t))*sqrt(2)*tanh((1/6)*sqrt(3)*t)/sqrt(4-2*sech((1/6)*sqrt(3)*t))})

Matrix(%id = 18446744074495800014)

(2)

``

``

v := Vector(4, [Re(V[1, 1]), Im(V[1, 2]), Re(V[2, 1]), Im(V[1, 1])])

Vector[column](%id = 18446744074531387982)

(3)

``


 

Download extract_R_and_I.mw

I have $ signs suddenly apearing down the side of my document. They are randomly formatting numbers. Don't know how I turned it on. How to undo?  Do they affect calculation accuracy or are they purely dislap formatting

 

 

 

First 25 26 27 28 29 30 31 Last Page 27 of 35