Message Boards Message Boards

Issue with Findroot command

Posted 4 years ago

Hi, I have a problem with the FindRoot command (code attached). I cannot find the solution. Is it because of the functional form I am using (one is the CRRA and the other is the exponential function)? Does anyone know how I can solve this issue? thanks, a.

Attachments:
POSTED BY: Alessandro M.

There is small numerical noise along the imaginary axis, which messes up the plot. Just insert Chop to get rid of it:

qlsol[\[Gamma]_?NumericQ, n_?NumericQ, \[Beta]_?NumericQ, 
   pih_?NumericQ, \[Epsilon]h_?NumericQ, \[Epsilon]l_?
    NumericQ, \[Alpha]_?NumericQ, A_?NumericQ, \[Sigma]_?NumericQ] := 
  Plot[Chop[-((\[Gamma] - \[Beta] n)/(\[Beta] (1 - n))) + 
     pih \[Epsilon]h (\[Sigma] du[
          qhsol1[\[Gamma], n, \[Beta], 
           pih, \[Epsilon]h, \[Epsilon]l, \[Alpha], A, ql], \[Alpha], 
          A] + (1 - \[Sigma]) dg[
          qhhatsol[\[Gamma], n, \[Beta], 
           pih, \[Epsilon]h, \[Epsilon]l, \[Alpha], A, ql], \[Alpha], 
          A]) + (1 - 
        pih) \[Epsilon]l ( \[Sigma] du[ql, \[Alpha], 
          A] + (1 - \[Sigma]) dg[
          qlhatsol[\[Gamma], n, \[Beta], 
           pih, \[Epsilon]h, \[Epsilon]l, \[Alpha], A, ql], \[Alpha], 
          A])], {ql, 10.9, 11.1}];
POSTED BY: Gianluca Gorni
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