Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Question on looping FindRoot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86674] Question on looping FindRoot
  • From: "Alessandro Tavoni" <alessandro.tavoni at unive.it>
  • Date: Tue, 18 Mar 2008 04:48:34 -0500 (EST)

Hello,

this is probably due to my being relatively new to Mathematica,
but I cannot succesfully execute a loop with FindRoot.
when I give the following input (I have converted it to input form):


ClearSystemCache[]
ratio = 1
\[Lambda] = 1.4
k = 1
Overscript[U1, DifR] =
  Table[14 - 6*\[Beta]1, {\[Beta]1, 0, 0.5/ratio, 0.5/ratio/1000}];
Overscript[U1, UifR] =
  Table[4 - 18*\[Alpha]1, {\[Alpha]1, 0, 0.5, 0.0005}];
Overscript[U1, UifL] =
  Table[10 - 2*\[Alpha]1, {\[Alpha]1, 0, 0.5, 0.0005}];
Overscript[U1, DifL] =
  Table[9*(\[Alpha]1 + 1)^0, {\[Alpha]1, 0, 0.5, 0.0005}];
Overscript[U2, LifD] =
  Table[9*(\[Alpha]1 + 1)^0, {\[Alpha]1, 0, 0.5, 0.0005}];
Overscript[U2, RifD] =
  Table[8 - 6*\[Alpha]2, {\[Alpha]2, 0, 0.5, 0.0005}];
Overscript[U2, RifU] =
  Table[22 - 18*\[Beta]2, {\[Beta]2, 0, 0.5/ratio, 0.5/ratio/1000}];
Overscript[U2, LifU] =
  Table[12 - 2*\[Beta]2, {\[Beta]2, 0, 0.5/ratio, 0.5/ratio/1000}];
For[k = 1, k < 5, k++,
 eq1 = Pu == (Exp[\[Lambda]*(Overscript[U1, UifL][[k]]*Ql +
           Overscript[U1, UifR][[k]]*(1 - Ql))]/
              (Exp[\[Lambda]*(Overscript[U1, UifL][[k]]*Ql +
             Overscript[U1, UifR][[k]]*(1 - Ql))] +

         Exp[\[Lambda]*(Overscript[U1, DifL][[k]]*Ql +
             Overscript[U1, DifR][[k]]*(1 - Ql))]))*eq2 =
       Ql == (Exp[\[Lambda]*(Overscript[U2, LifU][[k]]*Pu +
            Overscript[U2, LifD][[k]]*(1 - Pu))]/
                (Exp[\[Lambda]*(Overscript[U2, LifU][[k]]*Pu +
              Overscript[U2, LifD][[k]]*(1 - Pu))] +

          Exp[\[Lambda]*(Overscript[U2, RifU][[k]]*Pu +
              Overscript[U2, RifD][[k]]*(1 - Pu))]))*Prob =
    FindRoot[{eq1, eq2}, {Pu, 0}, {Ql, 0}]*ProbUp[[k ;; All]] =
           %[[1]]*ProbLf[[k ;; All]] = %%[[2]]]


I'm told Symbol::argx: Symbol called with 0 arguments; 1 argument is
expected.
and:                  Set::write: Tag Times in

Thank you so much in advance,

Alessandro
--
Alessandro Tavoni
Ph.D. candidate
Advanced Scool of Economics, University of Venice "C=E0 Foscari"
http://venus.unive.it/alessandro.tavoni


  • Prev by Date: Re: Does Mathematica think Sqrt[2] is rational?
  • Next by Date: Using a logical Or in the function definition
  • Previous by thread: Re: Bug: Derivative[] does not work with functions having slots in
  • Next by thread: Re: Question on looping FindRoot