Andiguys

100 Reputation

5 Badges

1 years, 268 days

MaplePrimes Activity


These are questions asked by Andiguys

Suppose I am plotting a 2D plot and want to highlight the point where two lines intersect. I would like to display this intersection point inside the plot in black font, mark it with an arrow or some visual highlight, and clearly label it. How can I do this?

Additionally, instead of using different colours (blue, green, red) for the lines, I want to distinguish them using different line styles such as solid, dotted, and long-dashed lines. How can I make these changes?

restart

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

 

_local(Pi)

Pi

(1)
 

M_w := b*(((Cr*alpha*((-g*i2+a)*Cr+2*Crm+2*c-2*Pr)*b+((g*i2-a)*Cr-2*Crm-2*c+2*Pr)*alpha-(-g*i2+a)*Cr)*d+alpha*((-g*i2+a)*Cr+2*Crm+2*c-2*Pr)*b+2*g*i2-2*a)*rho0+(2*((Cr*b-1)*d+b))*(delta+Cn-Pr-1))^2*d/(8*(Cr*b*d+b-d)^2*(((Cr*alpha*b-alpha+1)*d+alpha*b)*rho0^2-2*b*d*(delta-1)))

(1/8)*b*(((Cr*alpha*((-g*i2+a)*Cr+2*Crm+2*c-2*Pr)*b+((g*i2-a)*Cr-2*Crm-2*c+2*Pr)*alpha-(-g*i2+a)*Cr)*d+alpha*((-g*i2+a)*Cr+2*Crm+2*c-2*Pr)*b+2*g*i2-2*a)*rho0+(2*(Cr*b-1)*d+2*b)*(delta+Cn-Pr-1))^2*d/((Cr*b*d+b-d)^2*(((Cr*alpha*b-alpha+1)*d+alpha*b)*rho0^2-2*b*d*(delta-1)))

(2)
 

 

M_D := (Cr*rho0*t*(Cr*alpha*b-alpha-1)*d^2+((alpha*((-g*i2+a)*Cr+2*Crm+2*c+3*t-2*Pr)*Cr*b+((g*i2-a)*Cr-2*Crm-2*c-2*t+2*Pr)*alpha+(g*i2-a)*Cr-2*t)*rho0+(2*(Cr*b-1))*(sigma*t+Cn-Pr+delta-1))*d+(alpha*((-g*i2+a)*Cr+2*Crm+2*c+2*t-2*Pr)*b+2*g*i2-2*a)*rho0+2*b*(s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-alpha+1)*d+alpha*b)*rho0^2-16*b*d*(delta-1))*(Cr*b*d+b-d)^2)

(4)
 

``

DATA1 := [delta = .9, a = 0.1e-1, g = .25, c = 0.5e-1, rho0 = .4, Cn = .4, Crm = .1, i2 = 0.6e-1, t = 0.1e-1, alpha = .95, s = 0.1e-1, Pr = .35, upsilon = .95, b = .5, d = .3, Cr = 0.1e-1]

[delta = .9, a = 0.1e-1, g = .25, c = 0.5e-1, rho0 = .4, Cn = .4, Crm = .1, i2 = 0.6e-1, t = 0.1e-1, alpha = .95, s = 0.1e-1, Pr = .35, upsilon = .95, b = .5, d = .3, Cr = 0.1e-1]

(5)

P11 := subs(DATA1, M_w); P21 := subs(DATA1, M_D); P31 := subs(DATA1, M_S)

0.9301486586e-2

 

4.251178959*(-0.4764573140e-1+0.4030e-2*sigma)^2

 

4.251178959*(-0.4917713136e-1+0.4030e-2*sigma)^2

(6)

``

A1 := plot([P11, P21, P31], sigma = 0 .. .7, color = ["Red", "Blue", "Green"], labels = [sigma, `π__m`], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("π"),mi("n"),mn("W"));`, `#msubsup(mi("π"),mi("n"),mn("D"));`, `#msubsup(mi("π"),mi("n"),mn("DS"));`], axis[2] = [color = "#600000"])

 
 

display(A1, pointplot([[X, Y]], symbol = circle, symbolsize = 25, color = blue))

Error, (in plots:-pointplot) points cannot be converted to floating-point values

 
 

NULL

Download Manf_profit__t_graph_changes_needed.mw

I am facing three issues while plotting my plot.I need help modifying the syntax:

  1. I am unable to correctly display superscripts and subscripts for Pi[m]^WD < Pi[m]^D inside the graph region

  2. I cannot format the subscript for i__2 on the x-axis.

  3. A horizontal dotted line appears parallel to the x-axis at y=0.5; how can I remove this line?

    Question_1_regional.mw

Syntax for merging and overlaying all three graphs on a single plot.
Include three sets of iso-profit lines on the same axes:
– Case 1: thin solid lines
– case 2: brown dashed lines
– Case 3: grey semi-dashed lines
Also add vector arrows to show the direction of maximum profit increase.
Combined plot = Plot 1 + Plot 2 +  Plot 3
Attaching sheet:
case_1.mw                  case_2.mw                 Case_3.mw
 

sample graph: 

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("&rho;", 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

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*alpha*d*rho0^2+2*d*delta*rho0-2*Pr*d*rho0+2*alpha*c*rho0^2-0.8e-1*alpha*g*rho0^2-2*a*d*delta+2*c*d^2*delta+2*Cn*d*rho0+0.3e-1*Cr*d^2*rho0^2-Cr*d^2*rho0+0.8e-1*d*delta*g+0.6e-1*d^2+0.3e-1*Cr*alpha*d^2*rho0^2+Cn*Cr*d^2*rho0-Cr*Pr*d^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-0.6e-1*d^2*delta+0.6e-1*d*rho0^2-0.8e-1*d*g-2*d*rho0+2*a*d-2*c*d^2)/(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.4e-1*g+a)-(0.3e-1*(((-a+0.4e-1*g)*Cr-c-(0.6e-1*alpha*d*rho0^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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.4e-1*g+a)-0.3e-1*(((-a+0.4e-1*g)*Cr-c-(1/2)*(-0.8e-1*alpha*g*rho0^2+2*alpha*c*rho0^2+0.8e-1*d*delta*g+2*c*d^2*delta+0.6e-1*alpha*d*rho0^2-2*a*d*delta-Cr*d^2*rho0+0.3e-1*Cr*d^2*rho0^2+2*d*delta*rho0+2*Cn*d*rho0-2*Pr*d*rho0+2*a*d-2*c*d^2-0.6e-1*d^2*delta+0.6e-1*d*rho0^2-0.8e-1*d*g-2*d*rho0+0.6e-1*d^2+0.3e-1*Cr*alpha*d^2*rho0^2+Cn*Cr*d^2*rho0-Cr*Pr*d^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

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