Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi,

I have two same dimentional matrix(1000*1000), one is full of variables and the other is full of numbers. What is the simplest way to assign the values of second matrix to first one variables?

for example:

A := Matrix([[x, y], [z, t]]);

B := Matrix([[1, 2], [3, 4]]);

How assign B's values to A's variables, in such a way that after assigning ,when call x, the 1 appears in output.

 


 

``

restart

Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received shareman

 

A := Matrix([[x, y], [z, t]])

A := Matrix(2, 2, {(1, 1) = x, (1, 2) = y, (2, 1) = z, (2, 2) = t})

(1)

B := Matrix([[1, 2], [3, 4]])

B := Matrix(2, 2, {(1, 1) = 1, (1, 2) = 2, (2, 1) = 3, (2, 2) = 4})

(2)

NULL

x

x

(3)

``

 

 

 

``


 

Download assgnSoal.mw

Is it possible get a solution of this equation without RoofOf in form explicit?

I am solving a matrix eigenvalue problem, and have found a way to make the matrices very sparse by a set of conditions x=x', y=y' and z=z'. If these are satisfied then the matrix element will be >0. If any one of them is not satisfied, then the matrix element becomes zero; hence a sparse matrix is formed. Mathematically in Maple this can be represented as such:

ME*KroneckerDelta[x,xp]*KroneckerDelta[y,yp]*KroneckerDelta[z,zp];

Where ME represents the matrix element and xp, yp, zp represent the prime notation . I apply this form within a C++ routine which I am extracting the matrices from into Maple where I am looking to modify them to experiment with an extension of the program.

The matrices I read into Maple have had the Kronecker delta functions applied, however Is there a simple way to reverse the effect of the Kronecker delta functions with the Matrix in Maple and return the Matrix equivalent to just ME without the product of kronecker delta functions?

-Yeti

In the same directory I have two Maple files. SignExpAlg.mw and RootBox.mw

In SignExpAlg.mw I have written several procedures which I am wanting to use in RootBox.mw

I have tried to do

    read "SignExpAlg.m"

at the top of RootBox but when I click !!! I get the error message: "Error, could not open 'SignExpAlg.m' for reading"

What am I doing wrong?

I don' t understand what do these notations stand for? I know that there are some notations like these in Maple. How can I find meanings of the all of them?

 

I am finding that the  PDF command with Student's t-distribution in the Statistics package is not behaving as expected. Here is what I tried so far:

>restart;
>with(Statistics):
>X := RandomVariable(StudentT(nu));
    
>PDF(X,0.5);
                         Dirac(X - 0.5)

Note that PDF(X,0.5) is evaluating to Dirac(X-0.5) instead of the pdf of Student's t-distribution density function. 

Any help in identifying the issue is greatly appreciated. I am running Maple2015 on linuxmint 17.

Thanks!

 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 am trying to find a way to adjust the size of a plot output component in Maple by right click (because the output(s) were copy & paste) and it is difficult to go back to plot command to set the size.

Thanks,

Hello, thanks for read me

I don't know why my code don't work, I'm trying to calculate the magnitude of a complex vector but I get a error in the next image you can view it, 

 

Can someone help me? thank you

My program have more than 100 subsections. It is tedious to close them after run.

How is it possible the maple do not open those subsections I specified, during running the program?

Is it possible to close subsections abruptly?

Greetings People!

I am modelling a dynamical system using variational formulation. The final step is to plug in, the energy values, in the Euler-Lagrange Equation. The functional has both explicit dependence on time, and implicit dependence (in the form of the generalised coordinate). Since motive of the exercise is to obtain the governing equations for the generalized coordinates, this implicit dependence is unknown. How can Maple be used to derive the differential equations in this situation?

 

As an example, consider,

Here, ld and l are variables, which are function of time. In order to calculate the term,

How do I proceed? Thanks in advance.

I have a piecewise defined linear function, at one point it has a set value. How can i plot it in maple??

How is it possible to stop Maple from running, in specific line of program when using execute the entire worksheet???

Is it possible to capture and convert the output of dismantle to one (long) string?

For example, if I do

r:=dismantle(x+sin(x));

SUM(5)
   NAME(4): x
   INTPOS(2): 1
   FUNCTION(3)
      NAME(4): sin #[protected, _syslib]
      EXPSEQ(2)
         NAME(4): x
   INTPOS(2): 1

I'd like to first capture the output in "r", which now it does not, it just goes to screen and "r" is left empty, and then convert the result to long string. (using convert()) So the result of the above will becomes

r:="SUM(5) NAME(4): x INTPOS(2): 1 FUNCTION(3) NAME(4): sin #[protected, _syslib]..."

The reason I need to capture the output, is so I can more easily look for some specific name/content inside the expression. which is now in a string, using string tools later on, which I think will be easier. For example, if I want to look for "sin" I can now search the above string and see if "sin" is there. Context is not important, just need to see if a name happens to be in the string.  The problem I do not know how to convert output of dismantle to string.

Maple 2016.2 on windows

 

TQ.mw

Can any one help for finding the solution of these differntial equations and then plotting the graph for differnt values of M

(FILE ATTACHED)
 

eqn1 := (R/(R-theta(eta))+Omega)*(diff(f(eta), `$`(eta, 3)))+f(eta)*(diff(f(eta), `$`(eta, 2)))+R*(diff(f(eta), `$`(eta, 2)))*(diff(theta(eta), eta))/(R-theta(eta))^2+Omega*(diff(g(eta), eta))+lambda*theta(eta)*Cos(alpha)-M*(diff(f(eta), eta))^2 = 0; eqn2 := (R/(R-theta(eta))+(1/2)*Omega)*(diff(g(eta), `$`(eta, 2)))-2*Omega*(2*g(eta)+diff(f(eta), `$`(eta, 2)))+(diff(f(eta), eta))*g(eta)+(diff(g(eta), eta))*f(eta)+R*(diff(g(eta), eta))*(diff(theta(eta), eta))/(R-theta(eta))^2 = 0; eqn3 := (1+`ε`*theta(eta))*(diff(theta(eta), `$`(eta, 2)))+`ε`*(diff(theta(eta), eta))^2+Pr*(f(eta)*(diff(theta(eta), eta))-(diff(f(eta), eta))*theta(eta))+Q*theta(eta)+L*exp(-eta) = 0

(R/(R-theta(eta))+Omega)*(diff(diff(diff(f(eta), eta), eta), eta))+f(eta)*(diff(diff(f(eta), eta), eta))+R*(diff(diff(f(eta), eta), eta))*(diff(theta(eta), eta))/(R-theta(eta))^2+Omega*(diff(g(eta), eta))+lambda*theta(eta)*Cos(alpha)-M*(diff(f(eta), eta))^2 = 0

 

(R/(R-theta(eta))+(1/2)*Omega)*(diff(diff(g(eta), eta), eta))-2*Omega*(2*g(eta)+diff(diff(f(eta), eta), eta))+(diff(f(eta), eta))*g(eta)+(diff(g(eta), eta))*f(eta)+R*(diff(g(eta), eta))*(diff(theta(eta), eta))/(R-theta(eta))^2 = 0

 

(1+epsilon*theta(eta))*(diff(diff(theta(eta), eta), eta))+epsilon*(diff(theta(eta), eta))^2+Pr*(f(eta)*(diff(theta(eta), eta))-(diff(f(eta), eta))*theta(eta))+Q*theta(eta)+L*exp(-eta) = 0

(1)

Omega := 2.; M := .5; R := 5; lambda := 20; `ε` := .2; Pr := 1; Q := .5; L := .5; W := .5; n := .1; alpha := (1/6)*Pi

bc := f(0) = W, (D(f))(0) = 0, (D(f))(infinity) = 0, (D(theta))(0) = -1, theta(infinity) = 0, g(0) = -n*(DD(f))(0), g(infinity) = 0

f(0) = W, (D(f))(0) = 0, (D(f))(N) = 0, (D(theta))(0) = -1, theta(N) = 0, g(0) = -n*(DD(f))(0), g(N) = 0

(2)

``


 

Download TQ.mw

 

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