MaplePrimes Questions

I have a solution to a physics free-fall problem:

times := -2.019619977*Unit('s'), 2.019619977*Unit('s')

I would like to extract the positive values.

After some tinkering, I came up with this solution:

sol:=[][]:
for i in times do:
    val := Split(i, output = coefficient):
    if 0 <= val then:
        sol := sol, val*Unit('s'):
    end if:
end do:
evalf(sol,3)

2.02 s

This works, but is inelegant and requires many expressions.

Is there a simpler way, possibly a single-line expression, to accomplish this?

 

 


 

 

 

I am quite puzzled by the fact that Maple occasionally returns incorrect results when calculating the real and imaginary parts. I have attached an example script below. As shown, the returned value is erroneous unless the condition that k is real is explicitly specified.

Do you have any thoughts on this?

question.mw

Download question.mw

In Peter Winkler's book "Mathematical Mind-Benders" the now famous problem of dividing an ice cream cake is posed. It asks: If, when cutting the circular cake with any central angle (whether rational or irrational), neighboring piece after neighboring piece is constantly cut off, the cake segment is rotated to the previous top side, and the cut surface is considered to be healed, then after a finite number of cuts the top side is back where it was at the beginning. I also fell for it at first and assumed that according to Weyl's theorem (uniform distribution modulo 1) this is not possible and therefore the central angle must be rational. I have since found a solution according to which the cutting process must stop after a finite number of steps. Weyl's theorem is obviously not applicable here. Why - I am still puzzling over that.

Now I am interested in whether Maple can be used to animate the uniform distribution modulo 1 on the unit circle and to display the associated statistics in the sense of a sample and calculate the sample value of the uniform distribution. As a Maple beginner, I am not yet able to do this and am asking for help.

How do add two or more variables to the save command ?

e.g.  the following works for one variable

number:=1;
A:=5;
fname:=sprintf("file(%a)",number);
save A, fname;

but how do you e.g. add another variable to the fname ?

Lets say I want  to add the contents of another variable say Var2
 

number:=1;
A:=5;
Var2:="b";
fname:=sprintf("file(%a)_Var2",number);

save A, fname

How do I do that ?

Could we create a plot with tau0 varying from 0.1 to 0.6 on the x-axis and profit on the y-axis displaying Rprof, Mprof, Tprof, T_Cprof all on the same graph?

Sheet attached : trial_question.mw

there is must be a problem but i didn't figure out ?  in this command didn't give me my parameter why?
vars1 := indets(eqs1);
ans := solve(eqs1, {a[0], a[1], a[2], a[3], a[4], e[1], k[1], n[1], p[1]});

parameter.mw

On joint un point M  d'une ellipse aux foyers F1 et F2.  Les droites MF1 et MF2 recoupent l'ellipse aux points H1 et H2 ,  trouver l'enveloppe de la droite H1H2,  quand le point M se `déplace` sur l'ellipse.;


restart;
Fig := proc(t) local a, b, c, courbe, sol, sol1, dr, tx; _EnvHorizontalName := 'x'; _EnvVerticalName := 'y'; a := 11; b := 7; c := sqrt(a^2 - b^2); geometry:-ellipse(e1, x^2/a^2 + y^2/b^2 = 1); geometry:-point(Oo, 0, 0); geometry:-point(M, a*cos(t), b*sin(t)); geometry:-point(F1, -c, 0); geometry:-point(F2, c, 0); geometry:-line(MF1, [M, F1]); geometry:-line(MF2, [M, F2]); sol := solve({geometry:-Equation(MF1), x^2/a^2 + y^2/b^2 = 1}, {x, y}, explicit); print(%); geometry:-point(H1, subs(sol[2], x), subs(sol[2], y)); geometry:-line(MH1, [M, H1]); sol := solve({geometry:-Equation(MF2), x^2/a^2 + y^2/b^2 = 1}, {x, y}, explicit); print(%); geometry:-point(H2, subs(sol[2], x), subs(sol[2], y)); geometry:-line(MH2, [M, H2]); courbe := plots:-implicitplot(x^2/a^2 + (a^2 + c^2)^2*y^2/b^2 - 1 = 0, x = -a .. a, y = -b .. b, color = cyan); tx := plots:-textplot([[geometry:-coordinates(M)[], "M"], [geometry:-coordinates(Oo)[], "O"], [geometry:-coordinates(H1)[], "H1"], [geometry:-coordinates(H2)[], "H2"], [geometry:-coordinates(F1)[], "F1"], [geometry:-coordinates(F2)[], "F2"]], font = [times, bold, 16], align = [above, left]); dr := geometry:-draw([e1(color = blue), MH1(color = magenta), MH2(color = magenta), M(color = red, symbol = solidcircle, symbolsize = 12), H1(color = red, symbol = solidcircle, symbolsize = 12), H2(color = red, symbol = solidcircle, symbolsize = 12), F1(color = red, symbol = solidcircle, symbolsize = 12), F2(color = red, symbol = solidcircle, symbolsize = 12), Oo(color = red, symbol = solidcircle, symbolsize = 12)]); plots:-display([dr, tx, courbe], scaling = constrained, axes = normal, title = "Ellipse et normales ", titlefont = [HELVETICA, 14]); end proc;
Fig(Pi/3);
    /    11      7  (1/2)\    /      26411   210177  (1/2)  
   { x = --, y = - 3      }, { x = - ----- - ------ 2     , 
    \    2       2       /    \      57074   28537          

         11319  (1/2)  (1/2)   66199  (1/2)\ 
     y = ----- 3      2      - ----- 3      }
         28537                 57074       / 


     /    11      7  (1/2)\    /    210177  (1/2)   26411  
    { x = --, y = - 3      }, { x = ------ 2      - -----, 
     \    2       2       /    \    28537           57074  

            11319  (1/2)  (1/2)   66199  (1/2)\ 
      y = - ----- 3      2      - ----- 3      }
            28537                 57074       / 

Fig(Pi/6);
   /      104027  (1/2)   17787  (1/2)  (1/2)   123420  (1/2)
  { x = - ------ 3      + ----- 3      6      - ------ 2     
   \      22226           11113                 11113        

       19404  (1/2)  (1/2)        66199   11319  (1/2)\   
     + ----- 2      6     , y = - ----- + ----- 6      }, 
       11113                      22226   11113       /   

     /    11  (1/2)      7\ 
    { x = -- 3     , y = - }
     \    2              2/ 


Error, (in geometry:-line) the line is not defined
plots:-animate(Fig, [t], t = 0.1 .. 2*Pi, frames = 150);
            {x = -10.99908244, y = -0.09041172732}, 

              {x = 10.94504582, y = 0.6988339166}


Error, (in plots/animate) the line is not defined
;
NULL;
Thank you for your help.

I am trying to calculate a probability density function for the distance between two points inside a unit circle.  I have succeeded with doing this for a few differing applications, but I am stuck on this problem.  I use uniformly distributed polar coordinates to find x and y values for two independent points.  When I ask for the PDF of the distance, I get a FAIL.

I am assuming that such a calculation is possible, I've succeeded with similar problems, but here I am stuck.  I hope my problem is rooted in my lack of knowledge, as opposed to a limitation of Maple.

Here are my Maple statements:

with(Statistics);
th1 := RandomVariable(Uniform(0, 2*Pi));
th2 := RandomVariable(Uniform(0, 2*Pi));
r1 := RandomVariable(Uniform(0, 1));
r2 := RandomVariable(Uniform(0, 1));
x1 := r1*cos(th1);
y1 := r1*sin(th1);
x2 := r2*cos(th2);
y2 := r2*sin(th2);
Dist := sqrt((x1 - x2)^2 + (y1 - y2)^2);
f := simplify(PDF(Dist, t));

Does anyone have any idea as to what I am doing wrong?  Thank you.


 

restart

_local(gamma)

Warning, A new binding for the name `gamma` has been created. The global instance of this name is still accessible using the :- prefix, :-`gamma`.  See ?protect for details.

 

with(plots)

NULL

sol3 := sqrt(2)*sqrt(-tau*gamma)*tanh(x-tau*t^alpha/alpha)*exp(I*gamma*(x+((2*gamma^3*tau-4*gamma*tau+8*tau^2)/(2*gamma^2)-tau*gamma)*t^alpha/((gamma-2*tau)*alpha)))/gamma

NULL

lprint(indets(sol3, name))

{alpha, gamma, t, tau, x}

 

NULL

P :=   [ alpha=1, gamma=-2,  tau=3]

[alpha = 1, gamma = -2, tau = 3]

(1)

PP := convert(sol3, polar)

polar(2^(1/2)*abs(tau*gamma)^(1/2)*exp(-Im(gamma*(x+((1/2)*(2*gamma^3*tau-4*gamma*tau+8*tau^2)/gamma^2-tau*gamma)*t^alpha/((gamma-2*tau)*alpha))))*abs(tanh(x-tau*t^alpha/alpha)/gamma), argument((-tau*gamma)^(1/2)*tanh(x-tau*t^alpha/alpha)*exp(I*gamma*(x+((1/2)*(2*gamma^3*tau-4*gamma*tau+8*tau^2)/gamma^2-tau*gamma)*t^alpha/((gamma-2*tau)*alpha)))/gamma))

(2)

polarplot(sol3, x = -20 .. 20, t = 0 .. 10, axis[radial] = [color = "Blue"])

NULL

Download polar.mw

How do I get my actual solution which involves _Z? I have  tried answers that w ere given on questions related to _Z in a solution but mine is not working. I am completely new to Maple ,kindly help me.

eq1 := Lambda[h]+rho[2]*R[h]-(b[h]+kappa+beta[1])*S[h] = 0

Lambda[h]+rho[2]*R[h]-(b[h]+kappa+beta[1])*S[h] = 0

(1)

eq2 := T[h] = 0

T[h] = 0

(2)

eq3 := R[h]-kappa*S[h]/(rho[2]+b[h]) = 0

R[h]-kappa*S[h]/(rho[2]+b[h]) = 0

(3)

eq4 := Lambda[m]*L-(alpha+pi)*S[m] = 0

Lambda[m]*L-(alpha+pi)*S[m] = 0

(4)

eq5 := c(1-L/K)*S[m]-(d+Lambda[m])*L = 0

c(1-L/K)*S[m]-(d+Lambda[m])*L = 0

(5)

sol := solve({eq1, eq2, eq3, eq4, eq5}, [T[h], S[h], R[h], L, S[m]])

[[T[h] = 0, S[h] = Lambda[h]*(rho[2]+b[h])/(kappa*b[h]+b[h]^2+b[h]*beta[1]+b[h]*rho[2]+beta[1]*rho[2]), R[h] = kappa*Lambda[h]/(kappa*b[h]+b[h]^2+b[h]*beta[1]+b[h]*rho[2]+beta[1]*rho[2]), L = 0, S[m] = 0], [T[h] = 0, S[h] = Lambda[h]*(rho[2]+b[h])/(kappa*b[h]+b[h]^2+b[h]*beta[1]+b[h]*rho[2]+beta[1]*rho[2]), R[h] = kappa*Lambda[h]/(kappa*b[h]+b[h]^2+b[h]*beta[1]+b[h]*rho[2]+beta[1]*rho[2]), L = (alpha+pi)*RootOf(-c((K*Lambda[m]-_Z*alpha-_Z*pi)/(K*Lambda[m]))*Lambda[m]+d*alpha+Lambda[m]*alpha+d*pi+Lambda[m]*pi)/Lambda[m], S[m] = RootOf(-c((K*Lambda[m]-_Z*alpha-_Z*pi)/(K*Lambda[m]))*Lambda[m]+d*alpha+Lambda[m]*alpha+d*pi+Lambda[m]*pi)]]

(6)

DF := sol[1]

[T[h] = 0, S[h] = Lambda[h]*(rho[2]+b[h])/(kappa*b[h]+b[h]^2+b[h]*beta[1]+b[h]*rho[2]+beta[1]*rho[2]), R[h] = kappa*Lambda[h]/(kappa*b[h]+b[h]^2+b[h]*beta[1]+b[h]*rho[2]+beta[1]*rho[2]), L = 0, S[m] = 0]

(7)

DF2 := sol[2]

[T[h] = 0, S[h] = Lambda[h]*(rho[2]+b[h])/(kappa*b[h]+b[h]^2+b[h]*beta[1]+b[h]*rho[2]+beta[1]*rho[2]), R[h] = kappa*Lambda[h]/(kappa*b[h]+b[h]^2+b[h]*beta[1]+b[h]*rho[2]+beta[1]*rho[2]), L = (alpha+pi)*RootOf(-c((K*Lambda[m]-_Z*alpha-_Z*pi)/(K*Lambda[m]))*Lambda[m]+d*alpha+Lambda[m]*alpha+d*pi+Lambda[m]*pi)/Lambda[m], S[m] = RootOf(-c((K*Lambda[m]-_Z*alpha-_Z*pi)/(K*Lambda[m]))*Lambda[m]+d*alpha+Lambda[m]*alpha+d*pi+Lambda[m]*pi)]

(8)

"(=)"

[T[h] = 0, S[h] = Lambda[h]*(rho[2]+b[h])/(b[h]^2+(kappa+rho[2]+beta[1])*b[h]+beta[1]*rho[2]), R[h] = kappa*Lambda[h]/(b[h]^2+(kappa+rho[2]+beta[1])*b[h]+beta[1]*rho[2]), L = (alpha+pi)*RootOf(-c((K*Lambda[m]-_Z*alpha-_Z*pi)/(K*Lambda[m]))*Lambda[m]+d*alpha+Lambda[m]*alpha+d*pi+Lambda[m]*pi)/Lambda[m], S[m] = RootOf(-c((K*Lambda[m]-_Z*alpha-_Z*pi)/(K*Lambda[m]))*Lambda[m]+d*alpha+Lambda[m]*alpha+d*pi+Lambda[m]*pi)]

(9)

"(=)"

[T[h] = 0, S[h] = Lambda[h]*(rho[2]+b[h])/(b[h]^2+(kappa+rho[2]+beta[1])*b[h]+beta[1]*rho[2]), R[h] = kappa*Lambda[h]/(b[h]^2+(kappa+rho[2]+beta[1])*b[h]+beta[1]*rho[2]), L = (alpha+pi)*RootOf(-c((K*Lambda[m]-_Z*alpha-_Z*pi)/(K*Lambda[m]))*Lambda[m]+d*alpha+Lambda[m]*alpha+d*pi+Lambda[m]*pi)/Lambda[m], S[m] = RootOf(-c((K*Lambda[m]-_Z*alpha-_Z*pi)/(K*Lambda[m]))*Lambda[m]+d*alpha+Lambda[m]*alpha+d*pi+Lambda[m]*pi)]

(10)

solve({eq4, eq5}, [L, S[m]], explicit)

[[L = 0, S[m] = 0], [L = (alpha+pi)*RootOf(-c((K*Lambda[m]-_Z*alpha-_Z*pi)/(K*Lambda[m]))*Lambda[m]+d*alpha+Lambda[m]*alpha+d*pi+Lambda[m]*pi)/Lambda[m], S[m] = RootOf(-c((K*Lambda[m]-_Z*alpha-_Z*pi)/(K*Lambda[m]))*Lambda[m]+d*alpha+Lambda[m]*alpha+d*pi+Lambda[m]*pi)]]

(11)

theIndets := indets(indets(sol, atomic))

{K, L, alpha, d, kappa, pi, Lambda[h], Lambda[m], R[h], S[h], S[m], T[h], b[h], beta[1], rho[2]}

(12)

allvalues(sol)

[[T[h] = 0, S[h] = Lambda[h]*(rho[2]+b[h])/(kappa*b[h]+b[h]^2+b[h]*beta[1]+b[h]*rho[2]+beta[1]*rho[2]), R[h] = kappa*Lambda[h]/(kappa*b[h]+b[h]^2+b[h]*beta[1]+b[h]*rho[2]+beta[1]*rho[2]), L = 0, S[m] = 0], [T[h] = 0, S[h] = Lambda[h]*(rho[2]+b[h])/(kappa*b[h]+b[h]^2+b[h]*beta[1]+b[h]*rho[2]+beta[1]*rho[2]), R[h] = kappa*Lambda[h]/(kappa*b[h]+b[h]^2+b[h]*beta[1]+b[h]*rho[2]+beta[1]*rho[2]), L = -K*(RootOf(-c(_Z)*Lambda[m]+d*alpha+Lambda[m]*alpha+d*pi+Lambda[m]*pi)-1), S[m] = -K*Lambda[m]*(RootOf(-c(_Z)*Lambda[m]+d*alpha+Lambda[m]*alpha+d*pi+Lambda[m]*pi)-1)/(alpha+pi)]]

(13)

NULL

``

Download maple_code_for_disease_equilibruim.mw

How i can find parameter after substitution in our pde 

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

declare(u(x, t))

u(x, t)*`will now be displayed as`*u

(2)

declare(f(x, t))

f(x, t)*`will now be displayed as`*f

(3)

pde := diff(u(x, t), `$`(x, 3))+6*u(x, t)*(diff(u(x, t), x))+diff(u(x, t), t) = 0

diff(diff(diff(u(x, t), x), x), x)+6*u(x, t)*(diff(u(x, t), x))+diff(u(x, t), t) = 0

(4)

map(int, diff(diff(diff(u(x, t), x), x), x)+6*u(x, t)*(diff(u(x, t), x))+diff(u(x, t), t) = 0, x)

3*u(x, t)^2+diff(diff(u(x, t), x), x)+int(diff(u(x, t), t), x) = 0

(5)

pde1 := %

3*u(x, t)^2+diff(diff(u(x, t), x), x)+int(diff(u(x, t), t), x) = 0

(6)

Y := u(x, t) = 2*(diff(ln(f(x, t)), `$`(x, 2)))

u(x, t) = 2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2

(7)

L := eval(pde1, Y)

3*(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2)^2+2*(diff(diff(diff(diff(f(x, t), x), x), x), x))/f(x, t)-8*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))/f(x, t)^2+24*(diff(diff(f(x, t), x), x))*(diff(f(x, t), x))^2/f(x, t)^3-6*(diff(diff(f(x, t), x), x))^2/f(x, t)^2-12*(diff(f(x, t), x))^4/f(x, t)^4-2*(diff(f(x, t), x))*(diff(f(x, t), t))/f(x, t)^2+2*(diff(diff(f(x, t), t), x))/f(x, t) = 0

(8)

numer(lhs(3*(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2)^2+2*(diff(diff(diff(diff(f(x, t), x), x), x), x))/f(x, t)-8*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))/f(x, t)^2+24*(diff(diff(f(x, t), x), x))*(diff(f(x, t), x))^2/f(x, t)^3-6*(diff(diff(f(x, t), x), x))^2/f(x, t)^2-12*(diff(f(x, t), x))^4/f(x, t)^4-2*(diff(f(x, t), x))*(diff(f(x, t), t))/f(x, t)^2+2*(diff(diff(f(x, t), t), x))/f(x, t) = 0))*denom(rhs(3*(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2)^2+2*(diff(diff(diff(diff(f(x, t), x), x), x), x))/f(x, t)-8*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))/f(x, t)^2+24*(diff(diff(f(x, t), x), x))*(diff(f(x, t), x))^2/f(x, t)^3-6*(diff(diff(f(x, t), x), x))^2/f(x, t)^2-12*(diff(f(x, t), x))^4/f(x, t)^4-2*(diff(f(x, t), x))*(diff(f(x, t), t))/f(x, t)^2+2*(diff(diff(f(x, t), t), x))/f(x, t) = 0)) = numer(rhs(3*(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2)^2+2*(diff(diff(diff(diff(f(x, t), x), x), x), x))/f(x, t)-8*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))/f(x, t)^2+24*(diff(diff(f(x, t), x), x))*(diff(f(x, t), x))^2/f(x, t)^3-6*(diff(diff(f(x, t), x), x))^2/f(x, t)^2-12*(diff(f(x, t), x))^4/f(x, t)^4-2*(diff(f(x, t), x))*(diff(f(x, t), t))/f(x, t)^2+2*(diff(diff(f(x, t), t), x))/f(x, t) = 0))*denom(lhs(3*(2*(diff(diff(f(x, t), x), x))/f(x, t)-2*(diff(f(x, t), x))^2/f(x, t)^2)^2+2*(diff(diff(diff(diff(f(x, t), x), x), x), x))/f(x, t)-8*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))/f(x, t)^2+24*(diff(diff(f(x, t), x), x))*(diff(f(x, t), x))^2/f(x, t)^3-6*(diff(diff(f(x, t), x), x))^2/f(x, t)^2-12*(diff(f(x, t), x))^4/f(x, t)^4-2*(diff(f(x, t), x))*(diff(f(x, t), t))/f(x, t)^2+2*(diff(diff(f(x, t), t), x))/f(x, t) = 0))

2*f(x, t)^2*(3*(diff(diff(f(x, t), x), x))^2+f(x, t)*(diff(diff(diff(diff(f(x, t), x), x), x), x))+f(x, t)*(diff(diff(f(x, t), t), x))-4*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))-(diff(f(x, t), x))*(diff(f(x, t), t))) = 0

(9)

PP := simplify(2*f(x, t)^2*(3*(diff(diff(f(x, t), x), x))^2+f(x, t)*(diff(diff(diff(diff(f(x, t), x), x), x), x))+f(x, t)*(diff(diff(f(x, t), t), x))-4*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))-(diff(f(x, t), x))*(diff(f(x, t), t))) = 0)

2*f(x, t)^2*(3*(diff(diff(f(x, t), x), x))^2+f(x, t)*(diff(diff(diff(diff(f(x, t), x), x), x), x))+f(x, t)*(diff(diff(f(x, t), t), x))-4*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))-(diff(f(x, t), x))*(diff(f(x, t), t))) = 0

(10)

%/(2*f(x, t)^2)

3*(diff(diff(f(x, t), x), x))^2+f(x, t)*(diff(diff(diff(diff(f(x, t), x), x), x), x))+f(x, t)*(diff(diff(f(x, t), t), x))-4*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))-(diff(f(x, t), x))*(diff(f(x, t), t)) = 0

(11)

collect(%, f)

(diff(diff(diff(diff(f(x, t), x), x), x), x)+diff(diff(f(x, t), t), x))*f(x, t)+3*(diff(diff(f(x, t), x), x))^2-4*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))-(diff(f(x, t), x))*(diff(f(x, t), t)) = 0

(12)

pde2 := %

(diff(diff(diff(diff(f(x, t), x), x), x), x)+diff(diff(f(x, t), t), x))*f(x, t)+3*(diff(diff(f(x, t), x), x))^2-4*(diff(diff(diff(f(x, t), x), x), x))*(diff(f(x, t), x))-(diff(f(x, t), x))*(diff(f(x, t), t)) = 0

(13)

N = 1

N = 1

(14)

S := f(x, t) = a[0]+a[1]*exp(t*n[1]+x*k[1])

f(x, t) = a[0]+a[1]*exp(t*n[1]+x*k[1])

(15)

A := eval(pde2, S)

(a[1]*k[1]^4*exp(t*n[1]+x*k[1])+a[1]*n[1]*k[1]*exp(t*n[1]+x*k[1]))*(a[0]+a[1]*exp(t*n[1]+x*k[1]))-a[1]^2*k[1]^4*(exp(t*n[1]+x*k[1]))^2-a[1]^2*k[1]*(exp(t*n[1]+x*k[1]))^2*n[1] = 0

(16)

simplify((a[1]*k[1]^4*exp(t*n[1]+x*k[1])+a[1]*n[1]*k[1]*exp(t*n[1]+x*k[1]))*(a[0]+a[1]*exp(t*n[1]+x*k[1]))-a[1]^2*k[1]^4*(exp(t*n[1]+x*k[1]))^2-a[1]^2*k[1]*(exp(t*n[1]+x*k[1]))^2*n[1] = 0)

a[0]*a[1]*exp(t*n[1]+x*k[1])*k[1]*(k[1]^3+n[1]) = 0

(17)

%/exp(t*n[1]+x*k[1])

(k[1]^3+n[1])*k[1]*a[1]*a[0] = 0

(18)

PPP := %

(k[1]^3+n[1])*k[1]*a[1]*a[0] = 0

(19)

Co := solve(PPP, {a[0], a[1], k[1], n[1]})

{a[0] = a[0], a[1] = a[1], k[1] = k[1], n[1] = -k[1]^3}, {a[0] = a[0], a[1] = a[1], k[1] = 0, n[1] = n[1]}, {a[0] = a[0], a[1] = 0, k[1] = k[1], n[1] = n[1]}, {a[0] = 0, a[1] = a[1], k[1] = k[1], n[1] = n[1]}

(20)

case1 := Co[1]

{a[0] = a[0], a[1] = a[1], k[1] = k[1], n[1] = -k[1]^3}

(21)

F := subs(case1, S)

f(x, t) = a[0]+a[1]*exp(-t*k[1]^3+x*k[1])

(22)

F1 := eval(Y, F)

u(x, t) = 2*a[1]*k[1]^2*exp(-t*k[1]^3+x*k[1])/(a[0]+a[1]*exp(-t*k[1]^3+x*k[1]))-2*a[1]^2*k[1]^2*(exp(-t*k[1]^3+x*k[1]))^2/(a[0]+a[1]*exp(-t*k[1]^3+x*k[1]))^2

(23)

pdetest(F1, pde)

0

(24)

N = 2

N = 2

(25)

S2 := f(x, t) = a[0]+a[1]*exp(t*n[1]+x*k[1])+a[2]*exp(t*n[2]+x*k[2])+a[3]*exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])

f(x, t) = a[0]+a[1]*exp(t*n[1]+x*k[1])+a[2]*exp(t*n[2]+x*k[2])+a[3]*exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])

(26)

eq5 := normal(eval(pde2, S2))

exp(t*n[1]+x*k[1])*a[0]*a[1]*k[1]^4-4*exp(t*n[1]+x*k[1])*exp(t*n[2]+x*k[2])*a[1]*a[2]*k[1]^3*k[2]+6*exp(t*n[1]+x*k[1])*exp(t*n[2]+x*k[2])*a[1]*a[2]*k[1]^2*k[2]^2-4*exp(t*n[1]+x*k[1])*exp(t*n[2]+x*k[2])*a[1]*a[2]*k[1]*k[2]^3+exp(t*n[1]+x*k[1])*exp(t*n[2]+x*k[2])*a[1]*a[2]*k[1]*n[1]-exp(t*n[1]+x*k[1])*exp(t*n[2]+x*k[2])*a[1]*a[2]*k[1]*n[2]-exp(t*n[1]+x*k[1])*exp(t*n[2]+x*k[2])*a[1]*a[2]*k[2]*n[1]+exp(t*n[1]+x*k[1])*exp(t*n[2]+x*k[2])*a[1]*a[2]*k[2]*n[2]+exp(t*n[1]+x*k[1])*exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[1]*a[3]*k[2]*n[2]+exp(t*n[2]+x*k[2])*exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[2]*a[3]*k[1]*n[1]+exp(t*n[1]+x*k[1])*a[0]*a[1]*k[1]*n[1]+exp(t*n[2]+x*k[2])*a[0]*a[2]*k[2]^4+exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[0]*a[3]*k[1]^4+exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[0]*a[3]*k[2]^4+exp(t*n[1]+x*k[1])*exp(t*n[2]+x*k[2])*a[1]*a[2]*k[1]^4+exp(t*n[1]+x*k[1])*exp(t*n[2]+x*k[2])*a[1]*a[2]*k[2]^4+exp(t*n[1]+x*k[1])*exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[1]*a[3]*k[2]^4+exp(t*n[2]+x*k[2])*exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[2]*a[3]*k[1]^4+4*exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[0]*a[3]*k[1]^3*k[2]+6*exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[0]*a[3]*k[1]^2*k[2]^2+4*exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[0]*a[3]*k[1]*k[2]^3+exp(t*n[2]+x*k[2])*a[0]*a[2]*k[2]*n[2]+exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[0]*a[3]*k[1]*n[1]+exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[0]*a[3]*k[1]*n[2]+exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[0]*a[3]*k[2]*n[1]+exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])*a[0]*a[3]*k[2]*n[2] = 0

(27)

indets(eq5)

{t, x, a[0], a[1], a[2], a[3], k[1], k[2], n[1], n[2], exp(t*n[1]+x*k[1]), exp(t*n[2]+x*k[2]), exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])}

(28)

eq6 := eval(eq5, {t*n[1]+x*k[1] = X, t*n[2]+x*k[2] = Y}); indets(eq6)

Error, invalid input: exp expects its 1st argument, x, to be of type algebraic, but received u(x,t) = 2*diff(diff(f(x,t),x),x)/f(x,t)-2*diff(f(x,t),x)^2/f(x,t)^2

 

{eq6}

(29)

``

NULL

NULL

NULL

NULL

S3 := f(x, t) = a[0]+sum(exp(t*n[i]+x*k[i]), i = 1 .. 3)+a[1]*exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])+a[2]*exp(t*n[1]+t*n[3]+x*k[1]+x*k[3])+a[3]*exp(t*n[2]+t*n[3]+x*k[2]+x*k[3])+a[4]*exp(t*n[1]+t*n[2]+t*n[3]+x*k[1]+x*k[2]+x*k[3])

f(x, t) = a[0]+exp(t*n[1]+x*k[1])+exp(t*n[2]+x*k[2])+exp(t*n[3]+x*k[3])+a[1]*exp(t*n[1]+t*n[2]+x*k[1]+x*k[2])+a[2]*exp(t*n[1]+t*n[3]+x*k[1]+x*k[3])+a[3]*exp(t*n[2]+t*n[3]+x*k[2]+x*k[3])+a[4]*exp(t*n[1]+t*n[2]+t*n[3]+x*k[1]+x*k[2]+x*k[3])

(30)

NULL

NULL

eq5 := normal(eval(pde2, S3))

 

``

Download N-soliton.mw

I want to calculate Hodge Star of forms on a solvable Lie algebra L, I have defined a metric tensor g on it. But when I use that g to compute the Hodge Star of an operator it tells me that the g is not a metric tensor.

with(DifferentialGeometry);
with(LieAlgebras);
A := Matrix(4, 4, [[A__11, A__12, A__13, A__14], [A__21, -A__11, A__23, A__24], [-A__24, -A__23, -A__11, A__21], [-A__14, -A__13, A__12, A__11]]);
x := [x__1, x__2, x__3, x__4, x__5, x__6];
StructureEquations := [[x[6], x[1]] = a*x[1], [x[6], x[2]] = add(A[1, i]*x[i + 1], i = 1 .. 4), [x[6], x[3]] = add(A[2, i]*x[i + 1], i = 1 .. 4), [x[6], x[4]] = add(A[3, i]*x[i + 1], i = 1 .. 4), [x[6], x[5]] = add(A[4, i]*x[i + 1], i = 1 .. 4)];
L := LieAlgebraData(StructureEquations, [x[1], x[2], x[3], x[4], x[5], x[6]], Alg1);
DGsetup(L);
with(Tensor);
e := [e1, e2, e3, e4, e5, e6];
theta := [theta1, theta2, theta3, theta4, theta5, theta6];
omega := evalDG(add(theta[i] &wedge theta[7 - i], i = 1 .. 3));
g := evalDG(add(theta[i] &t theta[7 - i], i = 1 .. 3));
HodgeStar(g, theta1)

It is showing the following error,

Error, (in DifferentialGeometry:-Tensor:-HodgeStar) expected 1st argument to be a metric tensor. Received: _DG([["tensor", Alg1, [["cov_bas", "cov_bas"], []]], [`...`]])

How can I correct this? If not is there an alternative of doing what I am trying to do?

I would like to define a binary operator, let's say T, such that `T`(a, b) be displayed a T b.

Is this possible in Maple (preferably 2015 [define doesn't have a 'binary' property], but a solution for any higher version would be welcome)?

Example

restart;

`union`(a, b);

`union`(a, b)

(1)

alias(`#mo("&#x2245;")` = `union`):
`union`(a, b);  

`#mo("&#x2245;")`(a, b)

(2)

# desired:
`#mrow(mo("a"),mo("&nbsp;"),mo("&#x2245;"),mo("&nbsp;"),mo("b"))`

`#mrow(mo("a"),mo("&nbsp;"),mo("&#x2245;"),mo("&nbsp;"),mo("b"))`

(3)
 

 

Download binary_operator.mw

Thanks in advance

I am trying to find the phase portraits of a dynamical system; couples ODE system but it appears in singular form. How can we remove the singularity of coupled ODE system in P and W depending on \xi, where \alpha is scalar and v is velocity.

How remove quadratic singularity to make this system Hamiltonian in below coupled ODE system in P & W.

 singular_system.mw

restart

with(PDEtools):

alias(P = P(xi), W = W(xi))

P, W

(1)

rf1 := diff(P, xi) = W

diff(P, xi) = W

(2)

rf2 := diff(W, xi) = (P-(alpha^2+1)*P*W^2)/(v+(1/2*(alpha^2+1))*P^2)

diff(W, xi) = (P-(alpha^2+1)*P*W^2)/(v+(1/2)*(alpha^2+1)*P^2)

(3)
 

 

Download singular_system.mw

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