MaplePrimes Questions

How can I plot a paraboloid?

 

How can I accelerate the convergence rate of the following series:

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

Since GramSchmidt does not take Matrix as an input (I wish it did), I would like to know how to normalize a matrix rows. For example if input matrix is:

M = [  1    2]
       [  3    4]

How do I convert it into

Mn = [ 1/sqrt(5)    2/sqrt(5) ]
         [ 3/5            4/5          ]

Each row of matrix Mn has length of 1.

Thank you.

 

How to get homogenous expressions from symmetric polynomial.

Example. Let P = (a^2 + 2)(b^2 + 2)(c^2 + 2), we have deg(P) = 6. I want to get polynomials of degree n on A[n] with n = 0, 1, ..., 6. Specific

P = a^2b^2c^2 + 2(a^2b^2 + b^2c^2 + c^2a^2) + 4(a^2 + b^2 + c^2) + 8.

And

A[0] = 8

A[1] = 0

A[2] = 4(a^2 + b^2 + c^2)

A[3] = 0

A[4] = 2(a^2b^2 + b^2c^2 + c^2a^2)

A[5] = 0

A[6] = a^2b^2c^2

Thank you very much.

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

Hi,

This question concerns the package GraphTheory
( Maple 2015 on a Windows 7 PC )

Let G1 be some graph and V a list of vertices in G1
The default colors DrawGraph uses for the vertices is yellow

I define the graph G2 this way :
    G2 := copy(G1):
    HighlightVertex(G2, V, red);
    DrawGraph(G2);
Obviously the result is a graph where vertices in V are red while the remaining ones are still yellow

Question 1 :  Why does the command DrawGraph(G1) returns exactly the same picture ?
I have thought that defining G2 as a copy of G1 would have preserved the default colouring of the vertices.
Note that the same undesired (at least for me) thing occurs with the  HighlightEdges command.

Question 2 : Is it possible to retrieve the original colouring of G1 without using HighlightVertex(G1, V, yellow)  ?

Thank you in advance

Dragilev:=proc(Polynomials::depends(list(ratpoly(integer,Variables))),Variables::list(symbol),DEvar::symbol,DEsuffix::string)

The above procedure parameter Polynomials accepts a list of polynomials containing indeterminates contained in parameter Variables, but also accepts simple arithmetic expressions such as 34.

Is there any parameter qualifying coding which will only accept polynomials containing one or more of the indeterminates passed in parameter Variables?

Is it possible to have an information box pop out when cursor is hovered over a plotted point?

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*`λ__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*`λ__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*`λ__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*`λ__2`)-1+alpha), j = 1 .. m))

(2)

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

diff(L(lambda[1], lambda[2], alpha), alpha) = (n+m)/alpha-(sum(2/(exp(x[i]*`λ__1`)-1+alpha), i = 1 .. n))-(sum(2/(exp(y[j]*`λ__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.

Hi!

I a have a question about factorizing real polynomials.

Suppose I have a real polynomial p(x) with integer coefficients. If the degree of p(x) is less than or equal to 4, we can factorize it into linear radical factors. On the other hand, if we require the factorization to be real, theoretically we can factorize it into linear and irreducible quadratic factors.

My question is, if the input p(x) is real polynomial with integer coefficients, is there any Maple function that can give me factorization output with real linear and irreducible quadratic factors, with radical coeffs?

For example, I tried q := 20*x^3+10*x^2+4*x+1, it has one real root and 2 complex roots. I want a factorization like q(x) = 20*(x-r1)*(a*x^2 + b*x + c), with r1, a, b, c, all real radicals.

I compared functions: factors(), solve(), sqrfree(), Splits(), and none of them give what I want.

factors(q) gives: 
[20, [[x^3+(1/2)*x^2+(1/5)*x+1/20, 1]]]

 

factors(q, real)  gives: 
[20., [[x+.3423840948583691316993036540027816871936619136844427977504078911, 1], [x^2+.1576159051416308683006963459972183128063380863155572022495921089*x+.1460348209828001458360112632660894203743660942160039146818509889, 1]]]

solve(q)   gives:
-(1/30)*(350+105*sqrt(15))^(1/3)+7/(6*(350+105*sqrt(15))^(1/3))-1/6, (1/60)*(350+105*sqrt(15))^(1/3)-7/(12*(350+105*sqrt(15))^(1/3))-1/6+(1/2*I)*sqrt(3)*(-(1/30)*(350+105*sqrt(15))^(1/3)-7/(6*(350+105*sqrt(15))^(1/3))), (1/60)*(350+105*sqrt(15))^(1/3)-7/(12*(350+105*sqrt(15))^(1/3))-1/6-(1/2*I)*sqrt(3)*(-(1/30)*(350+105*sqrt(15))^(1/3)-7/(6*(350+105*sqrt(15))^(1/3)))

simplify(convert(Splits(q,x),radical))    gives:
[20, [[(1/30)*(350+105*sqrt(5)*sqrt(3))^(1/3)+1/6-7/(6*(350+105*sqrt(5)*sqrt(3))^(1/3))+x, 1], [-(1/60)*(I*sqrt(3)*(350+105*sqrt(5)*sqrt(3))^(2/3)+(35*I)*sqrt(3)+(350+105*sqrt(5)*sqrt(3))^(2/3)-60*x*(350+105*sqrt(5)*sqrt(3))^(1/3)-10*(350+105*sqrt(5)*sqrt(3))^(1/3)-35)/(350+105*sqrt(5)*sqrt(3))^(1/3), 1], [(1/60*I)*sqrt(3)*(350+105*sqrt(5)*sqrt(3))^(1/3)+(7/12*I)*sqrt(3)/(350+105*sqrt(5)*sqrt(3))^(1/3)-(1/60)*(350+105*sqrt(5)*sqrt(3))^(1/3)+1/6+7/(12*(350+105*sqrt(5)*sqrt(3))^(1/3))+x, 1]]]

None of them give me what I want. Is there any build-in function that can help me do that?

Thanks!

William

 

I haven't soved yet why dchange is not working for this simple command. Any help out there?

Thanks a lot

how will i go about solving this problem, i want to return somthing like this (this anwser is from another function that did not contain sin, and therefor did not gave me problems).

thx in advance
 

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