MaplePrimes Questions

I'd like to simplify the simple expression below by dividing numerator and denominator by m_1 to obtain an expression only containing alpha.

Maple doesn't not generate the desired result.

Is there a way to do this?

expr := sqrt(-(-m__1-m__2+sqrt(m__2*(m__1+m__2)))*`ω__0`^2/m__1)

(-(-m__1-m__2+(m__2*(m__1+m__2))^(1/2))*omega__0^2/m__1)^(1/2)

(1)

simplify(expr, {m__2/m__1 = alpha})

(omega__0^2*(alpha*m__1+m__1-(m__1^2*alpha*(alpha+1))^(1/2))/m__1)^(1/2)

(2)

NULL


Download simplify_side.mw

In the code below, expr is a variable that is a vector times a cosine. Maple performs the multiplication of the vector times the scalar and writes it all as a single vector.

For didactical purposes, I wish for Maple to write out the vector times the cosine, without putting the cosine in the vector.

How is this accomplished?

v := `<,>`(`<|>`(a), `<|>`(b))

Matrix(%id = 36893488152047505644)

(1)

expr := v*cos(t*theta+phi)

Matrix(%id = 36893488152047493236)

(2)

expr := 'v'*cos(t*theta+phi)

v*cos(t*theta+phi)

(3)

NULL

Download expr.mw

How can I obtain the Hamiltonian of Eq. (1) in terms of dynamical variables in Maple?

restart

with(PDEtools)

declare(phi(xi), psi(xi))

phi(xi)*`will now be displayed as`*phi

 

psi(xi)*`will now be displayed as`*psi

(1)

r1 := (1/2*(phi(xi)^2-2*c))*(diff(diff(phi(xi), xi), xi))+((-(1/2)*phi(xi)^2+c)*(k*phi(xi)^2-Omega)^2*(phi(xi)^2-c)^2/(phi(xi)^4*(phi(xi)^2-2*c)^2)-(-k*phi(xi)^2+c*k+Omega)*(k*phi(xi)^2-Omega)*(phi(xi)^2-c)/(phi(xi)^2*(phi(xi)^2-2*c))-(1/2)*k^2*phi(xi)^2+Omega*k+(diff(phi(xi), xi))^2+1)*phi(xi) = 0

(1/2)*(phi(xi)^2-2*c)*(diff(diff(phi(xi), xi), xi))+((-(1/2)*phi(xi)^2+c)*(k*phi(xi)^2-Omega)^2*(phi(xi)^2-c)^2/(phi(xi)^4*(phi(xi)^2-2*c)^2)-(-k*phi(xi)^2+c*k+Omega)*(k*phi(xi)^2-Omega)*(phi(xi)^2-c)/(phi(xi)^2*(phi(xi)^2-2*c))-(1/2)*k^2*phi(xi)^2+Omega*k+(diff(phi(xi), xi))^2+1)*phi(xi) = 0

(2)

r2 := simplify(%)

(-4*phi(xi)^3*(-(1/2)*phi(xi)^2+c)^2*(diff(diff(phi(xi), xi), xi))+(-2*phi(xi)^6+4*phi(xi)^4*c)*(diff(phi(xi), xi))^2-2*phi(xi)^6+(-c^2*k^2+2*Omega*c*k-Omega^2+4*c)*phi(xi)^4+Omega^2*c^2)/(-2*phi(xi)^5+4*c*phi(xi)^3) = 0

(3)

pa := {diff(diff(phi(xi), xi), xi) = diff(psi(xi), xi), diff(phi(xi), xi) = psi(xi)}

{diff(diff(phi(xi), xi), xi) = diff(psi(xi), xi), diff(phi(xi), xi) = psi(xi)}

(4)

r3 := subs(pa, r2)

(-4*phi(xi)^3*(-(1/2)*phi(xi)^2+c)^2*(diff(psi(xi), xi))+(-2*phi(xi)^6+4*phi(xi)^4*c)*psi(xi)^2-2*phi(xi)^6+(-c^2*k^2+2*Omega*c*k-Omega^2+4*c)*phi(xi)^4+Omega^2*c^2)/(-2*phi(xi)^5+4*c*phi(xi)^3) = 0

(5)

psixif := isolate(r3, diff(psi(xi), xi))

diff(psi(xi), xi) = -(1/4)*(-(-2*phi(xi)^6+4*phi(xi)^4*c)*psi(xi)^2+2*phi(xi)^6-(-c^2*k^2+2*Omega*c*k-Omega^2+4*c)*phi(xi)^4-Omega^2*c^2)/(phi(xi)^3*(-(1/2)*phi(xi)^2+c)^2)

(6)

NULL

Download Hamiltonian.mw

To select all pdf files in folder the command is

L1:=FileTools:-ListDirectory(currentdir(),'all','select'="*.pdf");

And to select all dvi files the command is 

 L2:=FileTools:-ListDirectory(currentdir(),'all','select'="*.dvi");

Is there a syntax to select both in one command? THis does not work as input to select must be string. It can not be list nor set.

  FileTools:-ListDirectory(currentdir(),'all','select'=["*.dvi","*.pdf"]);

So I end up doing

L1:=FileTools:-ListDirectory(currentdir(),'all','select'="*.pdf");
L2:=FileTools:-ListDirectory(currentdir(),'all','select'="*.dvi");
the_list := [ op(L1), op(L2) ];

If will be nice if Maple allows one to select based on different extensions in one command.  Imagine you have 5 different extensions to select. Now one has to issue 5 different commands, then collect all the 5 lists into one.

I'm trying to solve a system of two differential equations numerically
 

restart

eq1 := diff(A(t), t) = c1*(A__T-A(t))-c2*A(t)*R(t)

diff(A(t), t) = c1*(A__T-A(t))-c2*A(t)*R(t)

(1)

NULL

eq2 := diff(R(t), t) = (c3+c1)*(R__T-R(t))-c2*Ab(t)*R(t)

diff(R(t), t) = (c3+c1)*(R__T-R(t))-c2*Ab(t)*R(t)

(2)
 

 

sys1 := [eq1, eq2]

[diff(A(t), t) = c1*(A__T-A(t))-c2*A(t)*R(t), diff(R(t), t) = (c3+c1)*(R__T-R(t))-c2*Ab(t)*R(t)]

(3)

A__T := 100

100

(4)

R__T := 100

100

(5)

c2 := 1000

1000

(6)

c1 := 0.2e-4

0.2e-4

(7)

c3 := 2000

2000

(8)

``

InitCond := A(0) = A__T, R(0) = R__T

A(0) = 100, R(0) = 100

(9)

nsol := dsolve(sys1, InitCond, type = numeric)

Error, (in dsolve/numeric/type_check) insufficient initial/boundary value information for procedure defined problem

 

 

It seems to me this problem should be solvable for the initial conditions given.  Am I entering them wrong somehow?

 

NULL

Download dsolve_problem.mw

scmch.mw

I can't get a graph. Is this code is correct.Please help.

sps1.mw

how to plot this.i got error

How to integrate eq (4)? Since 'a', 'b', and 'c' are constant. 

restart

with(DEtools)

declare(z(x), y(x))

declare(z(x), y(x))

(1)

eq1 := (1/2)*(-z(x)^3-2*c*z(x))*(diff(diff(y(x), x), x))-((z(x)^2+2*c)*(diff(y(x), x))+b*z(x)^2+c*k+a)*(diff(z(x), x)) = 0

(1/2)*(-z(x)^3-2*c*z(x))*(diff(diff(y(x), x), x))-((z(x)^2+2*c)*(diff(y(x), x))+b*z(x)^2+c*k+a)*(diff(z(x), x)) = 0

(2)

eq2 := simplify(z(x)*eq1)

-z(x)*(z(x)*((1/2)*z(x)^2+c)*(diff(diff(y(x), x), x))+((z(x)^2+2*c)*(diff(y(x), x))+b*z(x)^2+c*k+a)*(diff(z(x), x))) = 0

(3)

eq3 := eval(int(lhs(eq2), x))

int(-z(x)*(z(x)*((1/2)*z(x)^2+c)*(diff(diff(y(x), x), x))+((z(x)^2+2*c)*(diff(y(x), x))+b*z(x)^2+c*k+a)*(diff(z(x), x))), x)

(4)

NULL

Download integration.mw

sstf.mw

In Graph has curves that are overlapping each other and the values of  S[t] = -1, -2, 1, 2 and also the y axis to range from 0 to 1.

I am trying to separate the real and imaginary parts of a complex expression in Maple to get Eq. (1.5) as in the attached image, but the Re and Im functions do not seem to return the expected results. Instead, Maple leaves the expression unchanged. PD_OD.mw

Is it possible to set a worksheet or maple up to only express trigonometric functions as sines? This is very helpful for certain exotic coordinate systems. Meaning cos(x)=sqrt(1-sin(x)^2)  and NOT equivalently  adding Pi/2 to the argument cos(x)=sin(x+Pi/2).
It is completely useless and futile to do algsubs, as Maple will later just revert back to cosines, so you want to do it in the headers so output is always expressed as sines in the document by default.

Basically you want to set something in the header of a worksheeet to always use expsincos on output, and then in addition cos(x)=k sqrt(1-sin(x)^2)   k\e{1,-1} on the output.

The modified Liouville equation

How to solve this pde for a general solution ?

The general solution in this form exist.

restart;

with(PDEtools): declare(u(x,t)); U:=diff_table(u(x,t));
PDE1:=U[t,t]=a^2*U[x,x]+b*exp(beta*U[]);
Sol11:=u(x,t)=1/beta*ln(2*(B^2-a^2*A^2)/(b*beta*(A*x+B*t+C)^2));
Sol12:=S->u(x,t)=1/beta*ln(8*a^2*C/(b*beta))
-2/beta*ln(S*(x+A)^2-S*a^2*(t+B)^2+S*C);
Test11:=pdetest(Sol11,PDE1);
Test12:=pdetest(Sol12(1),PDE1);
Test13:=pdetest(Sol12(-1),PDE1);

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

 

table( [(  ) = u(x, t) ] )

 

diff(diff(u(x, t), t), t) = a^2*(diff(diff(u(x, t), x), x))+b*exp(beta*u(x, t))

 

u(x, t) = ln(2*(-A^2*a^2+B^2)/(b*beta*(A*x+B*t+C)^2))/beta

 

proc (S) options operator, arrow; u(x, t) = ln(8*a^2*C/(b*beta))/beta-2*ln(S*(x+A)^2-S*a^2*(t+B)^2+S*C)/beta end proc

 

0

 

0

 

0

(1)

The Soll11 can be plotted with a Explore plot in this form of soll11 with th eparameters , but suppose i try to get the general solution in Maple ?

infolevel[pdsolve] := 3

pdsolve(PDE1, generalsolution)

ans := pdsolve(PDE1);

What solvin gstrategy to follow ? : the pde is a non-linear wave eqation  with a exponentiel sourceterm
It seems that the pde can reduced to a ode? :

 

with(PDEtools):
declare(u(x,t));

# Stap 1: Definieer de PDE
PDE := diff(u(x,t), t,t) = a^2 * diff(u(x,t), x,x) + b * exp(beta * u(x,t));

# Stap 2: Definieer de transformatie naar karakteristieke variabelen
# Nieuw: x en t uitgedrukt in ξ en η
tr := {
    x = (xi + eta)/2,
    t = (eta - xi)/(2*a)
};

# Pas de transformatie toe op de PDE
simplified_PDE := dchange(tr, PDE, [xi, eta], params = [a, b, beta], simplify);

# Stap 3: Definieer de algemene oplossing
solution := u(x,t) = (1/beta) * ln(
    (-8*a^2/(b*beta)) *
    diff(_F1(x - a*t), x) * diff(_F2(x + a*t), x) /
    (_F1(x - a*t) + _F2(x + a*t))^2
);

# Stap 4: Controleer de oplossing (optioneel)
pdetest(solution, PDE);  # Moet 0 teruggeven als correct

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

 

diff(diff(u(x, t), t), t) = a^2*(diff(diff(u(x, t), x), x))+b*exp(beta*u(x, t))

 

{t = (1/2)*(eta-xi)/a, x = (1/2)*xi+(1/2)*eta}

 

a^2*(diff(diff(u(xi, eta), xi), xi)-2*(diff(diff(u(xi, eta), eta), xi))+diff(diff(u(xi, eta), eta), eta)) = a^2*(diff(diff(u(xi, eta), xi), xi))+2*a^2*(diff(diff(u(xi, eta), eta), xi))+a^2*(diff(diff(u(xi, eta), eta), eta))+b*exp(beta*u(xi, eta))

 

u(x, t) = ln(-8*a^2*(D(_F1))(-a*t+x)*(D(_F2))(a*t+x)/(b*beta*(_F1(-a*t+x)+_F2(a*t+x))^2))/beta

 

0

(2)

missing some steps here : solution u  without  the pde reduced ?
there is a ode ?

# Definieer de ODE # vorige stappen ontbreken van de reduktie
ode := (v^2 - a^2) * diff(f(xi), xi, xi) = b * exp(beta * f(xi));

# Algemene oplossing zoeken
sol := dsolve(ode, f(xi));

(-a^2+v^2)*(diff(diff(f(xi), xi), xi)) = b*exp(beta*f(xi))

 

f(xi) = ln((1/2)*c__1*(tan((1/2)*(-c__1*a^2*beta+c__1*beta*v^2)^(1/2)*(c__2+xi)/(a^2-v^2))^2+1)/b)/beta

(3)

 

, ,

Question : how do i arrive on Soll11   in Maple  ?

 

Download liouville_reduced_2-2-2025_mprimes_vraag.mw

I did some example to change them but i didn't get the same result as book did it and i try to figure out by hand i get another result i know all of them are true but polar is for making the simple shap for ploting so How i can get the simple shape and if possible How do step by step like using totur we have for polar or not? 


 

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

with(plots); with(plottools)

with(VectorCalculus)

with(Student:-LinearAlgebra)

with(Student:-MultivariateCalculus)

S := x^2+y^2-1

x^2+y^2-1

(1)

convert(S, polar)

polar(abs(x^2+y^2-1), argument(x^2+y^2-1))

(2)

ChangeOfVariables(S, [cartesian[x, y], polar[r, theta]])

r^2*cos(theta)^2+r^2*sin(theta)^2-1

(3)

solve(%, r)

1, -1

(4)

 

 

T := x^4+2*x^2*y^2+y^4+2*x^3+2*x*y^2-y^2

x^4+2*x^2*y^2+y^4+2*x^3+2*x*y^2-y^2

(5)

ChangeOfVariables(T, [cartesian[x, y], polar[r, theta]])

r^4*cos(theta)^4+2*r^4*cos(theta)^2*sin(theta)^2+r^4*sin(theta)^4+2*r^3*cos(theta)^3+2*r^3*cos(theta)*sin(theta)^2-r^2*sin(theta)^2

(6)

simplify(%)

r^2*(-sin(theta)^2+r*(r+2*cos(theta)))

(7)

solve(%, r)

0, 0, -cos(theta)+(cos(theta)^2+sin(theta)^2)^(1/2), -cos(theta)-(cos(theta)^2+sin(theta)^2)^(1/2)

(8)

R := -3*x^2+y^2-4*x-1

-3*x^2+y^2-4*x-1

(9)

ChangeOfVariables(R, [cartesian[x, y], polar[r, theta]])

-3*r^2*cos(theta)^2+r^2*sin(theta)^2-4*r*cos(theta)-1

(10)

simplify(%)

-4*r^2*cos(theta)^2-4*r*cos(theta)+r^2-1

(11)

solve(%, r)

-1/(2*cos(theta)+1), -1/(2*cos(theta)-1)

(12)

NULL


 

Download polar.mw

Good day, 

I have this system of differential equations, which I solved numerically. 

Now I need to integrate the function y(t) numerically to get the corresponding expression for 

Z= exp(int y(t) dt ) (integrate from a given t to 0)

then I need to plot that system of differential equation vs (Z) with (t) as the parameter.

can you please help?

 eq1 := diff(x(t), t)-(1/6)*(6*x(t)^3*y(t)+(2*y(t)^2-2)*x(t)^2+3*y(t)*(z(t)-2)*x(t)-2*y(t)^2+2)*sqrt(3) = 0;

eq2 := diff(y(t), t)-(1/6)*(y(t)-1)*sqrt(3)*(y(t)+1)*(6*x(t)^2+2*y(t)*x(t)+3*z(t)-2) = 0;

eq3 := diff(z(t), t)-(1/3)*z(t)*sqrt(3)*(6*y(t)*x(t)^2+2*x(t)*y(t)^2+3*z(t)*y(t)-2*x(t)-3*y(t)) = 0;

eq4 := diff(s(t), t)-(1/3)*(y(t)-1)*sqrt(3)*(y(t)+1)*(6*x(t)^2+2*y(t)*x(t)+3*z(t)-2)*y(t) = 0;

eq5 := diff(Q(t), t)+sqrt(3)*((4/3-z(t)-2*x(t)^2)*y(t)+(2/3*(1-y(t)^2))*x(t))*Q(t)+2*((2/3)*y(t)+x(t))*P(t)/sqrt(3)-(2/3)*R(t) = 0;   
eq6 := diff(P(t), t)+(sqrt(3)*(1-z(t)-2*x(t)^2)*y(t)+2*(2-y(t)^2)*x(t)/sqrt(3))*P(t)+2*sqrt(3)*x(t)*Q(t)+(1/2)*R(t) = 0;       
eq7 := diff(R(t), t)-sqrt(3)*((3*x(t)^2+(3/2)*z(t)+4)*y(t)-(1/3*(1-3*y(t)^2))*x(t))*R(t)-z(t)*P(t) = 0;
eq8 := diff(T(t), t)-sqrt(3)*((6*x(t)^2+3*z(t)+1)*y(t)-(2*(1-y(t)^2))*x(t))*T(t)-(1-y(t)^2)*(Q(t)-(2/3)*P(t)) = 0;   
syst := {eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8};

ics := x(0) = .1, y(0) = .9, z(0) = .1, s(0) = .2, Q(0) = .1, P(0) = .9, R(0) = .1, T(0) = .2;
  

sol1 := dsolve({ics, op(syst)}, {P(t), Q(t), R(t), T(t), s(t), x(t), y(t), z(t)}, type = numeric, output = listprocedure);
 

 

Hi All,

Maple is changing fast. It is not possible to run some older codes. 

Is it possible those who have a valid Maple license to have the old versions free of charge?

I have Maple 7, 2018, 2021 licenses but still have problem running older codes.

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