MathGroup Archive 2007

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

Search the Archive

Re: Solving Nonlinear Equations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80606] Re: Solving Nonlinear Equations
  • From: Peter Pein <petsie at dordos.net>
  • Date: Sun, 26 Aug 2007 23:13:48 -0400 (EDT)
  • References: <fals2t$g7g$1@smc.vnet.net>

Biyana, D. (Dugmore) schrieb:
> I'm using Mathematica V6.0.1 and I have a system of 4 nonlinear equations
> which I'm trying to solve using FindRoot:
>  
> FindRoot[{m1==C-D*Exp[1/(2*B^2)]*Sinh[A/B],
>  
> m2==C^2+(D^2/2)(Exp[2/B^2]Cosh[2A/B]-1)-2C*D*Exp[1/(2B^2)]*Sinh[A/B],
>  
> m3==C^3-3*C^3*D*Exp[1/(2B^2)]*Sinh[A/B],+3*C(D^2/2))*(Exp[2/B^2]Cosh[2A/B]-1
> )+(D^3/4)(3*Exp[1/(2B^2)]Sinh[A/B]-Exp[9/(2B^2)]Sinh[3A/B]),
>  
> m4==C^4-4(C^3)D*Exp[1/(2B^2)]*Sinh[A/B]+3(C*D)^2))*(Exp[2/B^2]Cosh[2A/B]-1)+
> (D^3/4)+C*D^3(3*Exp[1/(2B^2)]Sinh[A/B]-Exp[9/(2B^2)]Sinh[3A/B])+(D^4/8)(Exp[
> 8/(B^2)]*Cosh
> [4A/B]-4*Exp[2/(B^2)]Cosh[2A/B]),{{A,initA},{B,initB},{C,initC},{D,initD}}]
>  
> I get the message " FindRoot::cvmit : Failed to converge to the requested
> accuracy..." which I suspect is a result of initial values of A, B,C, and D.
> What trick can one use to get accepatble initial values?
>  
> MD Biyana 
> 
> ********************
> Nedbank Limited Reg No 1951/000009/06. The following link displays the names of the Nedbank Board of Directors and Company Secretary. [ http://www.nedbank.co.za/terms/DirectorsNedbank.htm ]
> This email is confidential and is intended for the addressee only. The following link will take you to Nedbank's legal notice. [ http://www.nedbank.co.za/terms/EmailDisclaimer.htm ]
> ********************
> 
> 

Hi Biyana,

if I guessed your equations right, there is a simple solution if
m_i=m1^i for i in {2,3,4}:

In[1]:=
expressions = FullSimplify[ExpandAll[TrigToExp[Apply[Subtract,
      original = {m1 == c - d*E^(1/(2*b^2))*Sinh[a/b],
        m2 == c^2 + (1/2)*d^2*(E^(2/b^2)*Cosh[(2*a)/b] - 1) -
          2*c*d*E^(1/(2*b^2))*Sinh[a/b], m3 == c^3 - 3*c^3*d*E^(1/(2*b^2))*
           Sinh[a/b] + (1/2)*(Plus[3])*c*d^2*(E^(2/b^2)*Cosh[(2*a)/b] -
1) +
          (1/4)*d^3*(3*E^(1/(2*b^2))*Sinh[a/b] -
E^(9/(2*b^2))*Sinh[(3*a)/b]),
        m4 == c^4 - 4*c^3*d*E^(1/(2*b^2))*Sinh[a/b] +
          3*(c*d)^2*(E^(2/b^2)*Cosh[(2*a)/b] - 1) + d^3/4 +
          c*d^3*(3*E^(1/(2*b^2))*Sinh[a/b] - E^(9/(2*b^2))*Sinh[(3*a)/b]) +
          (1/8)*d^4*(E^(8/b^2)*Cosh[(4*a)/b] - 4*E^(2/b^2)*Cosh[(2*a)/b])},
      {1}]]]]
Out[1]=
{-c + m1 + d*E^(1/(2*b^2))*Sinh[a/b],
  -c^2 + m2 - (1/2)*d^2*(-1 + E^(2/b^2)*Cosh[(2*a)/b]) +
   2*c*d*E^(1/(2*b^2))*Sinh[a/b],
  ((1/8)*((-d^3)*E^(9/(2*b^2)) - 6*c*d^2*E^((2 + a*b)/b^2) +
     3*d*(-4*c^3 + d^2)*E^((1 + 4*a*b)/(2*b^2)) +
     d^3*E^((3*(3 + 4*a*b))/(2*b^2)) - 6*c*d^2*E^((2 + 5*a*b)/b^2) -
     3*d*(-4*c^3 + d^2)*E^((1 + 8*a*b)/(2*b^2)) -
     4*E^((3*a)/b)*(2*c^3 - 3*c*d^2 - 2*m3)))/E^((3*a)/b),
  ((1/16)*((-d^4)*E^(8/b^2) + 4*d^2*(-6*c^2 + d^2)*E^((2 + 2*a*b)/b^2) -
     8*c*d^3*E^((9 + 2*a*b)/(2*b^2)) + 8*c*d*(-4*c^2 + 3*d^2)*
      E^((1 + 6*a*b)/(2*b^2)) + 4*d^2*(-6*c^2 + d^2)*E^((2 + 6*a*b)/b^2) -
     d^4*E^((8 + 8*a*b)/b^2) + 8*c*d*(4*c^2 - 3*d^2)*E^((1 +
10*a*b)/(2*b^2)) +
     8*c*d^3*E^((9 + 14*a*b)/(2*b^2)) - 4*E^((4*a)/b)*(4*c^4 - 12*c^2*d^2 +
       d^3 - 4*m4)))/E^((4*a)/b)}
In[2]:=
exbinf = FullSimplify[Assuming[a >= 0, Limit[expressions, b -> Infinity]]]
Out[2]=
{-c + m1, -c^2 + m2, -c^3 + m3, -c^4 + (1/8)*d^3*(-2 + 3*d) + m4}
In[3]:=
solbinf = Union[Solve[exbinf == 0 /. Thread[{m2, m3, m4} -> m1^{2, 3, 4}],
    {c, d}]]
Out[3]=
{{c -> m1, d -> 0}, {c -> m1, d -> 2/3}}


I tried this after guessing:

FullSimplify[original /. {a -> 0, d -> 0}]

{c == m1, c^2 == m2, c^3 == m3, c^4 == m4}

HTH,
Peter


  • Prev by Date: Re: BarChart inside a Frame. How to remove Labels from the top of the frame? How to put x-axis label below and not on the side?
  • Next by Date: Re: Fw: BarChart inside a Frame. How to remove Labels from the top of the frame? How to put x-axis label below and not on the side?
  • Previous by thread: FW: Solving Nonlinear Equations
  • Next by thread: the temperamental loop or something wrong with my expression