Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

intersections := proc(P, Q, T)
local R, W, w, t, a, b, sol, buff, v;
sol := []; if T = Y then W := X; else W := Y; end if;
R := resultant(P, Q, T);
print(`Résultant :`);
print(R);
w := fsolve(R, W); t := [];
for v in [w] do t := [op(t), fsolve(subs(W = v, P), T)]; end do;
for a in [w] do for b in [t] do if T = Y then buff := abs(subs(X = a, Y = b, P)) + abs(subs(X = a, Y = b, Q));
printf(`X=%a,   Y=%a   --->  %a\\n`, a, b, buff); if buff < 1/100000000 then sol := [op(sol), [a, b]]; end if;
else buff := abs(subs(X = b, Y = a, P)) + abs(subs(X = b, Y = a, Q));
printf(`X=%a,   Y=%a   --->  %a\\n`, b, a, buff); if buff < 1/100000000 then sol := [op(sol), [b, a]];
end if; end if; end do; end do;
printf(`Nombre de solutions :  %a\\n`, nops(sol)); print(sol); end proc;
Try with :
intersections(X^2 + Y^2 - 1, X - Y, X); Would you like to develop this procedure which does not give the number of solutions ?Thank you.

i want to factoring the (m+G'/G) in my long equation but i use some trick but still i can't get the exactly system and still G will remain in my system what should i factoring for remove this G(xi) from my system is all about factoring , my system of equation are wrong contain G(xi) How i can remove it by taking a factoring or any other technique,

not parameter is arbitrary except V and sigma''

restart

with(PDEtools)

with(LinearAlgebra)

with(Physics)

with(SolveTools)

undeclare(prime)

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

(1)

_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.

 

declare(Omega(x, t)); declare(U(xi)); declare(u(x, y, z, t)); declare(Q(xi)); declare(V(xi))

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

 

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

 

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

 

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

 

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

(2)

NULL

ode := (-V*a[2]+a[1])*(diff(diff(U(xi), xi), xi))+U(xi)*(((-gamma+sigma)*k+b)*U(xi)^2-a[1]*k^2+(w*a[2]-alpha)*k-w) = 0

(-V*a[2]+a[1])*(diff(diff(U(xi), xi), xi))+U(xi)*(((-gamma+sigma)*k+b)*U(xi)^2-a[1]*k^2+(w*a[2]-alpha)*k-w) = 0

(3)

F := sum(e[i]*(m+(diff(G(xi), xi))/G(xi))^i, i = -1 .. 1)

e[-1]/(m+(diff(G(xi), xi))/G(xi))+e[0]+e[1]*(m+(diff(G(xi), xi))/G(xi))

(4)

D1 := diff(F, xi)

-e[-1]*((diff(diff(G(xi), xi), xi))/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)/(m+(diff(G(xi), xi))/G(xi))^2+e[1]*((diff(diff(G(xi), xi), xi))/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)

(5)

NULL

S := diff(G(xi), `$`(xi, 2)) = -(2*m*mu+lambda)*(diff(G(xi), xi))-mu

diff(diff(G(xi), xi), xi) = -(2*m*mu+lambda)*(diff(G(xi), xi))-mu

(6)

E1 := subs(S, D1)

-e[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)/(m+(diff(G(xi), xi))/G(xi))^2+e[1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)

(7)

D2 := diff(E1, xi)

2*e[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)*((diff(diff(G(xi), xi), xi))/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)/(m+(diff(G(xi), xi))/G(xi))^3-e[-1]*(-(2*m*mu+lambda)*(diff(diff(G(xi), xi), xi))/G(xi)-(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2-2*(diff(G(xi), xi))*(diff(diff(G(xi), xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)/(m+(diff(G(xi), xi))/G(xi))^2+e[1]*(-(2*m*mu+lambda)*(diff(diff(G(xi), xi), xi))/G(xi)-(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2-2*(diff(G(xi), xi))*(diff(diff(G(xi), xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)

(8)

E2 := subs(S, D2)

2*e[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)^2/(m+(diff(G(xi), xi))/G(xi))^3-e[-1]*(-(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)/(m+(diff(G(xi), xi))/G(xi))^2+e[1]*(-(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)

(9)

D3 := diff(E2, xi)

-6*e[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)^2*((diff(diff(G(xi), xi), xi))/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)/(m+(diff(G(xi), xi))/G(xi))^4+4*e[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)*(-(2*m*mu+lambda)*(diff(diff(G(xi), xi), xi))/G(xi)-(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2-2*(diff(G(xi), xi))*(diff(diff(G(xi), xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)/(m+(diff(G(xi), xi))/G(xi))^3+2*e[-1]*(-(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)*((diff(diff(G(xi), xi), xi))/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)/(m+(diff(G(xi), xi))/G(xi))^3-e[-1]*((2*m*mu+lambda)^2*(diff(diff(G(xi), xi), xi))/G(xi)+(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+3*(2*m*mu+lambda)*(diff(diff(G(xi), xi), xi))*(diff(G(xi), xi))/G(xi)^2+6*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))^2/G(xi)^3-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(diff(G(xi), xi), xi))/G(xi)^2+6*(diff(G(xi), xi))^2*(diff(diff(G(xi), xi), xi))/G(xi)^3-6*(diff(G(xi), xi))^4/G(xi)^4)/(m+(diff(G(xi), xi))/G(xi))^2+e[1]*((2*m*mu+lambda)^2*(diff(diff(G(xi), xi), xi))/G(xi)+(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+3*(2*m*mu+lambda)*(diff(diff(G(xi), xi), xi))*(diff(G(xi), xi))/G(xi)^2+6*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))^2/G(xi)^3-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(diff(G(xi), xi), xi))/G(xi)^2+6*(diff(G(xi), xi))^2*(diff(diff(G(xi), xi), xi))/G(xi)^3-6*(diff(G(xi), xi))^4/G(xi)^4)

(10)

E3 := subs(S, D3)

-6*e[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)^3/(m+(diff(G(xi), xi))/G(xi))^4+6*e[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)*(-(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)/(m+(diff(G(xi), xi))/G(xi))^3-e[-1]*((2*m*mu+lambda)^2*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)+4*(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+12*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))^2/G(xi)^3-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)^2/G(xi)^2-6*(diff(G(xi), xi))^4/G(xi)^4)/(m+(diff(G(xi), xi))/G(xi))^2+e[1]*((2*m*mu+lambda)^2*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)+4*(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+12*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))^2/G(xi)^3-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)^2/G(xi)^2-6*(diff(G(xi), xi))^4/G(xi)^4)

(11)

NULL

NULL

K := U(xi) = F

K1 := diff(U(xi), xi) = E1

K2 := diff(U(xi), `$`(xi, 2)) = E2

K3 := diff(U(xi), `$`(xi, 3)) = E3

NULL

L := eval(ode, {K, K1, K2, K3})

(-V*a[2]+a[1])*(2*e[-1]*((-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-(diff(G(xi), xi))^2/G(xi)^2)^2/(m+(diff(G(xi), xi))/G(xi))^3-e[-1]*(-(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3)/(m+(diff(G(xi), xi))/G(xi))^2+e[1]*(-(2*m*mu+lambda)*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)/G(xi)-3*(-(2*m*mu+lambda)*(diff(G(xi), xi))-mu)*(diff(G(xi), xi))/G(xi)^2+2*(diff(G(xi), xi))^3/G(xi)^3))+(e[-1]/(m+(diff(G(xi), xi))/G(xi))+e[0]+e[1]*(m+(diff(G(xi), xi))/G(xi)))*(((-gamma+sigma)*k+b)*(e[-1]/(m+(diff(G(xi), xi))/G(xi))+e[0]+e[1]*(m+(diff(G(xi), xi))/G(xi)))^2-a[1]*k^2+(w*a[2]-alpha)*k-w) = 0

(12)

NULL

# rewritting rule

RR := isolate(m+diff(G(xi), xi)/(G(xi))=Phi, diff(G(xi), xi)/G(xi));

(diff(G(xi), xi))/G(xi) = Phi-m

(13)

# Apply RR and collect wrt Phi

subs(RR, L):
normal(%):
PhiN := collect(numer(lhs(%)), phi):
PhiD := denom(lhs(%%));

Phi^3*G(xi)^4

(14)



with(LargeExpressions):

LLE := collect(PhiN, Phi, Veil[phi] ):
LLE / PhiD = 0;

(Phi^6*phi[1]+3*Phi^5*phi[2]-Phi^4*phi[3]-Phi^3*phi[4]-Phi^2*phi[5]+Phi*phi[6]-phi[7])/(Phi^3*G(xi)^4) = 0

(15)

# phi[i] coefficients


phis := [ seq( phi[i] = simplify(Unveil[phi](phi[i]), size), i=1..LastUsed[phi] ) ]:

print~( phis ):

phi[1] = G(xi)^4*e[1]^3*((-gamma+sigma)*k+b)

 

phi[2] = e[1]^2*G(xi)^4*e[0]*((-gamma+sigma)*k+b)

 

phi[3] = -3*e[1]*G(xi)^4*(-(1/3)*a[1]*k^2+(-e[-1]*(gamma-sigma)*e[1]+(-gamma+sigma)*e[0]^2+(1/3)*w*a[2]-(1/3)*alpha)*k+b*e[-1]*e[1]+b*e[0]^2-(1/3)*w)

 

phi[4] = (2*e[1]*(V*a[2]-a[1])*(diff(G(xi), xi))^3+3*e[1]*G(xi)*(2*m*mu+lambda)*(V*a[2]-a[1])*(diff(G(xi), xi))^2+e[1]*(V*a[2]-a[1])*G(xi)*((2*m*mu+lambda)^2*G(xi)+3*mu)*(diff(G(xi), xi))+G(xi)^2*(-(6*e[-1]*((-gamma+sigma)*k+b)*e[1]-a[1]*k^2+k*w*a[2]+((-gamma+sigma)*k+b)*e[0]^2-k*alpha-w)*e[0]*G(xi)+e[1]*mu*(2*m*mu+lambda)*(V*a[2]-a[1])))*G(xi)

 

phi[5] = -3*e[-1]*G(xi)^4*(-(1/3)*a[1]*k^2+(-e[-1]*(gamma-sigma)*e[1]+(-gamma+sigma)*e[0]^2+(1/3)*w*a[2]-(1/3)*alpha)*k+b*e[-1]*e[1]+b*e[0]^2-(1/3)*w)

 

phi[6] = 4*((1/2)*(V*a[2]-a[1])*(diff(G(xi), xi))^3+(3/2)*(V*a[2]-a[1])*(m*mu+(1/2)*lambda)*G(xi)*(diff(G(xi), xi))^2+(V*a[2]-a[1])*((m*mu+(1/2)*lambda)^2*G(xi)+(3/4)*mu)*G(xi)*(diff(G(xi), xi))+(1/2)*((3/2)*e[0]*((-gamma+sigma)*k+b)*e[-1]*G(xi)+(V*a[2]-a[1])*(m*mu+(1/2)*lambda)*mu)*G(xi)^2)*e[-1]*G(xi)

 

phi[7] = 8*e[-1]*((1/4)*(V*a[2]-a[1])*(diff(G(xi), xi))^4+(V*a[2]-a[1])*(m*mu+(1/2)*lambda)*G(xi)*(diff(G(xi), xi))^3+(V*a[2]-a[1])*((m*mu+(1/2)*lambda)^2*G(xi)+(1/2)*mu)*G(xi)*(diff(G(xi), xi))^2+(V*a[2]-a[1])*(m*mu+(1/2)*lambda)*mu*G(xi)^2*(diff(G(xi), xi))+(1/4)*(-(1/2)*((-gamma+sigma)*k+b)*e[-1]^2*G(xi)^2+mu^2*(V*a[2]-a[1]))*G(xi)^2)

(16)

# WATCHOUT: you have 9 coefficients and so its desirable to have the same number of unknowns

unknowns := indets(rhs~(phis), {e[-1],e[0],e[1],'identical'(mu),'identical'(lambda),'identical'(a[1]),'identical'(alpha)});

COEFFS := solve(rhs~(phis), unknowns)

{alpha, lambda, mu, a[1], e[-1], e[0], e[1]}

 

{alpha = alpha, lambda = lambda, mu = mu, a[1] = a[1], e[-1] = 0, e[0] = 0, e[1] = 0}, {alpha = alpha, lambda = lambda, mu = mu, a[1] = -(gamma*k*e[0]^2-k*sigma*e[0]^2-b*e[0]^2-k*w*a[2]+alpha*k+w)/k^2, e[-1] = 0, e[0] = e[0], e[1] = 0}, {alpha = (1/2)*(-G(xi)^4*gamma*k^3*e[-1]^2+G(xi)^4*k^3*sigma*e[-1]^2-4*G(xi)^2*(diff(G(xi), xi))*V*k^2*m*mu^2*a[2]+4*G(xi)*(diff(G(xi), xi))^3*V*k^2*m*mu*a[2]+G(xi)^4*b*k^2*e[-1]^2+4*G(xi)^2*(diff(G(xi), xi))*k*m*mu^2*w*a[2]-4*G(xi)*(diff(G(xi), xi))^3*k*m*mu*w*a[2]-2*G(xi)^2*V*k^2*mu^2*a[2]+2*G(xi)*(diff(G(xi), xi))^2*V*k^2*mu*a[2]-2*G(xi)*(diff(G(xi), xi))*RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)*V*k^2*mu*a[2]+2*(diff(G(xi), xi))^4*V*k^2*a[2]+2*(diff(G(xi), xi))^3*RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)*V*k^2*a[2]-4*G(xi)^2*(diff(G(xi), xi))*m*mu^2*w+2*G(xi)^2*k*mu^2*w*a[2]+4*G(xi)*(diff(G(xi), xi))^3*m*mu*w-2*G(xi)*(diff(G(xi), xi))^2*k*mu*w*a[2]+2*G(xi)*(diff(G(xi), xi))*RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)*k*mu*w*a[2]-2*(diff(G(xi), xi))^4*k*w*a[2]-2*(diff(G(xi), xi))^3*RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)*k*w*a[2]-2*G(xi)^2*mu^2*w+2*G(xi)*(diff(G(xi), xi))^2*mu*w-2*G(xi)*(diff(G(xi), xi))*RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)*mu*w+2*(diff(G(xi), xi))^4*w+2*(diff(G(xi), xi))^3*RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)*w)/((2*m*mu^2*(diff(G(xi), xi))*G(xi)^2-2*m*mu*(diff(G(xi), xi))^3*G(xi)+mu*(diff(G(xi), xi))*G(xi)*RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)-(diff(G(xi), xi))^3*RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)+mu^2*G(xi)^2-mu*(diff(G(xi), xi))^2*G(xi)-(diff(G(xi), xi))^4)*k), lambda = RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)/G(xi), mu = mu, a[1] = -(1/2)*(-G(xi)^4*gamma*k*e[-1]^2+G(xi)^4*k*sigma*e[-1]^2-4*G(xi)^2*(diff(G(xi), xi))*V*m*mu^2*a[2]+4*G(xi)*(diff(G(xi), xi))^3*V*m*mu*a[2]+G(xi)^4*b*e[-1]^2-2*G(xi)^2*V*mu^2*a[2]+2*G(xi)*(diff(G(xi), xi))^2*V*mu*a[2]-2*mu*G(xi)*(diff(G(xi), xi))*V*RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)*a[2]+2*(diff(G(xi), xi))^4*V*a[2]+2*(diff(G(xi), xi))^3*V*RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)*a[2])/(2*m*mu^2*(diff(G(xi), xi))*G(xi)^2-2*m*mu*(diff(G(xi), xi))^3*G(xi)+mu*(diff(G(xi), xi))*G(xi)*RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)-(diff(G(xi), xi))^3*RootOf(4*m^2*mu^2*(diff(G(xi), xi))*G(xi)^2+2*m*mu^2*G(xi)^2+6*m*mu*(diff(G(xi), xi))^2*G(xi)+3*mu*(diff(G(xi), xi))*G(xi)+2*(diff(G(xi), xi))^3+(4*m*mu*(diff(G(xi), xi))*G(xi)+mu*G(xi)+3*(diff(G(xi), xi))^2)*_Z+(diff(G(xi), xi))*_Z^2)+mu^2*G(xi)^2-mu*(diff(G(xi), xi))^2*G(xi)-(diff(G(xi), xi))^4), e[-1] = e[-1], e[0] = 0, e[1] = 0}

(17)

case1 := COEFFS[2]

{alpha = alpha, lambda = lambda, mu = mu, a[1] = -(gamma*k*e[0]^2-k*sigma*e[0]^2-b*e[0]^2-k*w*a[2]+alpha*k+w)/k^2, e[-1] = 0, e[0] = e[0], e[1] = 0}

(18)

NULL

F1 := subs(case1, F)

e[0]

(19)

F2 := subs(case1, ode)

(-a[2]*V-(gamma*k*e[0]^2-k*sigma*e[0]^2-b*e[0]^2-k*w*a[2]+alpha*k+w)/k^2)*(diff(diff(U(xi), xi), xi))+U(xi)*(((-gamma+sigma)*k+b)*U(xi)^2+k*e[0]^2*gamma-k*e[0]^2*sigma-b*e[0]^2-k*w*a[2]+k*alpha+(w*a[2]-alpha)*k) = 0

(20)

W := U(xi) = F1

U(xi) = e[0]

(21)

NULL

E := diff(G(xi), xi) = -(-2*m*mu-lambda)*exp(-(2*m*mu+lambda)*xi)*c__1/(2*m*mu+lambda)-mu/(2*m*mu+lambda)

diff(G(xi), xi) = -(-2*m*mu-lambda)*exp(-(2*m*mu+lambda)*xi)*c__1/(2*m*mu+lambda)-mu/(2*m*mu+lambda)

(22)

W1 := subs(E, W)

U(xi) = e[0]

(23)

W2 := subs(case1, W1)

U(xi) = e[0]

(24)

W3 := rhs(U(xi) = e[0])

e[0]

(25)

W4 := convert(W3, trig)

e[0]

(26)

W5 := W4

e[0]

(27)

odetest(W2, F2)

0

(28)

Download G-factoring.mw

I see this question
https://mathematica.stackexchange.com/questions/309952/how-to-choose-6-numbers-from-the-following-set-so-that-they-represent-the-length
and tried

primes := [seq(ithprime(i), i = 1 .. 20)];
with(combinat);
all_combinations := choose(primes, 6);

I can not make next part.

I found that convert(ode,y_x) converts the input ode, when it is NOT an equation, to an equation.  

sometimes and sometimes not.

For example,  convert(diff(y(t),t)+y(t)-t,y_x)  gives diff(t(y), y) = 1/(t(y) - y) 

Notice the input is not an equation. Maple adds = and makes an equation in the output. 

This can cause no problem if it works like this in all cases. But if the input has piecewise, then Maple no longer does the same and keep the output as not an equation.

I found this by accident, as my code was doing lhs() on the result of convert, and that always worked, except when I used an ode with piecewise.

This behaviour is not consistent. Maple should either always convert output to equation for all input or not convert. It should not do it for some input and not the other.

Actually, the best behaviour is for the software to reject the input in first place if it is not an equation.

Worksheet below.

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1841 and is the same as the version installed in this computer, created 2025, January 3, 8:59 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

#this works even when there is no equation in input, but the result is equation
ode:=diff(y(t),t)+y(t)-t;
convert(ode,y_x,y(t))

diff(y(t), t)+y(t)-t

diff(t(y), y) = 1/(t(y)-y)

ode:=diff(y(t),t)+y(t)-t=0; #this gives same result as above.
convert(ode,y_x,y(t))

diff(y(t), t)+y(t)-t = 0

diff(t(y), y) = 1/(t(y)-y)

#but now if the input is not equation, the output is not equation. Why
#did it not do the same as above??
ode:=diff(y(t),t)+y(t)-piecewise(0<=t and t<=1,2,t>1,0);
convert(ode,y_x,y(t))

ode := diff(y(t), t)+y(t)-piecewise(0 <= t and t <= 1, 2, 1 < t, 0)

1/(diff(t(y), y))+y-piecewise(0 <= t(y) and t(y) <= 1, 2, 1 < t(y), 0)

 

 

Download strange_behaviour_of_convert_yx_jan_5_20225.mw

I’m trying to solve a stiff system 1-D PDEs numerically in Maple but I’m getting the following error:

“Error, (in pdsolve/numeric/match_PDEs_BCs) cannot handle systems with multiple PDE describing the time dependence of the same dependent variable, or having no time dependence”

I included a picture of the PDEs and their BCs in the attached maple file. For easy reading, the attached file includes highlighted sections for parameters and variables. You can skip those to PDEs, BCs and ICs sections at the end of the document to reach the error I’m facing.

For reference, I used another software to solve the system and I was able to get the results in few seconds, so I think it is solvable. However, personally I prefer to use Maple so any inputs, insights, workarounds that I could use to handle the system in Maple would be of great help to me. Thank you.

question.mw

Dear Maple users

I am using the LinearInterpolation command from the Interpolation package. When I however want to integrate the result from one number to another, I only receive an abstract result. It is probably an easy question, but somehow I can't figure it out. I tried using MakeFunction and evalf command in order to receive a number for the integral. I hope someone can help.

Erik

Download Using_interpolation.mw

How do I explain this:

isolve({a*b=4,a>=1,b>=1});

I noticed a strange (for me) appearence of a dollar:

I know $ as an end of parameters marker, but here its role seems strange.
Is it a typsetting issue?

For plotting phase plot of two system of equations (autonomous), is there an option to increase of reduce number of arrows/line drawn?  I am not able to find such an option from help.

Below is an example. Google AI says stepsize should change the number of arrows, but it does not. It had no effect. Below is worksheet showing one example where I like to reduce number of arrows (not the size of the arrow, which is set to medium now).

I also tried numpoints option and it had no effect of how many arrows are drawn

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

the_sys:=[diff(x(t),t) = -3*x(t)-4*y(t), diff(y(t),t) = 2*x(t)+y(t)]:
DEtools:-DEplot(the_sys,[x(t), y(t)],t =0 .. 10,x = -4 .. 4,y = -4 .. 4,'labels' = [x(t),y(t)],'axes' = 'boxed', 'arrows'='medium')

 

 

Download change_number_of_arrows_jan_4_2025.mw

For reference, I'd like to do something similar using another system as below where it has option to change number of arrows.

On a similar track,

If you have a worksheet that contains a calculation and results that took very long to complete and saved with all the results, is it possible to load the maple worksheet, and let maple load all the results  and not execute all the commands.

Thereby you can immediately work further and dont have to completely recalculate the worksheet. ?

Basically a resume function for the worksheet. Will save a huge amount of time and I cannot see a reason why the worksheet cannot load just using the previously calculated results in the document.

every structure is true but my plot not run where is issue?
plot.mw

In the excellent book by W.G. Chinn, N.E. Steenrod "First Concepts of Topology" the theorem is proved which states that any bounded planar region can be cut into 4 regions of equal area by 2 perpendicular cuts (the pancake problem). This is an existence theorem which does not provide any way to find these cuts. In this post I made an attempt to find such cuts for any convex region on the plane bounded by a piecewise smooth self-non-intersecting curve.
The Into_4_Equal_Areas procedure returns a list of coordinates of 5 points: the first 4 points are the endpoints of the cutting segments, the fifth point is the intersection point of these segments. This procedure significantly uses my old procedure Area , which can be found in detail at the link  https://mapleprimes.com/posts/145922-Perimeter-Area-And-Visualization-Of-A-Plane-Figure-  . The formal argument of the Into_4_Equal_Areas procedure is a list  L specifying the boundary of the region to be cut. When specifying  L, the boundary can be passed clockwise or counterclockwise, but it is necessary that the parameter t (when specifying each link) should go in ascending order. This can always be achieved by replacing  t  with  -t  if necessary. The Pic procedure draws a picture of the source region and cutting segments. For ease of use, the code for the  Area  procedure is also provided. It is also worth noting that the procedure also works for "not too" non-convex regions (see examples below).

restart;
Area := proc(L) 
local i, var, e, e1, e2, P; 
for i to nops(L) do 
if type(L[i], listlist(algebraic)) then 
P[i] := (1/2)*add(L[i, j, 1]*L[i, j+1, 2]-L[i, j, 2]*L[i, j+1, 1], j = 1 .. nops(L[i])-1) else 
var := lhs(L[i, 2]); 
if type(L[i, 1], algebraic) then e := L[i, 1]; 
if nops(L[i]) = 3 then P[i] := (1/2)*(int(e^2, L[i, 2])) else 
if var = y then P[i] := (1/2)*simplify(int(e-var*(diff(e, var)), L[i, 2])) else 
P[i] := (1/2)*simplify(int(var*(diff(e, var))-e, L[i, 2])) end if end if else e1 := L[i, 1, 1]; e2 := L[i, 1, 2]; 
P[i] := (1/2)*simplify(int(e1*(diff(e2, var))-e2*(diff(e1, var)), L[i, 2])) end if end if end do; 
abs(add(P[i], i = 1 .. nops(L))); 
end proc:

Into_4_Equal_Areas:=proc(L::list,N::symbol:='OneSolution', eps::numeric:=0)
local D, n, c, L1, L2, L3, f, L0, i, j, k, m, A, B, C, P, S, sol, Sol;
f:=(X,Y)->expand((y-X[2])*(Y[1]-X[1])-(x-X[1])*(Y[2]-X[2]));
L0:=map(p->`if`(type(p,listlist),[[p[1,1]+t*(p[2]-p[1])[1],p[1,2]+t*(p[2]-p[1])[2]],t=0..1],p), L);
S:=Area(L); c:=0;
n:=nops(L);
for i from 1 to n do
for j from i to n do
for k from j to n do
for m from k to n do
if not ((nops({i,j,k})=1 and type(L[i],listlist)) or (nops({j,k,m})=1 and type(L[j],listlist)))then
A:=convert(subs(t=t1,L0[i,1]),Vector): 
B:=convert(subs(t=t2,L0[j,1]),Vector):
C:=convert(subs(t=t3,L0[k,1]),Vector): 
D:=convert(subs(t=t4,L0[m,1]),Vector):
P:=eval([x,y], solve({f(A,C),f(B,D)},{x,y})):
L1:=`if`(j=i,[subsop([2,2]=t1..t2,L0[i]),[convert(B,list),P],[P,convert(A,list)]],`if`(j=i+1,[subsop([2,2]=t1..op([2,2,2],L0[i]),L0[i]),subsop([2,2]=op([2,2,1],L0[j])..t2,L0[j]),[convert(B,list),P],[P,convert(A,list)]], [subsop([2,2]=t1..op([2,2,2],L0[i]),L0[i]),L0[i+1..j-1][],subsop([2,2]=op([2,2,1],L0[j])..t2,L0[j]),[convert(B,list),P],[P,convert(A,list)]])):
L2:=`if`(k=j,[subsop([2,2]=t2..t3,L0[j]),[convert(C,list),P],[P,convert(B,list)]],`if`(k=j+1,[subsop([2,2]=t2..op([2,2,2],L0[j]),L0[j]),subsop([2,2]=op([2,2,1],L0[k])..t3,L0[k]),[convert(C,list),P],[P,convert(B,list)]], [subsop([2,2]=t2..op([2,2,2],L0[j]),L0[j]),L0[j+1..k-1][],subsop([2,2]=op([2,2,1],L0[k])..t3,L0[k]),[convert(C,list),P],[P,convert(B,list)]])):
L3:=`if`(m=k,[subsop([2,2]=t3..t4,L0[k]),[convert(D,list),P],[P,convert(C,list)]],`if`(m=k+1,[subsop([2,2]=t3..op([2,2,2],L0[k]),L0[k]),subsop([2,2]=op([2,2,1],L0[m])..t4,L0[m]),[convert(D,list),P],[P,convert(C,list)]], [subsop([2,2]=t3..op([2,2,2],L0[k]),L0[k]),L0[k+1..m-1][],subsop([2,2]=op([2,2,1],L0[m])..t4,L0[m]),[convert(D,list),P],[P,convert(C,list)]])):
sol:=fsolve({Area(L1)-S/4,Area(L2)-S/4,Area(L3)-S/4,LinearAlgebra:-DotProduct(D-B,C-A, conjugate=false)},{t1=op([2,2,1],L0[i])-eps..op([2,2,2],L0[i])+eps,t2=op([2,2,1],L0[j])-eps..op([2,2,2],L0[j])+eps,t3=op([2,2,1],L0[k])-eps..op([2,2,2],L0[k])+eps,t4=op([2,2,1],L0[m])-eps..op([2,2,2],L0[m])+eps}) assuming real:
if type(sol,set(`=`)) then if N='OneSolution' then return convert~(eval([A,B,C,D,P],sol),list) else c:=c+1; Sol[c]:=convert~(eval([A,B,C,D,P],sol),list) fi;
 fi; fi;
od: od: od: od:
convert(Sol,list);
end proc:

Pic:=proc(L,Sol)
local P1, P2, T;
uses plots, plottools;
P1:=seq(`if`(type(s,listlist),line(s[],color=blue, thickness=2),plot([s[1][],s[2]],color=blue, thickness=2)),s=L):
P2:=line(Sol[1],Sol[3],color=red, thickness=2), line(Sol[2],Sol[4],color=red):
T:=textplot([[Sol[1][],"A"],[Sol[2][],"B"],[Sol[3][],"C"],[Sol[4][],"D"],[Sol[5][],"P"]], font=[times,18], align=[left,above]);
display(P1,P2,T, scaling=constrained, size=[800,500], axes=none);
end proc: 


Examples of use:

L:=[[[0,0],[1,4]],[[1,4],[6,7]],[[6,7],[12,0]],[[12,0],[0,0]]]:
Sol:=Into_4_Equal_Areas(L);
Pic(L, Sol);

# Check (areas of all 4 regions)
Area([[L[1,1],Sol[4],Sol[5],Sol[1],L[1,1]]]),
Area([[Sol[4],Sol[5],Sol[3],L[4,1],Sol[4]]]),
Area([[Sol[5],Sol[2],L[3,1],Sol[3],Sol[5]]]),
Area([[Sol[5],Sol[2],L[1,2],Sol[1],Sol[5]]]);

        


 

L:=[[[1+cos(-t),1+sin(-t)],t=-3*Pi/2..-Pi],[[0,1],[-1,0]],[[cos(t),sin(t)],t=Pi..2*Pi]]:
Sol:=Into_4_Equal_Areas(L);
Pic(L,Sol);

    

# The boundary is the Archimedes spiral and the arc of a circle

L:=[[[t*cos(t),t*sin(t)],t=0..2*Pi],[[Pi+5*cos(-t),sqrt(25-Pi^2)+5*sin(-t)],t=arccos(Pi/5)..Pi-arccos(Pi/5)]]:
Sol:=evalf(Into_4_Equal_Areas(L));
Pic(L,Sol);

     

 

L:=[[[0,0],[2,0]],[[2,0],[1,sqrt(3)]],[[1,sqrt(3)],[0,0]]]:
Sol:=evalf[5](Into_4_Equal_Areas(L, AllSolutions, 0.1)); # All 3 solutions
plots:-display(<Pic(L, Sol[1]) | Pic(L, Sol[2])  | Pic(L, Sol[3])>, size=[300,300]);  


 

L:=[[[-t,-sin(-t)],t=-5*Pi/4..0],[[cos(t),sin(t)-1],t=Pi/2..3*Pi/2],[[t,cos(t)-3],t=0..3*Pi/2],[[3*Pi/2,-3],[5*Pi/4,sqrt(2)/2]]]:
Sol:=evalf(Into_4_Equal_Areas(L));
Pic(L,Sol);

More examples can be found in the attached file.

4_Equal_Area1.mw

[Edit]. The post has been edited. One inaccuracy in the code has been corrected, which could sometimes lead to errors. Two options have been added to the code of Into_4_Equal_Areas procedure. The first option is the formal argument  N . If N=OneSolution  (by default), the procedure returns one solution. If  N=AllSolutions , the procedure returns all solutions that it can find. The  eps  option has also been added (by default, eps=0). It is advisable to use it when we are looking for all solutions, and the ends of the cutting segments fall on the boundaries of intervals (this option slightly expands the boundaries of intervals, otherwise the  fsolve  command sometimes misses solutions). Two new examples have also been added.

 

I've been trying to explore or animate a bode plot without success.  I kept simplifying things until I'm back to a basic example (attached).  I'm assuming there is an issue with trying to explore or animate a function that uses a system object, and am wondering if there is an apoproach that works with such structures.  I'm not a Maple jock by any means.

simple_bode.mw

thanks,

Brian

Hello

I programmed a sequence a(n). Up to a(42) Maple had no problem to calculate the term, but when calculating a(43), after a while appears the message

`System error, `, "bad id"

What does that mean and what can I do?
Thank you.

Using edit -> Find/Replace (or crtl-f) it is possible to earch for text composed of alpha numeric-characters. Maple finds all occurences in input an output.

For greek letters this works only for 1D Math input. Is there a way to find/search for greek symbols displayed on the GUI in 2D Math input and output like lambda in the below

?

First 7 8 9 10 11 12 13 Last Page 9 of 2181