Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

hello, i have problem here.

> restart;
> with(linalg);
> NULL;
> fungsi1 := sum(d1[h]+b1[h], h = 1 .. 7);
> fungsi2 := sum(sum(d2[h, t]+b2[h, t], t = 1 .. 23), h = 1 .. 7);
> fungsi3 := sum(sum(d3[h, t]+b3[h, t], t = 1 .. 23), h = 1 .. 7);
> fungsi4 := sum(d4[k]+b4[k], k = 1 .. 3);
> fungsi := fungsi1+fungsi2+fungsi3+fungsi4;
> NULL;
> NULL;
> k1 := seq(sum(X[h, t], t = 1 .. 23) >= 9, h = 1 .. 6);
> k2 := seq(sum(Y[h, t], t = 1 .. 23) >= 2, h = 1 .. 6);
> k3 := seq(sum(Z[h, t], t = 1 .. 23) >= 2, h = 1 .. 6);
> NULL;
> k4 := seq(seq(X[h, t]+Y[h, t]+Z[h, t] <= 1, h = 1 .. 6), t = 1 .. 23);
> NULL;
> k5 := seq(seq(Z[h, t]+Z[h+1, t] <= 1, h = 1 .. 6), t = 1 .. 23);
> NULL;
> k6 := seq(sum(X[h, t]+Y[h, t]+Z[h, t], t = 1 .. 23) >= 5, h = 1 .. 7);
> k7 := seq(sum(X[h, t]+Y[h, t]+Z[h, t], t = 1 .. 23) <= 6, h = 1 .. 7);
> NULL;
> k8 := seq(sum(X[h, t], t = 1 .. 23)+b1[h]-d1[h] <= 15, h = 1 .. 6);
> k9 := seq(sum(Y[h, t], t = 1 .. 23)+b1[h]-d1[h] <= 4, h = 1 .. 6);
> k10 := seq(sum(Z[h, t], t = 1 .. 23)+b1[h]-d1[h] <= 4, h = 1 .. 6);
> NULL;
> k11 := seq(seq(Y[h, t]+Y[h+1, t]+b2[h, t]-d2[h, t] <= 1, t = 1 .. 23), h = 1 .. 6);
> NULL;
> k12 := seq(seq(Z[h, t]+Z[h+1, t]+b3[h, t]-d3[h, t] <= 1, t = 1 .. 23), h = 1 .. 6);
> NULL;
> k13 := sum(X[7, t], t = 1 .. 23)+b4[1]-d4[1] = 2;
> k14 := sum(Y[7, t], t = 1 .. 23)+b4[1]-d4[1] = 2;
> k15 := sum(Z[7, t], t = 1 .. 23)+b4[1]-d4[1] = 2;
> with(Optimization);
[ImportMPS, Interactive, LPSolve, LSSolve, Maximize, Minimize, 

  NLPSolve, QPSolve]
> CodeTools:-Usage(LPSolve(fungsi, {k1, k10, k11, k12, k13, k14, k15, k2, k3, k4, k5, k6, k7, k8, k9}, assume = {integer, nonnegative}));
Error, (in Optimization:-LPSolve) no feasible point found for LP subproblem

why it can be? please i need help. 

I was looking to see if anyone has come across a Maple routine for a savings algorithm - specifically, Clarke and Wright. In fact, any classical savings heuristic would also be interesting.

Any guidance would be truly appreciated.

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

 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 two figures that's generated in Maple (by plot), then pasted them to a worksheet, which I would like to export them to PDF format with exactly the same as it seems on Maple, meaning that these two figures need to be on the same row.

However, in the exported PDF, these two figures are always in two rows: see Fig_1.mw and Fig_1.pdf 

What I tried was: to really resize these two figures into very small size, and the export works, however, I also need three figures or four figures in one row. See Fig_2.mw and Fig_2.pdf

So there is actually two questions:

1. Can I specify some parameters in Maple such that the exported PDF is exactly 'what I see is what I get'?

2. If #1 is impossible, where can I get the information on: width of the exported PDF, how to specify the precise size of plot command etc

Thanks,

How to express a chemistry equation in prefix expression

Hi everyone!

I would really appreciate if someone could give me a hand on telling me what is wrong with this problem! pdsolve gives the error: Error, (in pdsolve/sys/info) found functions with same name but depending on different arguments in the given DE system: {f(0, y), f(x, 0), f(x, y), (D[2](f))(0, y), (D[2](f))(x, 0)}.


Thanks in advance!!! 




 

 

Hello,

I want to check via Maple whether the term is always bigger than c/4 (it is), but using verify(TERM, c/4, greater_than) just returns FALSE. I did assume(a > 0, b > 0, -1 <= c and c <= 1); It would be nice if you could tell me what exactly is causing the problem and how to solve it.

Thanks in advance

(9*a^3*b^3*c^2+4*a^6*c+16*a^5*b*c+47*a^4*b^2*c+82*a^3*b^3*c+47*a^2*b^4*c+16*a*b^5*c+4*b^6*c+16*a^5*b+80*a^4*b^2+132*a^3*b^3+80*a^2*b^4+16*a*b^5)*(a+2*b)^2*(a+b)^2*(2*a+b)^2/((4*a^6+28*a^5*b+77*a^4*b^2+106*a^3*b^3+77*a^2*b^4+28*a*b^5+4*b^6)*sqrt(-9*a^2*b^2*c^2+32*a^3*b*c+62*a^2*b^2*c+32*a*b^3*c+16*a^4+80*a^3*b+132*a^2*b^2+80*a*b^3+16*b^4)*sqrt(-9*a^4*b^4*c^2+24*a^6*b^2*c+28*a^5*b^3*c-14*a^4*b^4*c+28*a^3*b^5*c+24*a^2*b^6*c+16*a^8+112*a^7*b+276*a^6*b^2+296*a^5*b^3+220*a^4*b^4+296*a^3*b^5+276*a^2*b^6+112*a*b^7+16*b^8))

 

Here, I have a 3D map T=(T1,T2,T3) with

T1(x1,x2,x3)=x1*exp(6-2*x1-x2-0.3*x3),

T2(x1,x2,x3)=x2*exp(5-2*x1-2*x2-*x3),

T3(x1,x2,x3)=x3*exp(8-0.2*x1-x2-x3),

How can I use  IterativeMaps:-Attractor obtain the attractor for T.

I am not unfamiliar with the Wolfram syntax but also not very good with it, and there is a particular element in a Mathematica code I have been given which I do not entirely understand how to efficiently write in Maple. The basic idea is to read in a list of expressions from an external file (LIST) and process the non zero elements and assign them to a function (COEF) which can be called later on. Here is the Mathematica exert:

k = 0;
i = 0;
a = b = \[Theta];
Do[k = k + 1; KK = LIST[[k]]; 
  If[KK =!= 0, i = i + 1; ff = Factor[KK]; 
   COEF[x,y, z, l_, m_, n_] = ff], {z, -2, 
   2}, {y, -2, 2}, {x, -2, 2}];

The LIST has the following form and only contains l, m and n and another factor E which is left undefined for now. It does not contain x, y or z. The LIST can contain any number of terms depending on the problem. Here is an example:

LIST={0, 0, 0, 0, 0, 0, 0, a^2 b m (-1 + n) n (a^2 + b^2 - 2 E), ... ,0,0, a^3 n(l+1+m) ... }

So the Do loop cycles through the LIST and extracts out the non zero terms. What I am unsure about is how it is looping over x,y and z when they do not appear in the LIST at all. I assume it is attaching a x,y,z combination to each COEF and they can be called like this:

COEF[0,1,1,0,2,3]

For the instance of when x=0, y=1, z=1, l=0, m=2 n=3. Is this correct? What would be the best way to replicate this in Maple?

- Yeti

i want to solve the system of equation ( 1 )  , (2)  ,  (3)   under the assumation that x , y have the CDF in (4)  ,  (5)
 

diff(L(lambda[1], lambda[2], alpha), lambda[1]) = n/lambda[1]+sum(x[i], i = 1 .. n)-(sum(2*x[i]*exp(lambda[1])/(exp(x__i*`&lambda;__1`)-1+alpha), i = 1 .. n))

diff(L(lambda[1], lambda[2], alpha), lambda[1]) = n/lambda[1]+sum(x[i], i = 1 .. n)-(sum(2*x[i]*exp(lambda[1])/(exp(x__i*`&lambda;__1`)-1+alpha), i = 1 .. n))

(1)

diff(L(lambda[1], lambda[2], alpha), lambda[2]) = m/lambda[2]+sum(y[j], j = 1 .. m)-(sum(2*y[j]*exp(lambda[2])/(exp(y__j*`&lambda;__2`)-1+alpha), j = 1 .. m))

diff(L(lambda[1], lambda[2], alpha), lambda[2]) = m/lambda[2]+sum(y[j], j = 1 .. m)-(sum(2*y[j]*exp(lambda[2])/(exp(y__j*`&lambda;__2`)-1+alpha), j = 1 .. m))

(2)

diff(L(lambda[1], lambda[2], alpha), alpha) = (n+m)/alpha-(sum(2/(exp(x[i]*`&lambda;__1`)-1+alpha), i = 1 .. n))-(sum(2/(exp(y[j]*`&lambda;__2`)-1+alpha), j = 1 .. m))

diff(L(lambda[1], lambda[2], alpha), alpha) = (n+m)/alpha-(sum(2/(exp(x[i]*`&lambda;__1`)-1+alpha), i = 1 .. n))-(sum(2/(exp(y[j]*`&lambda;__2`)-1+alpha), j = 1 .. m))

(3)

G(x, lambda[1], alpha) = 1-alpha/(exp(lambda[1]*x)-1+alpha)

G(x, lambda[1], alpha) = 1-alpha/(exp(lambda[1]*x)-1+alpha)

(4)

G(y, lambda[2], alpha) = 1-alpha/(exp(lambda[2]*x)-1+alpha)

G(y, lambda[2], alpha) = 1-alpha/(exp(lambda[2]*x)-1+alpha)

(5)

``

``


 

Download internet.mw

How do we write code for optimal problem using Pontryagin's maximum principle for simulation.

I want to make the blue output my procedure spits out a another color, and align it to the right, is this even possible? Or something like it?

I basically want to make a Maple procedure that does certain calculations and writes the explanation for each calculation. I do however want Maple to write these explanations as a text field like in a normal Maple worksheet, instead of the blue output in the middle. Is this possible? Or is there any alternative ideas you have that I could try? Would really appreciate any kind of help, thanks.

I have included a transfer function of a 3 degree of freedom system.  There are special loci, aside from s = 0, where the numerator will equate to a REAL scalar value, and the denominator will reduce to a simple product of the individual z roots.  Does anyone know if there is some physical significance, interpretation, or analog to this condition and special loci?untitled.mw

 

First 122 123 124 125 126 127 128 Last Page 124 of 2097