Question: Procedure: Maple cannot determine if the procedure is true?

Dear Maple experts, I have written a not-very-complicated Maple procedure, including eval, if, etc. However,

restartNULL

with(plots)

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

NULL

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, prof1F, prof1P, prof2F, prof2P, kappa; option remember; kappa := (beta*(ps-delta*v)*(1-h)+sExp*(1-beta))/(beta^2*((ps-delta*v)*(1-h)-sExp)/(u*(1-alpha))+2*cr); prof1F := (ps-c)*qs+((1/2)*beta^2*qs^2*xi^2/(u*(1-alpha))-(1/2)*(1+beta*xi)^2*qs^2/u)*(ps-s)+h*(ps-delta*v)*(beta*xi*qs-(1/2)*beta^2*qs^2*xi^2/(u*(1-alpha))); prof1P := (ps-c)*qs+((1/2)*beta^2*kappa^2/(u*(1-alpha))-(1/2)*(qs+beta*kappa)^2/u)*(ps-s)+h*(ps-delta*v)*(beta*kappa-(1/2)*beta^2*kappa^2/(u*(1-alpha))); prof2F := (ps-c)*qs-(1/2)*(ps-s)*qs^2/(alpha*u)+h*(ps-delta*v)*(beta*xi*qs-(1/2)*beta^2*qs^2*xi^2/(u*(1-alpha))); prof2P := (ps-c)*qs-(1/2)*(ps-s)*qs^2/(alpha*u)+h*(ps-delta*v)*(beta*kappa-(1/2)*beta^2*kappa^2/(u*(1-alpha))); xi := 1; if alpha <= 1/(1+beta) then p, q := (eval([ps, qs], solve({diff(prof1F, qs) = 0, qs = alpha*u*(v-ps)/(v-s), c < ps, sExp+delta*v < ps}, [ps, qs])[1]))[]; if eval(kappa, [ps = p, prs = p-delta*v]) < q then p, q := (eval([ps, qs], solve({diff(prof1P, qs) = 0, qs = alpha*u*(v-ps)/(v-s), c < ps, sExp+delta*v < ps}, [ps, qs])[1]))[] end if; xi := min(1, (eval(kappa, [ps = p]))/q); FirmpfSiS := eval(prof1F, [ps = p, qs = q]); RecpfSiS := ((1-h)*(p-delta*v)-sExp)*(beta*xi*q-(1/2)*beta^2*xi^2*q^2/(u*(1-alpha)))+sExp*xi*q-cr*xi^2*q^2; 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(prof2F, qs) = 0, qs = alpha*u*(v-ps)/(v-s), c < ps, sExp+delta*v < ps}, [ps, qs])[1]))[]; pr = p-delta*v; if eval(kappa, [ps = p]) < q then p, q := (eval([ps, qs], solve({diff(prof2P, qs) = 0, qs = alpha*u*(v-ps)/(v-s), c < ps, sExp+delta*v < ps}, [ps, qs])[1]))[] end if; kappa := (beta*(p-delta*v)*(1-h)+sExp*(1-beta))/(beta^2*((1-h)*(p-delta*v)-sExp)/(u*(1-alpha))+2*cr); xi := min(1, (eval(kappa, [ps = p]))/q); FirmpfSiS := eval(prof2F, [ps = p, qs = q]); RecpfSiS := ((1-h)*(p-delta*v)-sExp)*(beta*xi*q-(1/2)*beta^2*xi^2*q^2/(u*(1-alpha)))+sExp*xi*q-cr*xi^2*q^2; UnsoldSiS := (1/2)*(1+beta*xi)^2*q^2/u-(1/2)*beta^2*xi^2*q^2/(u*(1-alpha)); EnvironSiS := q+UnsoldSiS end if; return p, q, FirmpfSiS, RecpfSiS, EnvironSiS, UnsoldSiS, UsedSoldPrimary, xi end proc
NULL

NULL

NULLNULL

NULL

FirmModelH(.8, .15, .15, .10)[3]

Error, (in FirmModelH) cannot determine if this expression is true or false: (-0.4957031250e-11*(-0.3155744681e13*xi^2+(0.3966029880e25*xi^4-0.2830096342e26*xi^3+0.4078080001e26*xi^2+0.5006706391e26*xi+0.5289940424e27)^(1/2)+0.1144851064e14*xi+0.7761702136e13)/(63.*xi^2-240.*xi-800.)-0.9750e-2)/(-0.3717773438e-11*(-0.3155744681e13*xi^2+(0.3966029880e25*xi^4-0.2830096342e26*xi^3+0.4078080001e26*xi^2+0.5006706391e26*xi+0.5289940424e27)^(1/2)+0.1144851064e14*xi+0.7761702136e13)/(63.*xi^2-240.*xi-800.)+0.768750000e-2) < (24.89361704*xi^2-102.*xi-720.0000001+0.1250000000e-10*(0.3966029880e25*xi^4-0.2830096342e26*xi^3+0.4078080001e26*xi^2+0.500670...

 

NULL

NULLNULLNULLNULLNULL

``

pltH01A := plot('FirmModelH(alpha, .25, .40, 0)[1]', alpha = 0. .. 1, color = yellow, legend = [SiS(h__0)], labels = [alpha, "New Product Price"], labeldirections = ["horizontal", "vertical"], symbolsize = 10, numpoints = 50, adaptive = false, axes = boxed, thickness = 1.0)

NULLNULLNULL

TH1 := table([seq(h = sprintf("SiS:", h), h = .1 .. .5, .2)])

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

 

pltH1 := plot([seq(WhyNotH1(alpha, h), h = .1 .. .5, .2)], alpha = 0. .. 1, linestyle = [dash, dashdot, longdash], color = [red, green, blue], legend = [seq(typeset(TH1[h], 'h' = h), h = .1 .. .5, .2)], legendstyle = [location = left], labels = [alpha, "New Product Price"], labeldirections = ["horizontal", "vertical"], legendstyle = [location = bottom], thickness = 1.0, adaptive = false, axes = boxed)

 

Download SiS_Quadratic_(goal).mw

it faces an error saying that Maple cannot determine if the procedure is true. Would you please have a look and advise?

Please Wait...