MaplePrimes Questions

I am trying to plot a contour graph for my problem for (psi) function in the particular boundary, and even though it's working, but the contour  plot is not appearing at the end. Could anyone help me with the code to get proper graph in the specified boundary. 

i have ploted the graph in python i got a plot similar to that i am trying maple but i am not able to plot it. could any one help me to solve.

contour_plots_error_in_wavey_flow.mw

In the current graph, the three curves appear close together and are hard to distinguish because of a scaling issue. How can we adjust the scale so that each line is clearly visible and separate?

restart

L1 := ((3.26592*rho0^2-0.9411e-1*rho0+.3000)/(3.6288*rho0^2+.48)-.35)*(3.000000000-(3.333333333*(3.26592*rho0^2-0.9411e-1*rho0+.3000))/(3.6288*rho0^2+.48))+(.9*(.5+(.6250000000*(-.5126688*rho0^2-.887040*rho0+0.1584e-1))/(1.8144*rho0^2+.24)))*(0.163690476e-1-(.2480158730*(-.5126688*rho0^2-.887040*rho0+0.1584e-1))/(1.8144*rho0^2+.24))+.1408958333+(0.2430555555e-1*(-.5126688*rho0^2-.887040*rho0+0.1584e-1))/(1.8144*rho0^2+.24)+(-(.3149801588*(-.5126688*rho0^2-.887040*rho0+0.1584e-1))/(1.8144*rho0^2+.24)+0.207886905e-1)*(0.163690476e-1-(.2480158730*(-.5126688*rho0^2-.887040*rho0+0.1584e-1))/(1.8144*rho0^2+.24))-0.1000000000e-1*(0.163690476e-1-(.2480158730*(-.5126688*rho0^2-.887040*rho0+0.1584e-1))/(1.8144*rho0^2+.24))^2+(1/2)*(3.000000000-(3.333333333*(3.26592*rho0^2-0.9411e-1*rho0+.3000))/(3.6288*rho0^2+.48))^2-(.1583333333*(3.26592*rho0^2-0.9411e-1*rho0+.3000))/(3.6288*rho0^2+.48)+(.6200396825*(-.339960-(.5000000000*(-.5126688*rho0^2-.887040*rho0+0.1584e-1))/(1.8144*rho0^2+.24)))*(0.163690476e-1-(.2480158730*(-.5126688*rho0^2-.887040*rho0+0.1584e-1))/(1.8144*rho0^2+.24)); L2 := ((3.14725824*rho0^2-.10491*rho0+.284952)/(3.6288*rho0^2+.48)-.32)*(2.891000000-(3.333333333*(3.14725824*rho0^2-.10491*rho0+.284952))/(3.6288*rho0^2+.48))+(.9*(.47+(.6250000000*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1))/(1.8144*rho0^2+.24)))*(0.282738095e-1-(.2480158730*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1))/(1.8144*rho0^2+.24))+.1345516666+(0.2430555555e-1*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1))/(1.8144*rho0^2+.24)+(-(.3149801588*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1))/(1.8144*rho0^2+.24)+0.359077381e-1)*(0.282738095e-1-(.2480158730*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1))/(1.8144*rho0^2+.24))-0.1000000000e-1*(0.282738095e-1-(.2480158730*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1))/(1.8144*rho0^2+.24))^2+(1/2)*(2.891000000-(3.333333333*(3.14725824*rho0^2-.10491*rho0+.284952))/(3.6288*rho0^2+.48))^2-(.1583333333*(3.14725824*rho0^2-.10491*rho0+.284952))/(3.6288*rho0^2+.48)+(.6200396825*(-.364344-(.5000000000*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1))/(1.8144*rho0^2+.24)))*(0.282738095e-1-(.2480158730*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1))/(1.8144*rho0^2+.24)); L3 := ((3.14725824*rho0^2-.105342*rho0+.284952)/(3.6288*rho0^2+.48)-.32)*(2.891000000-(3.333333333*(3.14725824*rho0^2-.105342*rho0+.284952))/(3.6288*rho0^2+.48))+(.9*(.47+(.6250000000*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1))/(1.8144*rho0^2+.24)))*(0.290674603e-1-(.2480158730*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1))/(1.8144*rho0^2+.24))+.1344738889+(0.2430555555e-1*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1))/(1.8144*rho0^2+.24)+(-(.3149801588*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1))/(1.8144*rho0^2+.24)+0.369156746e-1)*(0.290674603e-1-(.2480158730*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1))/(1.8144*rho0^2+.24))-0.1000000000e-1*(0.290674603e-1-(.2480158730*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1))/(1.8144*rho0^2+.24))^2+(1/2)*(2.891000000-(3.333333333*(3.14725824*rho0^2-.105342*rho0+.284952))/(3.6288*rho0^2+.48))^2+(-.1949156746-(.3100198412*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1))/(1.8144*rho0^2+.24))*(0.290674603e-1-(.2480158730*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1))/(1.8144*rho0^2+.24))-(.1583333333*(3.14725824*rho0^2-.105342*rho0+.284952))/(3.6288*rho0^2+.48)

((3.26592*rho0^2-0.9411e-1*rho0+.3000)/(3.6288*rho0^2+.48)-.35)*(3.000000000-3.333333333*(3.26592*rho0^2-0.9411e-1*rho0+.3000)/(3.6288*rho0^2+.48))+.9*(.5+.6250000000*(-.5126688*rho0^2-.887040*rho0+0.1584e-1)/(1.8144*rho0^2+.24))*(0.163690476e-1-.2480158730*(-.5126688*rho0^2-.887040*rho0+0.1584e-1)/(1.8144*rho0^2+.24))+.1408958333+0.2430555555e-1*(-.5126688*rho0^2-.887040*rho0+0.1584e-1)/(1.8144*rho0^2+.24)+(-.3149801588*(-.5126688*rho0^2-.887040*rho0+0.1584e-1)/(1.8144*rho0^2+.24)+0.207886905e-1)*(0.163690476e-1-.2480158730*(-.5126688*rho0^2-.887040*rho0+0.1584e-1)/(1.8144*rho0^2+.24))-0.1000000000e-1*(0.163690476e-1-.2480158730*(-.5126688*rho0^2-.887040*rho0+0.1584e-1)/(1.8144*rho0^2+.24))^2+(1/2)*(3.000000000-3.333333333*(3.26592*rho0^2-0.9411e-1*rho0+.3000)/(3.6288*rho0^2+.48))^2-.1583333333*(3.26592*rho0^2-0.9411e-1*rho0+.3000)/(3.6288*rho0^2+.48)+.6200396825*(-.339960-.5000000000*(-.5126688*rho0^2-.887040*rho0+0.1584e-1)/(1.8144*rho0^2+.24))*(0.163690476e-1-.2480158730*(-.5126688*rho0^2-.887040*rho0+0.1584e-1)/(1.8144*rho0^2+.24))

 

((3.14725824*rho0^2-.10491*rho0+.284952)/(3.6288*rho0^2+.48)-.32)*(2.891000000-3.333333333*(3.14725824*rho0^2-.10491*rho0+.284952)/(3.6288*rho0^2+.48))+.9*(.47+.6250000000*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1)/(1.8144*rho0^2+.24))*(0.282738095e-1-.2480158730*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1)/(1.8144*rho0^2+.24))+.1345516666+0.2430555555e-1*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1)/(1.8144*rho0^2+.24)+(-.3149801588*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1)/(1.8144*rho0^2+.24)+0.359077381e-1)*(0.282738095e-1-.2480158730*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1)/(1.8144*rho0^2+.24))-0.1000000000e-1*(0.282738095e-1-.2480158730*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1)/(1.8144*rho0^2+.24))^2+(1/2)*(2.891000000-3.333333333*(3.14725824*rho0^2-.10491*rho0+.284952)/(3.6288*rho0^2+.48))^2-.1583333333*(3.14725824*rho0^2-.10491*rho0+.284952)/(3.6288*rho0^2+.48)+.6200396825*(-.364344-.5000000000*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1)/(1.8144*rho0^2+.24))*(0.282738095e-1-.2480158730*(-.4981536*rho0^2-.88268544*rho0+0.2736e-1)/(1.8144*rho0^2+.24))

 

((3.14725824*rho0^2-.105342*rho0+.284952)/(3.6288*rho0^2+.48)-.32)*(2.891000000-3.333333333*(3.14725824*rho0^2-.105342*rho0+.284952)/(3.6288*rho0^2+.48))+.9*(.47+.6250000000*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1)/(1.8144*rho0^2+.24))*(0.290674603e-1-.2480158730*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1)/(1.8144*rho0^2+.24))+.1344738889+0.2430555555e-1*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1)/(1.8144*rho0^2+.24)+(-.3149801588*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1)/(1.8144*rho0^2+.24)+0.369156746e-1)*(0.290674603e-1-.2480158730*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1)/(1.8144*rho0^2+.24))-0.1000000000e-1*(0.290674603e-1-.2480158730*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1)/(1.8144*rho0^2+.24))^2+(1/2)*(2.891000000-3.333333333*(3.14725824*rho0^2-.105342*rho0+.284952)/(3.6288*rho0^2+.48))^2+(-.1949156746-.3100198412*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1)/(1.8144*rho0^2+.24))*(0.290674603e-1-.2480158730*(-.49525056*rho0^2-.88268544*rho0+0.28128e-1)/(1.8144*rho0^2+.24))-.1583333333*(3.14725824*rho0^2-.105342*rho0+.284952)/(3.6288*rho0^2+.48)

(1)

G2 := plot([L1, L2, L3], rho0 = 0 .. .8, color = ["#00FF00", "#00BC00", "#008000"], labels = [typeset(Typesetting:-mo("ρ", mathvariant = "bold"), "\n"), typeset("\n", Typesetting:-mo("Retailer profit", mathvariant = "bold", mathcolor = "black"))], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("W"));`, `#msubsup(mi("Pi"),mi("r"),mn("D"));`, `#msubsup(mi("Pi"),mi("r"),mn("S"));`], axis[2] = [color = "#006000"])

 
 

``

Download Q_SEPERATE.mw

is work for some equation but sometime is make problem and again make it problem for me where is problem why the denominator of second equation still remain while i want to remove it i times by denominator but still not worked

in my orginal ode i did change the place diff(V(xi),xi)=Omega(xi) maybe make problem ...or not

like this equation but the equation is different

restart

with(PDEtools)

with(plots)

with(plots):

with(DEtools):

undeclare(prime, quiet)

with(LinearAlgebra)

declare(u(x, t), quiet); declare(U(xi), quiet); declare(V(xi), quiet); declare(Omega(xi), quiet)

ode := -(8*(1/4+k^2*alpha[1]^2+((1/2)*w^2*alpha[2]-k)*alpha[1]))*V(xi)*(diff(Omega(xi), xi))+(4*k^2*alpha[1]^2+1+(2*w^2*alpha[2]-4*k)*alpha[1])*Omega(xi)^2+8*w^2*(-alpha[4]*V(xi)^2+k^2*alpha[1]+(1/2)*w^2*alpha[2]-alpha[3]*V(xi)-k)*alpha[2]*V(xi)^2 = 0

-8*(1/4+k^2*alpha[1]^2+((1/2)*w^2*alpha[2]-k)*alpha[1])*V(xi)*(diff(Omega(xi), xi))+(4*k^2*alpha[1]^2+1+(2*w^2*alpha[2]-4*k)*alpha[1])*Omega(xi)^2+8*w^2*(-alpha[4]*V(xi)^2+k^2*alpha[1]+(1/2)*w^2*alpha[2]-alpha[3]*V(xi)-k)*alpha[2]*V(xi)^2 = 0

(1)

NULL

raw := DEtools[convertsys]({ode}, {}, Omega(xi), xi, s, QP, QP)[1..2];

[[QP[1] = -(1/8)*(-(4*k^2*alpha[1]^2+1+(2*w^2*alpha[2]-4*k)*alpha[1])*s[1]^2-8*w^2*(-alpha[4]*V(xi)^2+k^2*alpha[1]+(1/2)*w^2*alpha[2]-alpha[3]*V(xi)-k)*alpha[2]*V(xi)^2)/((1/4+k^2*alpha[1]^2+((1/2)*w^2*alpha[2]-k)*alpha[1])*V(xi))], [s[1] = Omega(xi)]]

(2)

Extract the denominator and scale the right hand sides by it

den:=denom(eval(QP[2],raw[1]));
raw_eta:=map(q->rhs(q)*den,raw[1]);

1

 

[-(1/8)*(-(4*k^2*alpha[1]^2+1+(2*w^2*alpha[2]-4*k)*alpha[1])*s[1]^2-8*w^2*(-alpha[4]*V(xi)^2+k^2*alpha[1]+(1/2)*w^2*alpha[2]-alpha[3]*V(xi)-k)*alpha[2]*V(xi)^2)/((1/4+k^2*alpha[1]^2+((1/2)*w^2*alpha[2]-k)*alpha[1])*V(xi))]

(3)

Back to the real transformed variables, which are now in terms of eta.

rhs_eta := eval(raw_eta, {s[1] = phi(eta), s[2] = y(eta)})

[2*y(eta)*(4*k^2*alpha[1]^2+2*w^2*alpha[1]*alpha[2]-4*k*alpha[1]+1)*phi(eta), -(1/4)*(-(4*k^2*alpha[1]^2+1+(2*w^2*alpha[2]-4*k)*alpha[1])*y(eta)^2-8*w^2*(-alpha[4]*phi(eta)^2+k^2*alpha[1]+(1/2)*w^2*alpha[2]-alpha[3]*phi(eta)-k)*alpha[2]*phi(eta)^2)*(4*k^2*alpha[1]^2+2*w^2*alpha[1]*alpha[2]-4*k*alpha[1]+1)/(1/4+k^2*alpha[1]^2+((1/2)*w^2*alpha[2]-k)*alpha[1])]

(4)

Find equilibrium points - one is at the origin; the others are a complicated mess.

equilibria := [solve(rhs_eta, {phi(eta), y(eta)}, explicit)]; nops(%)

3

(5)

Eq 9.

de1 := diff(phi(eta), eta) = rhs_eta[1]; de2 := diff(y(eta), eta) = rhs_eta[2]

diff(phi(eta), eta) = 2*y(eta)*(4*k^2*alpha[1]^2+2*w^2*alpha[1]*alpha[2]-4*k*alpha[1]+1)*phi(eta)

 

diff(y(eta), eta) = -(1/4)*(-(4*k^2*alpha[1]^2+1+(2*w^2*alpha[2]-4*k)*alpha[1])*y(eta)^2-8*w^2*(-alpha[4]*phi(eta)^2+k^2*alpha[1]+(1/2)*w^2*alpha[2]-alpha[3]*phi(eta)-k)*alpha[2]*phi(eta)^2)*(4*k^2*alpha[1]^2+2*w^2*alpha[1]*alpha[2]-4*k*alpha[1]+1)/(1/4+k^2*alpha[1]^2+((1/2)*w^2*alpha[2]-k)*alpha[1])

(6)

PDEtools:-ConservedCurrents({de1, de2}, [phi(eta), y(eta)]); P1 := -(1/2)*op(1, rhs(op(%)))

[_J[eta](eta, phi(eta), y(eta)) = f__1((1/3)*(2*w^2*alpha[2]*phi(eta)^4*alpha[4]+3*w^2*alpha[2]*phi(eta)^3*alpha[3]-6*(k^2*alpha[1]+(1/2)*w^2*alpha[2]-k)*alpha[2]*w^2*phi(eta)^2+3*((1/2)*w^2*alpha[1]*alpha[2]+(k*alpha[1]-1/2)^2)*y(eta)^2)/(((1/2)*w^2*alpha[1]*alpha[2]+(k*alpha[1]-1/2)^2)*phi(eta)), (1/2)*3^(1/2)*Intat(1/((-96*(-(1/3)*w^2*alpha[2]*phi(eta)^4*alpha[4]-(1/2)*w^2*alpha[2]*phi(eta)^3*alpha[3]+(k^2*alpha[1]+(1/2)*w^2*alpha[2]-k)*alpha[2]*w^2*phi(eta)^2-_a*(k^2*alpha[1]+(1/2)*w^2*alpha[2]-(1/3)*_a^2*alpha[4]-(1/2)*_a*alpha[3]-k)*w^2*alpha[2]*phi(eta)-(1/2)*((1/2)*w^2*alpha[1]*alpha[2]+(k*alpha[1]-1/2)^2)*y(eta)^2)*_a*((1/2)*w^2*alpha[1]*alpha[2]+(k*alpha[1]-1/2)^2)/phi(eta))^(1/2)*_a), _a = phi(eta))+eta)]

 

-(1/6)*(2*w^2*alpha[2]*phi(eta)^4*alpha[4]+3*w^2*alpha[2]*phi(eta)^3*alpha[3]-6*(k^2*alpha[1]+(1/2)*w^2*alpha[2]-k)*alpha[2]*w^2*phi(eta)^2+3*((1/2)*w^2*alpha[1]*alpha[2]+(k*alpha[1]-1/2)^2)*y(eta)^2)/(((1/2)*w^2*alpha[1]*alpha[2]+(k*alpha[1]-1/2)^2)*phi(eta))

(7)

NULL

Download make_system.mw

in here i have 4 equations and i want to find 4 parameter can anyone say where is problem?

NULL

restart

eq1 := S__1 = sqrt((-beta[1]+sqrt(4*k^2*p*beta[2]+4*w*beta[2]+beta[1]^2))/beta[2]); eq2 := S__2 = (1/2)*sqrt(-(2*(beta[1]+sqrt(4*k^2*p*beta[2]+4*w*beta[2]+beta[1]^2)))/beta[2]); eq3 := S__3 = sqrt(2)*sqrt(chi*(4*chi^2*k^2*p+4*chi^2*w+2*chi*p*beta[1]-p^2*beta[2]))/(4*chi^2); eq4 := T__1 = sqrt(-2*chi*p)/(2*chi); eqs := {eq1, eq2, eq3, eq4}

S__1 = ((-beta[1]+(4*k^2*p*beta[2]+4*w*beta[2]+beta[1]^2)^(1/2))/beta[2])^(1/2)

 

S__2 = (1/2)*(-2*(beta[1]+(4*k^2*p*beta[2]+4*w*beta[2]+beta[1]^2)^(1/2))/beta[2])^(1/2)

 

S__3 = (1/4)*2^(1/2)*(chi*(4*chi^2*k^2*p+4*chi^2*w+2*chi*p*beta[1]-p^2*beta[2]))^(1/2)/chi^2

 

T__1 = (1/2)*(-2*chi*p)^(1/2)/chi

 

{S__1 = ((-beta[1]+(4*k^2*p*beta[2]+4*w*beta[2]+beta[1]^2)^(1/2))/beta[2])^(1/2), S__2 = (1/2)*(-2*(beta[1]+(4*k^2*p*beta[2]+4*w*beta[2]+beta[1]^2)^(1/2))/beta[2])^(1/2), S__3 = (1/4)*2^(1/2)*(chi*(4*chi^2*k^2*p+4*chi^2*w+2*chi*p*beta[1]-p^2*beta[2]))^(1/2)/chi^2, T__1 = (1/2)*(-2*chi*p)^(1/2)/chi}

(1)

indets(eqs)

{S__1, S__2, S__3, T__1, chi, k, p, w, beta[1], beta[2], (chi*(4*chi^2*k^2*p+4*chi^2*w+2*chi*p*beta[1]-p^2*beta[2]))^(1/2), ((-beta[1]+(4*k^2*p*beta[2]+4*w*beta[2]+beta[1]^2)^(1/2))/beta[2])^(1/2), (-2*chi*p)^(1/2), (-2*(beta[1]+(4*k^2*p*beta[2]+4*w*beta[2]+beta[1]^2)^(1/2))/beta[2])^(1/2), (4*k^2*p*beta[2]+4*w*beta[2]+beta[1]^2)^(1/2)}

(2)

We have 4 eqns, so choose 2  variables to solve for

eval(eqs, {S__1 = 1, S__2 = 1, S__3 = 1, T__1 = 1, k = 1, p = 1}); sol := solve(%, {chi, w, beta[1], beta[2]})

{1 = ((-beta[1]+(4*w*beta[2]+beta[1]^2+4*beta[2])^(1/2))/beta[2])^(1/2), 1 = (1/2)*(-2*(beta[1]+(4*w*beta[2]+beta[1]^2+4*beta[2])^(1/2))/beta[2])^(1/2), 1 = (1/2)*(-2*chi)^(1/2)/chi, 1 = (1/4)*2^(1/2)*(chi*(4*chi^2*w+4*chi^2+2*chi*beta[1]-beta[2]))^(1/2)/chi^2}

 

(3)
NULL

Download find-parameter.mw

in this equation i can't do phase portrait and visualization and invistagation of thus point are really not easy which i do a lot substitution for do more simplify but still not work, i want to do phase portrait for thus point but the parameter are too much and each time i have to determine my point which behavior have for each point i have to know the jacobian of them and each time i have to change the parameter to be biger or smaller than zero so i have to replace thus point to be something very easy like A or B  but i don't know how to do that i need an expert to help me , i did my best in file but i can't finished

f2.mw

I'm getting an error while executing the for loop after adding a constraint. Could you please help me identify and fix the syntax issue?

restart

C1 := (Cr*Pr*d*rho0-Cr*d*delta*rho0+Ce*d*delta+Cr*d*rho0-c*d*delta+d*delta*w-delta*g*i2-Ce*d+2*Pr*rho0+a*delta+c*d-d*w-2*delta*rho0+g*i2-a+2*rho0)/(rho0*(Cr*d+2)) <= Pn; C11 := Pn <= (Cr*Pr*d*upsilon-Cr*d*delta*upsilon+Ce*d*delta+Cr*d*upsilon-c*d*delta+d*delta*w-delta*g*i2-Ce*d+2*Pr*upsilon+a*delta+c*d-d*w-2*delta*upsilon+g*i2-a+2*upsilon)/(upsilon*(Cr*d+2))

(Cr*Pr*d*rho0-Cr*d*delta*rho0+Ce*d*delta+Cr*d*rho0-c*d*delta+d*delta*w-delta*g*i2-Ce*d+2*Pr*rho0+a*delta+c*d-d*w-2*delta*rho0+g*i2-a+2*rho0)/(rho0*(Cr*d+2)) <= Pn

 

Pn <= (Cr*Pr*d*upsilon-Cr*d*delta*upsilon+Ce*d*delta+Cr*d*upsilon-c*d*delta+d*delta*w-delta*g*i2-Ce*d+2*Pr*upsilon+a*delta+c*d-d*w-2*delta*upsilon+g*i2-a+2*upsilon)/(upsilon*(Cr*d+2))

(1)

`&Pi;m` := (Pn-Cn)*(1-(Pn-Pr)/(1-delta))+(Pr-w-Crm)*alpha*((((-a+0.4e-1*g)*Cr-c-(0.6e-1*alp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^2*rho0+Cr*d^2*delta*rho0+2*Crm*alpha*d*rho0^2-2*Pr*alpha*d*rho0^2-2*alpha*c*d*rho0^2+Cr*Crm*alpha*d^2*rho0^2-Cr*Pr*alpha*d^2*rho0^2-Cr*alpha*c*d^2*rho0^2+Cr*alpha*c*d*rho0^2-0.4e-1*Cr*alpha*d*g*rho0^2)/(d*(Cr*alpha*d*rho0^2+2*alpha*rho0^2-d*delta+d))+0.3e-1)*d+0.4e-1*g-a)/(Cr*d+2)+0.12e-2*g-0.3e-1*a

(2)

DATA := [delta = .7, a = .2, d = .9, g = .3, c = 0.2e-1, sigma = .5, Cn = .35, Crm = .1, Cr = 0.1e-1, rho0 = .4, Pr = .6, alpha = .9, s = .21, upsilon = .95]

TRC := proc (Pn, w) options operator, arrow; eval(`&Pi;m`, DATA) end proc; C2 := subs(DATA, C1); C22 := subs(DATA, C11)

-.3359880537*Ce+.1119960179*i2-.3359880537*w+.8320557491 <= Pn

 

Pn <= -.1414686542*Ce+0.4715621807e-1*i2-.1414686542*w+.8713918944

(3)

C3 := isolate(C2, w); C33 := isolate(C22, w)

-.3359880537*w <= Pn+.3359880537*Ce-.1119960179*i2-.8320557491

 

w <= 6.159611112-7.068703704*Pn-.9999999999*Ce+.3333333333*i2

(4)

t := {0.3e-1, 0.5e-1, 0.7e-1, 0.9e-1}; ts := {0.4e-1, 0.8e-1, .12}

M := Matrix(nops(t)*nops(ts), 3); rr := 0; for Ce in t do for i2 in ts do C4 := eval(C3, [Ce = t, i2 = ts]); C44 := eval(C33, [Ce = t, i2 = ts]); s := Optimization:-Maximize(TRC(Pn, w), `union`(C4, C44), Pn = 0 .. 1, w = 0 .. 1, assume = nonnegative); stemp := s[1]; Pntemp := s[2][1]; wtemp := s[2][2]; rr := rr+1; M[rr, 1 .. 3] := `<|>`(Ce, i2, stemp); print(Ce, i2, stemp, Pntemp, wtemp) end do end do

Error, invalid input: `union` received -.3359880537*w <= Pn-.8264559482, which is not valid for its 1st argument

 

R := Array(ArrayTools:-Reshape(M,[3,4,3]),datatype=float[8]):

func := Interpolation:-SplineInterpolation([[0.04, 0.08, 0.12],[0.03, 0.05, 0.07, 0.09]],R[..,..,3]):

conts := [seq(min(R[..,..,3])..max(R[..,..,3]),(max(R[..,..,3])-min(R[..,..,3]))/8)];

[HFloat(0.0)]

(5)

``

 

ContoursWithLabels:= proc(

ContoursWithLabels(func(x, y), x = 0.3e-1 .. .15, y = 0.2e-1 .. .1, contours = conts, decplaces = 4, Coloring = [colorstyle = HUE, colorscheme = ["Blue", "Gold"], style = surface], TextOptions = [font = [HELVETICA, BOLD, 9], color = black], GraphicOptions = [thickness = 0], ImplicitplotOptions = [gridrefine = 3], size = [700, 600], labels = [':-C__e', ':-i__2'])

Download Q_Constraint_error.mw

When working with units in Maple, There seem to be a glitch. Can someone explain, where there might be a mistake here: Sorry for the language, but You will hopefully understand.

I have an ode y''(x) + ...=0 that depends on a parameter a and I would like to see how the solutions vary with a. I created a procedure using odeplot to yield a sequence of plots and display them. Not bad but I really need to look more closely. Plotting y for a=7 and overlaying a plot for y=7.1 is too crude. I want to look at y(x,7.1) - y (x,7) or y(x,7.1) /y (x,7) for x=0..3 say. The obvious solution is to compute y(x,7.1) for x=0..3 and save it as a vector and also y(x, 7). How can I do that so that the pointsx at which y(x, 7.1) are the same as the pointsx for which y(x,7) are evaluated. In other words, how can I specify to dsolve the intermediate points xj for which y(x) is calculated? 

I currently have a 3D plot where the axes are Pn​, w, and the objective value (TM1, TM2, TM3 are all positive). I want to convert this into a 2D regional plot with Pn on the x-axis and w on the y-axis. How do I write the syntax for generating such a 2D region plot?

restart

with(Optimization); with(plots); with(LinearAlgebra)

_local(Pi)

Pi

(1)
 

TM1 := (Pn-.35)*(3.000000000-3.333333333*Pn)+.1115859938-.2510684861*w

(Pn-.35)*(3.000000000-3.333333333*Pn)+.1115859938-.2510684861*w

(2)

TM2 := (Pn-.348)*(2.996666666-3.333333333*Pn)+.1017286174-.2299240474*w

(Pn-.348)*(2.996666666-3.333333333*Pn)+.1017286174-.2299240474*w

(3)

TM3 := (Pn-.348)*(2.996666666-3.333333333*Pn)+.1018208882-.2301325952*w

(Pn-.348)*(2.996666666-3.333333333*Pn)+.1018208882-.2301325952*w

(4)

S1 := plot3d(TM1, Pn = 0 .. 1, w = 0 .. 1, orientation = [165, 75, 0], color = "SkyBlue"); S2 := plot3d(TM2, Pn = 0 .. 1, w = 0 .. 1, orientation = [165, 75, 0], color = "Yellow"); S3 := plot3d(TM3, Pn = 0 .. 1, w = 0 .. 1, orientation = [165, 75, 0], color = "Red")

display({S1, S2, S3})

 

``

Download Plot_3D_to_2D.mw

 

Hello Ladies and Genlemen :)

a[1]:=1;

a__1:=1;

is( a[1]=a__1) returns false.

OK ...so [] is a ist ; __ is just a double underscore .

I skim through the docs but nothing interresting for me.

so what are the whys and the wherefores of this difference ?

I must say that i have been using Maple since 1992 ! (Maple V.2)

I *always* used [] for indexing variables.

I  can't remember where/when __ was introduced...I am an old man now :)

Thank you very much and kind regards to all.

Jean-Michel

In the attached document (an excerpt from a larger document) is a call to the interactive plotbuilder.
The call is somewhere hidden in a document block but the document block with the redline is empty. Deleting the document block only moves the red line to another block. 

Executing the entire document (with !!!) starts the plot builder, execution step by step (with !) does not.

How to delete the call to the plotbuilder?

Interactive_plotbuilder.mw

I have this code

restart;
with(geometry);
with(StringTools);
interface(worksheetdir);
currentdir(%);
toX := e -> latex(e, 'output' = 'string');
s := toX(e);
s := StringTools:-Substitute(s, "[", "(");
s := StringTools:-Substitute(s, "]", ")");
s := StringTools:-SubstituteAll(s, ",", ";");
s := StringTools:-SubstituteAll(s, "\\frac", "\\dfrac");
s := StringTools:-SubstituteAll(s, "-\\infty", "#@#");
s := StringTools:-SubstituteAll(%, "\\infty", "+\\infty");
s := StringTools:-SubstituteAll(%, "#@#", "-\\infty");
printf("\\documentclass[12pt]{article}\n");
printf("\\usepackage{amsmath,amssymb}\n");
printf("\\usepackage{enumitem}\n");
printf("\\begin{document}\n\n");
f := x -> (x^2 + 4*x + 7)/(x + 1);
df := simplify(diff(f(x), x));
cuctri := sort([solve(df = 0, x)], key = evalf);
g := simplify(diff(df, x));
xcd := rhs(solve([df = 0, g(x) < 0], x)[1]);
xct := rhs(solve([df = 0, 0 < g(x)], x)[1]);
ycd := simplify(f(xcd));
yct := simplify(f(xct));
mycd := coordinates(point(A, xcd, ycd));
myct := coordinates(point(B, xct, yct));
L := [cat("Let a function be given: $y = ", toX(f(x)), "$."), cat("Its derivative is: $y' = ", toX(df), "$."), cat("The maximum point of the graph  $ ", toX(mycd), "$.")];

printf("\\begin{enumerate}[label=\\arabic*)]\n");
for item in L do
    printf("\\item %s\n", item);
end do;
printf("\\end{enumerate}\n\n");

I got

\documentclass[12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage{enumitem}
\begin{document}

\begin{enumerate}[label=\arabic*)]
\item Let a function be given: $y = \frac{x^{2}+4 x +7}{x +1}$.
\item Its derivative is: $y' = \frac{x^{2}+2 x -3}{\left(x +1\right)^{2}}$.
\item The maximum point of the graph  $ [-3, -2]$.
\end{enumerate}

I want to $ (-3; -2)$, not $ [-3, -2]$. How can I make the function toX apply to the whole document?

I tried

restart;
with(geometry);
with(StringTools);
interface(worksheetdir);
currentdir(%);
toX := proc(e) local s; s := latex(e, 'output' = 'string'); s := Substitute(s, "[", "("); s := Substitute(s, "]", ")"); s := SubstituteAll(s, ",", ";"); s := SubstituteAll(s, "\\frac", "\\dfrac"); s := SubstituteAll(s, "-\\infty", "#@#"); s := SubstituteAll(s, "\\infty", "+\\infty"); s := SubstituteAll(s, "#@#", "-\\infty"); return s; end proc;
printf("\\documentclass[12pt]{article}\n");
printf("\\usepackage{amsmath,amssymb}\n");
printf("\\usepackage{enumitem}\n");
printf("\\begin{document}\n\n");
f := x -> (x^2 + 4*x + 7)/(x + 1);
df := simplify(diff(f(x), x));
cuctri := sort([solve(df = 0, x)], key = evalf);
g := simplify(diff(df, x));
xcd := rhs(solve([df = 0, g(x) < 0], x)[1]);
xct := rhs(solve([df = 0, 0 < g(x)], x)[1]);
ycd := simplify(f(xcd));
yct := simplify(f(xct));
mycd := coordinates(point(A, xcd, ycd));
myct := coordinates(point(B, xct, yct));
L := [cat("Let a function be given: $y = ", toX(f(x)), "$."), cat("Its derivative is: $y' = ", toX(df), "$."), cat("The maximum point of the graph  $ ", toX(mycd), "$.")];
printf("\\begin{enumerate}[label=\\arabic*)]\n");
for item in L do
    printf("\\item %s\n", item);
end do;
printf("\\end{enumerate}\n\n");

and got the 

 

\begin{enumerate}[label=\arabic*)]
\item Let a function be given: $y = \dfrac{x^{2}+4 x +7}{x +1}$.
\item Its derivative is: $y' = \dfrac{x^{2}+2 x -3}{\left(x +1\right)^{2}}$.
\item The maximum point of the graph  $ (-3; -2)$.
\end{enumerate}

 

I would like to combine all the plots into a single figure. The curves S1, S2, and S3 represent the manufacturer’s profit as Ce​ varies, and S12, S22, and S33 represent the retailer’s profit for the same changes in Ce​. I want all of these displayed together in one plot using a dual y-axis: one axis for the manufacturer’s profit and the other for the retailer’s profit, with Ce on the x-axis. How to create such a dual-axis plot with appropriate scaling so that the differences between the curves are also clearly visible.

restart

with(Optimization); with(plots); with(Student[VectorCalculus]); with(LinearAlgebra)

``

_local(Pi)

Pi

(1)

`&Pi;_12` := (0.1455251030e-2*Ce+.5352049476)*(0.369876310e-1-0.3638127575e-2*Ce)+(.8*(-.1671790360+1.121361872*Ce))*(0.1849381518e-1-0.1819063782e-2*Ce)-Ce*(0.1849381518e-1-0.1819063782e-2*Ce)

(0.1455251030e-2*Ce+.5352049476)*(0.369876310e-1-0.3638127575e-2*Ce)+(-.1337432288+.8970894976*Ce)*(0.1849381518e-1-0.1819063782e-2*Ce)-Ce*(0.1849381518e-1-0.1819063782e-2*Ce)

(2)

`&Pi;_22` := (0.1455251030e-2*Ce+.5356096675)*(0.355258312e-1-0.3638127575e-2*Ce)+(.8*(-.1184158360+1.121361872*Ce))*(0.1776291535e-1-0.1819063782e-2*Ce)-Ce*(0.1776291535e-1-0.1819063782e-2*Ce)

(0.1455251030e-2*Ce+.5356096675)*(0.355258312e-1-0.3638127575e-2*Ce)+(-0.9473266880e-1+.8970894976*Ce)*(0.1776291535e-1-0.1819063782e-2*Ce)-Ce*(0.1776291535e-1-0.1819063782e-2*Ce)

(3)

`&Pi;_32` := (0.1455251030e-2*Ce+.5356038465)*(0.355403838e-1-0.3638127575e-2*Ce)+(.8*(-.1179012835+1.121361872*Ce))*(0.1777019161e-1-0.1819063782e-2*Ce)-Ce*(0.1777019161e-1-0.1819063782e-2*Ce)

(0.1455251030e-2*Ce+.5356038465)*(0.355403838e-1-0.3638127575e-2*Ce)+(-0.9432102680e-1+.8970894976*Ce)*(0.1777019161e-1-0.1819063782e-2*Ce)-Ce*(0.1777019161e-1-0.1819063782e-2*Ce)

(4)

S12 := plot(`&Pi;_12`, Ce = 0 .. 0.9e-1, color = [red], labels = ["Ce", "Manufacturer Profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("m"),mn("W"));`]); S22 := plot(`&Pi;_22`, Ce = 0 .. 0.9e-1, color = [green], labels = ["Ce", "Manufacturer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("m"),mn("D"));`]); S32 := plot(`&Pi;_32`, Ce = 0 .. 0.9e-1, color = [blue], labels = ["Ce", "Manufacturer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("m"),mn("S"));`])

 

 

 

`&Pi;_1` := (-0.60726413e-1*Ce+.6173851967)*(0.1849381518e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1849381518e-1-0.1819063782e-2*Ce)^2

(-0.60726413e-1*Ce+.6173851967)*(0.1849381518e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1849381518e-1-0.1819063782e-2*Ce)^2

(5)

`&Pi;_2` := (-0.60726413e-1*Ce+.5929853242)*(0.1776291535e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1776291535e-1-0.1819063782e-2*Ce)^2

(-0.60726413e-1*Ce+.5929853242)*(0.1776291535e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1776291535e-1-0.1819063782e-2*Ce)^2

(6)

`&Pi;_3` := (-0.60726413e-1*Ce+.5932282299)*(0.1777019161e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1777019161e-1-0.1819063782e-2*Ce)^2

(-0.60726413e-1*Ce+.5932282299)*(0.1777019161e-1-0.1819063782e-2*Ce)-0.2500000000e-1*(0.1777019161e-1-0.1819063782e-2*Ce)^2

(7)

S1 := plot(`&Pi;_1`, Ce = 0 .. 0.9e-1, color = [yellow], labels = ["Ce", "Retailer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("W"));`]); S2 := plot(`&Pi;_2`, Ce = 0 .. 0.9e-1, color = [black], labels = ["Ce", "Retailer  profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("D"));`]); S3 := plot(`&Pi;_3`, Ce = 0 .. 0.9e-1, color = [grey], labels = ["Ce", "Retailer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("S"));`])

 

 

 

dualaxisplot(plot(`&Pi;_22`, Ce = 0 .. 0.9e-1, color = ["red"], labels = ["Ce", "Manufacturer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("m"),mn("D"));`]), plot(`&Pi;_2`, Ce = 0 .. 0.9e-1, color = ["green"], labels = ["Ce", "Retailer profit"], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("Pi"),mi("r"),mn("D"));`]), title = "fairnes cost Comparison")

 

display({S1, S12, S2, S22, S3, S32})

 
 

``

Download All_plots_Combined.mw

I am working in Maple 2025:

I executed the following code:

restart:
p:=int(x ** 3 + 2 * x, x);

Maple replied with:

(x^2 + 2)^2/4

I was expecting :

x^4/4+x^2

Did Maple do this integration incorrectly?

Hello! I have a simple system of linear ODEs and I am trying to solve them much like the above link ODEs were solved but I keep getting a pesky problem and no matter what I do, I can't seem to make Maple happy! Could someone take a look & see what I am doing wrong.

Thank you.

Download SimpleMarsEntryAndAeroBrakingModel.mw

2 3 4 5 6 7 8 Last Page 4 of 2443