Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

How i can get FN from N-soliton to FN for M-lump by applying long wave method and using limit How we can get the series of lump , there is some example for nowing how lump work like f[2] for 1 lump and f[4] for two lump and f[6] for 3 lump i, and also in last of work i showed the series of for n soliton which we can change it to m-lump  but i don't know how work and a[12] will change to b[12] by applying long wave method

m-lump.mw

After my maple (2023) had a crash (froze) and i forc closed it all my files are opened and then changed. All equation fields are changed into "Maple Input" type equations. This completely ruins all my "document" type files where the appearance of the equations was important. More than that most of the changed equations give rise to errors. So the file is basically destroyed. The odd thing is that the file looks fine the first few seconds, but then it is changed completely.
I have uninstalled 2023, and installed Maple 2024 without success. 

Plz help!

Hello

I encountered a few problems. One is that in the first section, I wanted to use the definition above instead of f (s ) and g (s ), which means that when the variable changes under the integral sign, it should detect and replace it.

And the next is that in the Equality section, I should sort by p and set the coefficients to zero. And then, for example, solve for the zero power of p and get the value of f0 and use it in subsequent solutions. Can you help me?

restart;
EQUATIONS

equ1:=diff(f(t),t)-1-t-t^2-g(t)-int(f(s)+g(s),s=0..t)=0;

equ2:=diff(g(t),t)+1+t-f(t)+int(f(s)-g(s),s=0..t)=0;
 

diff(f(t), t)-1-t-t^2-g(t)-(int(f(s)+g(s), s = 0 .. t)) = 0

 

diff(g(t), t)+1+t-f(t)+int(f(s)-g(s), s = 0 .. t) = 0

(1)

f(t):=sum(f[i](t)*p^i,i=0..1);

f[0](t)+f[1](t)*p

(2)

g(t):=sum(g[i](t)*p^i,i=0..1);

g[0](t)+g[1](t)*p

(3)


HPMs

hpm1:=(1-p)*(diff(f(t),t)-1-t-t^2)+p*(-diff(f(t),t)+1+t+t^2-g(t)-int(f(s)+g(s),s=0..t))=0;

hpm2:=(1-p)*(diff(g(t),t)+1+t)+p*(diff(g(t),t)-1-t+f(t)-int(f(s)-g(s),s=0..t))=0;

(1-p)*(diff(f[0](t), t)+(diff(f[1](t), t))*p-1-t-t^2)+p*(-(diff(f[0](t), t))-(diff(f[1](t), t))*p+1+t+t^2-g[0](t)-g[1](t)*p-(int(f(s)+g(s), s = 0 .. t))) = 0

 

(1-p)*(diff(g[0](t), t)+(diff(g[1](t), t))*p+1+t)+p*(diff(g[0](t), t)+(diff(g[1](t), t))*p-1-t+f[0](t)+f[1](t)*p-(int(f(s)-g(s), s = 0 .. t))) = 0

(4)

``

Collect

A:=collect(hpm1,p);

(-2*(diff(f[1](t), t))-g[1](t))*p^2+(2*t^2-2*(diff(f[0](t), t))+diff(f[1](t), t)-g[0](t)-(int(f(s)+g(s), s = 0 .. t))+2*t+2)*p-t^2+diff(f[0](t), t)-t-1 = 0

(5)

EqualityNULL

for i from 0 to degree(A,p) do EQ[i]:=simplify(coeff(A,p,i)); end do;

Error, final value in for loop must be numeric or character

 
   

Download HPMsystem.mw

This is a error what all the time, shows up with the ai programs.

U:=U(xi);
Error, recursive assignment

U and U(xi)  seems to be related ? 

How do I get Maple 2023 to simplify/combine units in results?  For example,

Quantity(3.3897859*Unit(km^2)/Unit(m^2), 0.2) ;

should simplify to

Quantity(3389785.9, 0.2) ;

The full example where the problem occurs is given below.

alias(l = log10, l100 = log[100], pi[0] = Pi, r = sqrt, S_ellipsoid = ellipsoid) :
with(ScientificErrorAnalysis) :
with(Units) :

_km := Unit(km) :
_lm := Unit(lm) :
_lx := Unit(lx) :
_m := Unit(m) :
_rev := Unit(rev) :
alias(Q = Quantity) :
AddUnit(astronomical_unit, context = astronomy, default = true, conversion = 149597870700*m) :
pi := pi[0] :
S_spheroid := (a, b) -> S_ellipsoid(a, a, b) :

_AU := Unit(AU) :
a_Mars := Q(227939366., 1.)*_km : ##
a_Terra := Q(149598023., 1.)*_km : ##
alpha_Phobos := Q(9517.58, 0.01)*_km : ##
B_Phobos := Q(0.071, 0.012) :
d_x_Phobos := Q(25.90, 0.08)*_km :
d_y_Phobos := Q(22.60, 0.08)*_km :
d_z_Phobos := Q(18.32, 0.06)*_km :
E_I := _lx :
H_Mars := -Q(1.5, 0.1) : ##
L_Sol := Q(3.75E28, 0.01E28)*_lm : ##
m_E := -Q(14.18, 0.01) : ##
pi_Phobos := Q(9234.42, 0.01)*_km : ##
r_e_Mars := Q(3396.2, 0.1)*_km :
r_e_Terra := Q(6378137.0, 0.1)*_m : ##
S_sphere := r -> S_spheroid(r, r) :
theta_rev := _rev :

a_Phobos := (alpha_Phobos + pi_Phobos)/2 :
Delta_Sol := a_Terra - r_e_Terra : 
l_A := _AU :
m := E -> m_E - 5*l100(E/E_I) :
r_x_Phobos := d_x_Phobos/2 :
r_y_Phobos := d_y_Phobos/2 :
r_z_Phobos := d_z_Phobos/2 :
theta_rev2 := theta_rev/2 :

Delta_Mars := r(a_Mars^2 + Delta_Sol^2) : 
q := theta -> 2*((sin(theta)/pi) + (1 - (theta/theta_rev2))*cos(theta))/3 :
r_e_Phobos := (r_x_Phobos + r_y_Phobos)/2 :
S_Phobos := S_ellipsoid(r_x_Phobos, r_y_Phobos, r_z_Phobos) :

Delta_Phobos := Delta_Mars : 
L_Phobos := B_Phobos*L_Sol*S_Phobos/(2*S_sphere(a_Mars)) :
mu_Mars := 5*l(a_Mars*Delta_Mars/l_A^2) : 
rho_e_Mars := arcsin(r_e_Mars/Delta_Mars) :
theta_Mars := arccos((a_Mars^2 + Delta_Mars^2 - Delta_Sol^2)/(2*a_Mars*Delta_Mars)) :

E_Phobos := L_Phobos/S_sphere(Delta_Phobos) :
m_Mars := H_Mars + mu_Mars - 5*l100(q(theta_Mars)) :
rho_e_Phobos := arcsin(r_e_Phobos/Delta_Phobos) :
rho_o_Phobos := arctan(a_Phobos/Delta_Phobos) :

Deltarho_Phobos := rho_o_Phobos - rho_e_Mars - rho_e_Phobos :
m_Phobos := m(E_Phobos) :

Deltam_Phobos := m_Phobos - m_Mars :

Deltarhostar_Phobos := Deltarho_Phobos/Deltam_Phobos :

"Phobos apparent logarithmic brightness in astronomical magnitudes" = combine(m_Phobos, errors) ;
"Mars-Phobos apparent angular separation in arcseconds" = combine(convert(Deltarhostar_Phobos, units, arcsec), errors) ;

(*
https://www.nicolesharp.net/wiki/Solar_System_data_for_Maple
https://en.wikipedia.org/wiki/astronomical_unit
https://en.wikipedia.org/wiki/Star_Sol
https://en.wikipedia.org/wiki/Planet_Terra
https://en.wikipedia.org/wiki/Terran_radius
https://en.wikipedia.org/wiki/WGS84
https://en.wikipedia.org/wiki/Planet_Mars
https://en.wikipedia.org/wiki/Satellite_Phobos
https://en.wikipedia.org/wiki/Solar_System_by_size
https://en.wikipedia.org/wiki/illuminance
*)

 

Why does the code below work when I use a standalone "assume" statement but not "assuming"?

That is, why don't the first two attempts at calculating the limit use the assumption contained in those statements, ie why don't those statements return infinity and not a signum like the last attempt at the limit?

`ω__b` := proc (alpha) options operator, arrow; `ω__0`*sqrt(1+alpha+sqrt(alpha+alpha^2)) end proc

proc (alpha) options operator, arrow; omega__0*sqrt(1+alpha+sqrt(alpha+alpha^2)) end proc

(1)

`assuming`([limit(`ω__b`(alpha), alpha = infinity)], [`ω__0`::positive]) = signum(omega__0)*infinityNULL

`assuming`([limit(`ω__b`(alpha), alpha = infinity)], [`ω__0` > 0]) = signum(omega__0)*infinityNULL

NULL

assume(`ω__0` > 0)

limit(`ω__b`(alpha), alpha = infinity) = infinityNULL

NULL

Download assuming.mw

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

Referring to the screenshots, "J" can be converted to "N m" in MF2024.1, but not in M2024.2.
Is this some sort of bug in M2024.2?

 

 

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

First 9 10 11 12 13 14 15 Last Page 11 of 2190