Message Boards Message Boards

0
|
2359 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Plotting “Findroot” solution with very complex variables?

Posted 3 years ago

I ran into an extremely complex "zero problem" and don't know how to solve and plot it. Can anyone help with this, please? [Pi]s and [Pi]r are objective functions, pd, po, qd, qo, and Phi (0<[Phi]<1) are variables. pd, po, qd, qo are determined to maximize [Pi]s and [Phi] is determined to maximize [Pi]r. This problem needs to be addressed by backward induction. First, I need to solve pd and po. Then I intend to solve qd and qo (with some constraints), but the results are so much complicated and thus I use "Reduce" afterward to select solutions. Last, [Phi] can be obtained by using the above solutions pd, po, qd, and qo. I want to Plot [Phi] when the parameter c is within a certain range, say 0<c<0.1. I tried several times but get no feasible solutions, which is weird. Then how should I do it? I am a beginner so really hope to get some answers.

Thanks a lot! ---- dD:= (pd - po)/(qd - qo) - pd/qd

do := 1 - (pd - po)/(qd - qo)

\[Pi]s := dD (pd - 1/2 (qd*qd) - c) + do (1 - \[Phi]) (po - 1/2 (qo*qo))

\[Pi]r := do (\[Phi]) (po - 1/2 (qo*qo))

s.t.

qo > qd > 0 && 0 < c < pd - 1/2 (qd*qd) && 
1 - (pd - po)/(qd - qo) > 0 && pd/qd - po/qo < 0 && 
0 < \[Phi] < 1, \[Phi]\[Element]Reals

Step 1

FullSimplify[Solve[{D[\[Pi]s, po] == 0, D[\[Pi]s, pd] == 0}, {po, pd}]]

which gives

po -> (qo (2 qo (2 + qo) (-1 + \[Phi]) + qd (-4 + qo (-2 + \[Phi])) (-1 + \[Phi]) + 2 c \[Phi] + qd^2 \[Phi]))/(2 qd (-2 + \[Phi])^2 + 8 qo (-1 + \[Phi])), pd -> (-2 c qd (-2 + \[Phi]) - qd^3 (-2 + \[Phi]) + 4 c qo (-1 + \[Phi]) + 2 qd^2 (-1 + \[Phi]) (-2 + qo + \[Phi]) + qd qo (-1 + \[Phi]) (4 + (-2 + qo) \[Phi]))/(2 qd (-2 + \[Phi])^2 + 8 qo (-1 + \[Phi]))

Step 2

Solve[{D[\[Pi]s, qo] == 0, D[\[Pi]s, qd] == 0}, {qo, qd}]   (*very complex*)

Step 3

Reduce[qo > qd > 0 && 0 < c < pd - 1/2 (qd*qd) && 1 - (pd - po)/(qd - qo) > 0 && pd/qd - po/qo < 0 && 0 < \[Phi] < 1, \[Phi], Reals]         (*also complex*)

Step 4

g[c_?NumericQ] = \[Phi] /. FindRoot[D[\[Pi]r, \[Phi]] == 0, {\[Phi], 0, 0, 1}];
    Assuming[\[Phi] \[Element] Reals, Plot[{g[c]}, {c, 0, 0.1}]]
POSTED BY: qiaoke zhang
Posted 3 years ago

Crossposted here.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract