RezaZanjirani

40 Reputation

One Badge

1 years, 256 days

MaplePrimes Activity


These are replies submitted by RezaZanjirani

Dear @Carl Love 

You may ignore my previous messages to save time.

I simplified everything and drew three plots identified by cyan, gray, and yellow: Overlaps.mw

I realized the issue is not linked to 'undefined' points.

The main issue is that I expect no overlap between the three plots (I attached a sample maple file above). Alternatively, I am interested in seeing where PP, FC, and SiS are higher than others. I understand that sometimes 2 out of 3 functions have the same values and are higher than the others. Ideally, this can also be identified.  Again, thank you so much for your time!

@Carl Love 

Sorry to disturb you again.

I have attached a code including a faster/ simpler version of the procedure I wrote in the past.

When I applied your trick at the end of the file, compared with the 'inequal' command, the results were different. Can we push the plot to ignore undefined values or consider them infeasible?

CarlLoveSolution_v3_(linear).mw

Dear @Carl Love 

Thank you so much!

(1) I will check with the Maple company about upgrading the software.

(2) In the past, I would use the 'inequal' command instead of 'implicitplot' to include several inequalities. Please see the attached sample file: Sample-inequality_plot.mw

(3) I added diffrP4, diffrP5, and diffrP6 in your code. Attached: CarlLoveSolution_v2.mw. Then, at the end of the file, I used 'inequal' command to explain the need. It should take very long. I run it to see what happens. 

@Carl Love Thank you so much. This is amazing.

(1) Of course, my Maple is 2021. If I need to upgrade it I will chase it.

(2) While the command plotting those 3 functions in side-by-side plots got an error (attached), the other commands work perfectly. But your plots are more reasonable in terms of appearance, identifying colors, and removing unnecessary meshes.

(3) My perception is that if we want to compare three functions to identify the highest value for defined points, there is no need to use the traditional way below I was using. Right?

Pplt1 := plots:-inequal({DiffrP1(alpha, delta) < 0, DiffrP2(alpha, delta) < 0}, alpha = 0 .. 1, delta = 0 .. 1, color = "blue", grid = [5, 5]);

Pplt2 := plots:-inequal({0 < DiffrP1(alpha, delta), DiffrP3(alpha, delta) < 0}, alpha = 0 .. 1, delta = 0 .. 1, color = "cyan");

Pplt3 := plots:-inequal({0 < DiffrP2(alpha, delta), 0 < DiffrP3(alpha, delta)}, alpha = 0 .. 1, delta = 0 .. 1, color = yellow);

display(Pplt1, Pplt2, Pplt3, textplot([0.2, 0.9, "some text"]), scaling = constrained, view = [0 .. 1, 0 .. 1], labels = [alpha, delta]);

For example, Pplt1, Pplt2, and Pplt3 identify regions where FirmModelH, FirmModelPP, and FirmModelFC are preferred, respectively.

(4) But the traditional approach can consider more than one condition. Right? For example, can we extend your method so that it considers two conditions instead of one? e.g., please assume that there are three regions:

Region PP

FirmModelPP(alpha, 0.2, delta)[3] greater than other two corresponding functions; i.e.,  FirmModelFC(alpha, 0.2, delta)[3] and FirmModelH(alpha, 0.2, delta)[3]

AND

FirmModelPP(alpha, 0.2, delta)[4] greater than other two corresponding functions; i.e.,  FirmModelFC(alpha, 0.2, delta)[4] and FirmModelH(alpha, 0.2, delta)[4]

* The same for FC and H

Thank you so much again!

CarlLoveSolution.mw

@acer 

Thank you so much! That helps a lot. 

@acer 

Sorry to disturb you again. Given the explanations I sent and excluding the importance of run time, would you please advise how the code can be revised to generate an acceptable-quality diagram? Thank you!

@acer 

Thank you so much again!

- We only need to compare those functions that return an actual value. Otherwise, we ignore it. So, the comparison is between the three or two that return value. If only one function returns a value, that’s the preferred one among all three.

- We can accept a very small difference between two functions as an acceptable rounding-up error (e.g., 0.001 or even 0.01 if this helps). So, if two functions are ‘almost’ equal, this is acceptable.

- From the label, I mean a text (e.g., similar to ‘textplot’ we use in usual plots). Alternatively, legend entry is also found if it is easier to identify different regions.

- Implicitplot usually separates regions by specific colors. If we use colors, perhaps we need 6 or 7 different colors representing various situations. Instead of colors, we can also use text to say what each region is.

- I have inadvertently removed option remember from FirmModelPP procedure.

- The most important thing is the plot. Run time does not matter. But since I need to run the code many times to create various plots, if they are run in up to several minutes, that is good enough.

- The edges do not have to be too smooth. For example, sometimes grid=[100,100] can also be enough. The run time and a super-precise plot are not needed. I need to eventually interpret the plot qualitatively saying under what conditions (alpha and delta), what objective is superior.

- Procedures FirmModelPP and FirmModelFC are very easy and quick; I have tested them before. But the procedure FirmModelH takes a bit longer. I have revised it many times; I think this is also good enough, one of the most efficient ones I could generate.

@acer 

Thank you so much.

I re-executed the code in Maple 2021. You are right; it generates a small red triangle, and the text is in a blue space.

I just want to see in which regions one of the functions is superior to the other two. So, the regions can be, for example, FC, PP, and H. Even if there is no color and I can only write a text like FC, PP, and H to lable each region, that is enough.

But theoretically, there can be other regions:

(i) all three functions yield the same value; (e.g., it can be labeled, FC, PP, and H)

(ii) two functions yield the same value, and it's higher than the other one; (e.g., it can be labeled, FC, and H)

(iii) an infeasible region that is not covered by any of the functions (e.g., it can be labeled, ‘infeasible’)

Thanks a million for your time!

@sand15 

I hope you are fine. Sorry to disturb you again. Would you please kindly have a look at the attached maple code? I am using the trick you taught me, but it is too slow to run even for a very small grid number of grid=[5,5]. Is there any way to (i) get a reasonable quality, and (ii) have three legends with its text instead of seven? Thank you!Comparing_three_functions_in_2D_implicit_v1.mwComparing_three_functions_in_2D_implicit_v1.mw

@acer 

Thank you so much.

I could use your code to draw three regions in the attached file.

An issue is that I don't know why a white region is being created (in the last plot with three colors)! However, one of the three objectives must be superior in any of the regions. Right?

Also, a small issue is that the quality of the plot is low. Would you please kindly teach me how I can increase the quality?

All the bests!
 

restartNULL

with(plots); with(RealDomain)

NULL

c := 1; cr := 0.3e-1*c; u := 1; sExp := 0.6e-1*c; s := .65*c; v := 3*cNULL

NULL

FirmModelPP := proc (alpha, beta, delta) local p0, xi0, q0, Firmpf0, G01, Recpf0, Unsold0, Environ0; option remember; xi0 := 1; p0 := min(s+sqrt((v-s)*(c-s)), delta*v+sExp); q0 := u*(v-p0)/(v-s); f(N) := 1/u; F(N) := N/u; G01 := int(F(N), N = 0 .. q0); Firmpf0 := (p0-c)*q0-(p0-s)*G01; Recpf0 := (sExp-cr)*xi0*q0; Unsold0 := G01; Environ0 := q0+Unsold0; return p0, q0, Firmpf0, Recpf0, Environ0, Unsold0 end proc

NULL

NULLNULLNULL

FirmModelFC := proc (alpha, beta, delta) local p00, xi00, q00, Firmpf00, G001, G002, Recpf00, Unsold00, Environ00, pr00; option remember; xi00 := 1; p00 := s+sqrt((v-s)*(c-s)); q00 := alpha*u*(v-p00)/(v-s); f(N) := 1/u; F(N) := N/u; G001 := int(F(N), N = 0 .. q00/alpha); G002 := int(F(N), N = 0 .. beta*xi00*q00/(1-alpha)); pr00 := p00-delta*v; Firmpf00 := (p00-c)*q00-alpha*(p00-s)*G001; Recpf00 := xi00*q00*(sExp-cr)+(pr00-sExp)*(beta*xi00*q00-(1-alpha)*G002); Unsold00 := alpha*G001; Environ00 := q00+Unsold00; return p00, q00, Firmpf00, Recpf00, Environ00, Unsold00 end proc

NULLNULLNULL

NULLNULL

NULL

FirmModelHmax := proc (alpha, beta, delta) local q, p, pr, FirmpfSiS, F1, G1, G2, G3, RecpfSiS, sol, UnsoldSiS, EnvironSiS, p0, OldSoldPrim, xi, h, ps, qs, prs, prof1m, prof2m; option remember; xi := 1; prs := ps-delta*v; prof1m := (ps-c)*qs+((1/2)*beta^2*xi^2*qs^2/(u*(1-alpha))-(1/2)*(1+beta*xi)^2*qs^2/u)*(ps-s)+(prs-sExp)*(beta*xi*qs-(1/2)*beta^2*xi^2*qs^2/(u*(1-alpha))); prof2m := (ps-c)*qs-(1/2)*(ps-s)*qs^2/(alpha*u)+(prs-sExp)*(beta*xi*qs-(1/2)*beta^2*xi^2*qs^2/(u*(1-alpha))); if alpha <= 1/(1+beta*xi) then p, q := (eval([ps, qs], solve({diff(prof1m, qs) = 0, qs = alpha*u*(v-ps)/(v-s), c < ps, sExp+delta*v < ps, qs < 2*u*(1-alpha)/(beta*xi)}, [ps, qs])[1]))[]; `h&Assign;`*(p-delta*v-sExp)/(p-delta*v); FirmpfSiS := eval(prof1m, [ps = p, qs = q, prs = p-delta*v]); RecpfSiS := (sExp-cr)*xi*q; UnsoldSiS := (1/2)*(1+beta*xi)^2*q^2/u-(1/2)*beta^2*xi^2*q^2/(u*(1-alpha)); EnvironSiS := q+UnsoldSiS else p, q := (eval([ps, qs], solve({diff(prof2m, qs) = 0, qs = alpha*u*(v-ps)/(v-s), c < ps, sExp+delta*v < ps, qs < 2*u*(1-alpha)/(beta*xi)}, [ps, qs])[1]))[]; h := (p-delta*v-sExp)/(p-delta*v); FirmpfSiS := eval(prof2m, [ps = p, qs = q, prs = p-delta*v]); RecpfSiS := (sExp-cr)*xi*q; UnsoldSiS := (1/2)*q^2/(alpha*u); EnvironSiS := q+UnsoldSiS end if; return p, q, FirmpfSiS, RecpfSiS, EnvironSiS, UnsoldSiS, h, OldSoldPrim, xi end proc

NULL

NULLNULL

pltPP3A := plot('FirmModelPP(alpha, .25, .40)[3]', alpha = 0. .. 1.0, color = red, legend = "", style = pointline, labels = [alpha, "Firm Profit"], labeldirections = ["horizontal", "vertical"], symbolsize = 10, axes = boxed, symbol = box, numpoints = 10, adaptive = false, thickness = 1.0, view = [0 .. 1, 0 .. .18])

NULL

pltPP3B := plot([[0., eval('FirmModelPP(0., .25, .40)[3]', alpha = 0.)]], color = red, legend = ["PP"], style = point, symbol = box, symbolsize = 10, axes = boxed, view = [0 .. 1, 0 .. .18])

NULL

pltFC3A := plot('FirmModelFC(alpha, .25, .40)[3]', alpha = 0. .. 1, linestyle = [solid], color = black, legend = "FC", labels = [alpha, "Firm Profit"], labeldirections = ["horizontal", "vertical"], axes = boxed, adaptive = false, thickness = .7)

NULL

NULLNULLNULLNULLNULL

pltHmax3A := plot('FirmModelHmax(alpha, .25, .40)[3]', alpha = 0. .. 1.0, linestyle = [dashdot], color = brown, legend = [SiS(h__max)], labels = [alpha, "Firm Profit"], labeldirections = ["horizontal", "vertical"], symbolsize = 10, numpoints = 50, adaptive = false, thickness = 1.0, axes = boxed)

NULL

#H:=plot3d((a,d)->FirmModelHmax(a, 0.25, d)[3]-FirmModelFC(a, 0.25, d)[3],
#       0..1,0..0.5,grid=[49,49],style=surface,orientation=[-90,0,0],lightmodel=none,
#       color=((a,d)->1/3*(1+signum(FirmModelHmax(a, 0.25, d)[3]-FirmModelFC(a, 0.25, d)[3]))),
#       adaptmesh=true
#      );

FMHmax := proc (alpha, delta, lowhigh::(identical("low", "high"))) local res; option remember; if not [alpha, delta]::(list(numeric)) then return 'procname(args)' end if; try res := FirmModelHmax(alpha, .25, delta)[3] catch: res := undefined end try; if res::numeric then res elif lowhigh = "low" then -199 else 199 end if end proc; FMFC := proc (alpha, delta, lowhigh::(identical("low", "high"))) local res; option remember; if not [alpha, delta]::(list(numeric)) then return 'procname(args)' end if; try res := FirmModelFC(alpha, .25, delta)[3] catch: res := undefined end try; if res::numeric then res elif lowhigh = "low" then -199 else 199 end if end proc; FMPP := proc (alpha, delta, lowhigh::(identical("low", "high"))) local res; option remember; if not [alpha, delta]::(list(numeric)) then return 'procname(args)' end if; try res := FirmModelPP(alpha, .25, delta)[3] catch: res := undefined end try; if res::numeric then res elif lowhigh = "low" then -199 else 199 end if end proc

 

 

``

NULL

P5 := plots:-inequal({FMFC(alpha, delta, "high") <= FMHmax(alpha, delta, "low"), FMPP(alpha, delta, "high") <= FMHmax(alpha, delta, "low")}, alpha = 0 .. 1, delta = 0 .. 1, thickness = .5, linestyle = solid, optionsfeasible = [[color = "turquoise"]], labels = [alpha, delta])
NULLNULL

 

NULL

P6 := plots:-inequal({FMHmax(alpha, delta, "high") <= FMFC(alpha, delta, "low"), FMPP(alpha, delta, "high") <= FMFC(alpha, delta, "low")}, alpha = 0 .. 1, delta = 0 .. 1, thickness = .5, linestyle = dash, optionsfeasible = [[color = "yellow"]], labels = [alpha, delta])
NULLNULL

 

NULL

P7 := plots:-inequal({FMFC(alpha, delta, "high") <= FMPP(alpha, delta, "low"), FMHmax(alpha, delta, "high") <= FMPP(alpha, delta, "low")}, alpha = 0 .. 1, delta = 0 .. 1, thickness = .5, linestyle = dot, optionsfeasible = [[color = "cyan"]], labels = [alpha, delta])
NULLNULLNULL

 

display(P5, P6, P7, textplot([.80, .25, "SiS"]), textplot([.50, .25, "FC"]), textplot([.53, .73, "PP,I"]), textplot([.73, .48, "PP,II"]), labels = [alpha, delta])

 

``


 

Download ConflcitInequal_acc_(three_regions).mw

@acer

This is working perfectly. Thank you so much!

Of course, it is very professionally coded, and I need to review it repeatedly to learn it.

I have tiny questions: (i) Can this be extended to plot the three regions (FMFC vs. FMPP vs. FMHmax)? I did it putting to inequalities between {}, but it did not work. (ii) Can I empty regions from color? (iii) I used the grid[ , ] command to get early results before the final high-quality runs, but it did not work. Maybe this should not work.

Thanks a million!

Dear @acer, Thanks a million! You are a genius and more importantly, a very kind and special human being. 

Dear @Carl Love 

Sorry for that. 

I have attached

restartNULL

with(plots); with(RealDomain)

NULL

c := 1; cr := 0.3e-1*c; u := 1; sExp := 0.6e-1*c; s := .65*c

v := 3*c

NULL

`&alpha;__00` := 1/(1+.25)

.8000000000

(1)

`&alpha;__0` := 2/(2+.25*sqrt((c-s)/(v-s)))

.9539797210

(2)

FirmModelPP := proc (alpha, beta, delta) local p0, xi0, q0, Firmpf0, G01, Recpf0, Unsold0, Environ0; xi0 := 1; p0 := min(s+sqrt((v-s)*(c-s)), delta*v+sExp); q0 := u*(v-p0)/(v-s); f(N) := 1/u; F(N) := N/u; G01 := int(F(N), N = 0 .. q0); Firmpf0 := max(0, (p0-c)*q0-(p0-s)*G01); Recpf0 := max(0, (sExp-cr)*xi0*q0); Unsold0 := G01; Environ0 := q0+Unsold0; return p0, q0, Firmpf0, Recpf0, Environ0, Unsold0 end proc

NULL

NULLNULLNULL

FirmModelFC := proc (alpha, beta, delta) local p00, xi00, q00, Firmpf00, G001, G002, Recpf00, Unsold00, Environ00, pr00; option remember; xi00 := 1; p00 := s+sqrt((v-s)*(c-s)); q00 := alpha*u*(v-p00)/(v-s); f(N) := 1/u; F(N) := N/u; G001 := int(F(N), N = 0 .. q00/alpha); G002 := int(F(N), N = 0 .. beta*xi00*q00/(1-alpha)); pr00 := p00-delta*v; Firmpf00 := (p00-c)*q00-alpha*(p00-s)*G001; Recpf00 := max(0, xi00*q00*(sExp-cr)+(pr00-sExp)*(beta*xi00*q00-(1-alpha)*G002)); Unsold00 := alpha*G001; Environ00 := q00+Unsold00; return p00, q00, Firmpf00, Recpf00, Environ00, Unsold00 end proc

NULL

NULLNULL

FirmModelHmax := proc (alpha, beta, delta) local q, p, pr, FirmpfSiS, F1, G1, G2, G3, RecpfSiS, sol, UnsoldSiS, EnvironSiS, p0, OldSoldPrim, xi, h, ps, qs, prs, prof1, prof2; option remember; xi := 1; prs := ps-delta*v; prof1 := qs*(ps-c)+(1/2)*(beta^2*xi^2*qs^2/(1-alpha)-(1+beta*xi)^2*qs^2)*(ps-s)/u+(prs-sExp)*(beta*xi*qs-(1/2)*beta^2*xi^2*qs^2/(u*(1-alpha))); prof2 := qs*(ps-c)-(1/2)*(ps-s)*qs^2/(alpha*u)+(prs-sExp)(beta*xi*qs-(1/2)*beta^2*xi^2*qs^2/(u*(1-alpha))); if alpha <= 1/(1+beta*xi) then p, q := (eval([ps, qs], solve({diff(prof1, qs) = 0, qs = alpha*u*(v-ps)/(v-s), c < ps, sExp+delta*v < ps, qs < 2*u*(1-alpha)/(beta*xi)}, [ps, qs])[1]))[]; G2 := (1/2)*beta^2*xi^2*q^2/(u*(1-alpha)^2); G3 := (1/2)*q^2*(1+beta*xi)^2/u; h := (p-delta*v-sExp)/(p-delta*v); FirmpfSiS := eval(prof1, [ps = p, qs = q, prs = p-delta*v]); RecpfSiS := ((1-h)*(p-delta*v)-sExp)*(beta*xi*q-G2)+sExp*xi*q-cr*xi*q; UnsoldSiS := G3-(1-alpha)*G2; EnvironSiS := q+UnsoldSiS; OldSoldPrim := beta*xi*q-(1-alpha)*G2 else p, q := (eval([ps, qs], solve({diff(prof2, qs) = 0, qs = alpha*u*(v-ps)/(v-s), c < ps, sExp+delta*v < ps, qs < 2*u*(1-alpha)/(beta*xi)}, [ps, qs])[1]))[]; q := alpha*u*(v-p)/(v-s); F1 := beta*xi*q/(u*(1-alpha)); G1 := (1/2)*q^2/(u*alpha^2); G2 := (1/2)*beta^2*xi^2*q^2/(u*(1-alpha)^2); G3 := (1/2)*q^2*(1+beta*xi)^2/u; h := (p-delta*v-sExp)/(p-delta*v); FirmpfSiS := eval(prof2, [ps = p, qs = q, prs = p-delta*v]); RecpfSiS := ((1-h)*(p-delta*v)-sExp)*(beta*xi*q-G2)+sExp*xi*q-cr*xi*q; UnsoldSiS := alpha*G1; EnvironSiS := q+UnsoldSiS; OldSoldPrim := beta*xi*q-(1-alpha)*G2 end if; return p, q, FirmpfSiS, RecpfSiS, EnvironSiS, UnsoldSiS, h, OldSoldPrim, xi end proc

NULLNULL

FirmModelH := proc (alpha, beta, delta, h) local q, p, pr, FirmpfSiS, F1, G1, G2, G3, RecpfSiS, sol, UnsoldSiS, EnvironSiS, p0, UsedSoldPrimary, xi, ps, qs, prs, prof1, prof2; option remember; xi := 1; prs := ps-delta*v; prof1 := (ps-c)*qs+((1/2)*beta^2*xi^2*qs^2/(u*(1-alpha))-(1/2)*(1+beta*xi)^2*qs^2/u)*(ps-s)+h*prs*(beta*xi*qs-(1/2)*beta^2*xi^2*qs^2/(u*(1-alpha))); prof2 := (ps-c)*qs-(1/2)*(ps-s)*qs^2/(alpha*u)+h*prs*(beta*xi*qs-(1/2)*beta^2*xi^2*qs^2/(u*(1-alpha))); if alpha <= 1/(1+beta*xi) then p, q := (eval([ps, qs], solve({diff(prof1, qs) = 0, qs = alpha*u*(v-ps)/(v-s), c < ps, sExp+delta*v < ps, qs < 2*u*(1-alpha)/(beta*xi)}, [ps, qs])[1]))[]; FirmpfSiS := eval(prof1, [ps = p, qs = q, prs = p-delta*v]); RecpfSiS := ((1-h)*(p-delta*v)-sExp)*(beta*xi*q-(1/2)*beta^2*xi^2*q^2/(u*(1-alpha)))+(sExp-cr)*xi*q; UnsoldSiS := (1/2)*(1+beta*xi)^2*q^2/u-(1/2)*beta^2*xi^2*q^2/(u*(1-alpha)); EnvironSiS := q+UnsoldSiS; UsedSoldPrimary := beta*xi*q-(1/2)*beta^2*xi^2*q^2/(u*(1-alpha)) else p, q := (eval([ps, qs], solve({diff(prof2, qs) = 0, qs = alpha*u*(v-ps)/(v-s), c < ps, sExp+delta*v < ps, qs < 2*u*(1-alpha)/(beta*xi)}, [ps, qs])[1]))[]; FirmpfSiS := eval(prof2, [ps = p, qs = q, prs = p-delta*v]); RecpfSiS := ((1-h)*(p-delta*v)-sExp)*(beta*xi*q-(1/2)*beta^2*xi^2*q^2/(u*(1-alpha)))+(sExp-cr)*xi*q; UnsoldSiS := (1/2)*q^2/(alpha*u); EnvironSiS := q+UnsoldSiS; UsedSoldPrimary := beta*xi*q-(1/2)*beta^2*xi^2*q^2/(u*(1-alpha)) end if; return p, q, FirmpfSiS, RecpfSiS, EnvironSiS, UnsoldSiS, UsedSoldPrimary, xi end proc

NULL

NULLNULL

pltPP1A := plot('FirmModelPP(alpha, .25, .2)[1]', alpha = 0. .. 1.0, color = red, legend = "", style = pointline, labels = [alpha, "New Product Price"], labeldirections = ["horizontal", "vertical"], symbolsize = 10, axes = boxed, symbol = box, numpoints = 10, adaptive = false, view = [0 .. 1.01, .6 .. 1.65])

NULL

pltPP1B := plot([[0., eval('FirmModelPP(0., .25, .2)[1]', alpha = 0.)]], color = red, legend = ["PP"], style = point, symbol = box, symbolsize = 10)
NULL

NULL

pltFC1A := plot('FirmModelFC(alpha, .25, .2)[1]', alpha = 0. .. `&alpha;__0`, color = green, legend = "", style = pointline, labels = [alpha, "New Product Price"], labeldirections = ["horizontal", "vertical"], symbolsize = 10, axes = boxed, symbol = solidcircle, numpoints = 10, adaptive = false, view = [0 .. 1.01, .6 .. 1.65])

NULL

pltFC1B := plot([[0., eval('FirmModelFC(alpha, .25, .2)[1]', alpha = 0.)]], color = green, legend = ["FC"], style = point, symbol = solidcircle, symbolsize = 10)

NULLNULLNULLNULL

pltHmax1A := plot('FirmModelHmax(alpha, .25, .2)[1]', alpha = 0. .. `&alpha;__0`, color = blue, legend = [SiS(h__max)], labels = [alpha, "New Product Price"], labeldirections = ["horizontal", "vertical"], symbolsize = 10, numpoints = 10, adaptive = false, view = [0 .. 1.01, .6 .. 1.65])

NULL

NULLNULLNULL

T1 := table([seq(h = sprintf("SiS:", h), h = 0. .. .4, .4)])

WhyNot1 := proc (alpha, h) if not [alpha, h]::(list(numeric)) then return ('procname')(args) end if; FirmModelH(alpha, 0.25, 0.2,h)[1] end proc:

NULL

pltH1 := plot([seq(WhyNot1(alpha, h), h = 0. .. .4, .4)], alpha = 0. .. `&alpha;__0`, linestyle = [dashdot, dash, dot], color = [red, brown, cyan], legend = [seq(typeset(T1[h], 'h' = h), h = 0. .. .4, .4)], legendstyle = [location = left], labels = [alpha, "New Product Price"], labeldirections = ["horizontal", "vertical"], legendstyle = [location = bottom], thickness = 1.0, numpoints = 10, adaptive = false, view = [0 .. 1.01, .6 .. 1.65])
NULL

NULL

NULL

pltVA1 := plot([[`&alpha;__0`, .6], [`&alpha;__0`, 1.65]], linestyle = [dot])

pltVB1 := plot([[`&alpha;__00`, .6], [`&alpha;__00`, 1.65]], linestyle = [dot])

pltVC1 := plot([[.21, .6], [.21, 1.65]], linestyle = [dot])

NULL

pltTxA1 := plots:-textplot([[`&alpha;__0`, .75, 1/(beta*xi+1), color = black]], font = [times, 11], rotation = 'vertical')

pltTxB1 := plots:-textplot([[`&alpha;__00`, .75, 2/(K*beta*xi+2), color = black]], font = [times, 11], rotation = 'vertical')

pltTxC1 := plots:-textplot([[.1, .80, c > p__s, color = black]], font = [times, 11], rotation = 'horizontal')

pltTxD1 := plots:-textplot([[.98, 1.15, "FC and SiS are not applicable", color = black]], font = [times, 12], rotation = 'vertical')
NULL

display([pltPP1A, pltPP1B, pltFC1A, pltFC1B, pltH1, pltHmax1A, pltVA1, pltVB1, pltVC1, pltTxA1, pltTxB1, pltTxC1, pltTxD1])

 
 

 

Download Scenario.mw

the file. Please let me know if this one works.

Dear @Carl Love and @acer

Thank you so much.

I could run your codes/ files. But it does not work on my

Download Scenario_2_hmax_&_Fxed_h_v12_-_Alpha_H_(v5)_B020.mw

own code (attached). Ideally, I need to use the index as $p_s<c$. Would you please look at the plot lines where we have p<c? 

@Carl Love Thank you so much! 

1 2 3 Page 1 of 3