MathGroup Archive 2005

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

Search the Archive

Re: problem with FindRoot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54272] Re: problem with FindRoot
  • From: qfwfq_0 at yahoo.com (Qfwfq)
  • Date: Wed, 16 Feb 2005 14:35:53 -0500 (EST)
  • References: <cud7jj$2vm$1@smc.vnet.net> <200502100746.CAA16603@smc.vnet.net> <cuhsrm$9jo$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Dear Janos,

I tried NMinimize as you suggested but the results I've obtained are
far away from the corresponding ones with FindRoot. With FindRoot, the
maximum absolute error I obtain for all the equations which is about
10^-7. With NMinimize, the better solution presents an error of about
10^-2. And numerical values of the unknown are very different in both
cases.

Perhaps I don't use NMinimize well, but I feel that given the kind of
equations I need to solve, the solutions from FindRoot are more
adecuate.

Thank you for your help.

Jose

"Janos D. Pinter" <jdpinter at hfx.eastlink.ca> wrote in message news:<cuhsrm$9jo$1 at smc.vnet.net>...
> Jose,
> as I said earlier, try NMinimize.
> 
> 
> 
> 
> At 03:46 AM 2/10/2005, qfwfq wrote:
> >Thanks Mr. Wolf,
> >
> >Your solution works very well. The only problem was Mathematica 5.0
> >does not like your assignment. It said:
> >
> >function::lvset: Local variable specification spec contains expr which
> >is an assignment to var; only assignments to symbols are allowed.
> >
> >But it has been easy to solve it.
> >
> >BTW, and about your last comment
> > >but this won't garantee anything for your solutions.
> >you're right. Sometimes, the solutions Mathematica provides to the
> >simultaneous solution of the set of equations are not correct. This is
> >the reason because my initial guess to FindRoot is {24}. Do you know a
> >better way to solve a set of equations with lots of exponentials. I
> >only know an estimation of where the solutions are.
> >
> >Thnaks again,
> >
> >Jose
> >
> >
> >
> >Wolf, Hartmut wrote:
> > > >-----Original Message-----
> > > >From: qfwfq [mailto:qfwfq_0 at yahoo.com]
To: mathgroup at smc.vnet.net
> > > >Sent: Tuesday, February 08, 2005 11:31 AM
> > > >To: mathgroup at smc.vnet.net
> > > >Subject: [mg54272]   problem with FindRoot
> > > >
> > > >Hi all!
> > > >
> > > >I have four equations (eq1=0, ..., eq4=0) with the the four
> > > >unknowns (y1, y2, y3, y4) in exponentials. I know the interval
> > > >where the solutions are, and I solve this equation set by
> > > >means of FindRoot by obtaining set of solutions. Then, I make
> > > >a selection between the obtained results.
> > > >
> > > >However, I have a dependency between variables: y1<y2<y3<y4
> > > >
> > > >
> > > >mR = Table[FindRoot[{eqn1 == 0, eqn2 == 0, eqn3 == 0, eqn4 ==
> > > >0}, {y1, Random[Real, {a, b}]}, {y2, Random[Real, {a, b}]},
> > > >{y3, Random[Real, {a, b}]}, {y4, Random[Real, {a, b}]}], {24}];
> > > >
> > > >My question is
> > > >
> > > >Is there any way of include the relation between y1, ..., y4
> > > >in the selection of them by Random. Something like {y2,
> > > >Random[Real, {y1, b}]}, {y3, Random[Real, {y2, b}]}, ...
> > > >
> > > >I hope I have clearly explained my problem.
> > > >
> > > >Thanks
> > > >
> > > >
> > >
> > > Would this be what you intended, ordered starting values?
> > >
> > > mR = Table[
> > >       With[{{s1, s2, s3, s4} = Sort[Table[Random[Real, {a, b}],
> >{4}]]},
> > >         FindRoot[{eqn1 == 0, eqn2 == 0, eqn3 == 0, eqn4 == 0}, {y1,
> >s1},
> > > {y2,
> > >             s2}, {y3, s3}, {y4, s4}]], {24}];
> > >
> > > but this won't garantee anything for your solutions.
> > >
> > > --
> > > Hartmut Wolf


  • Prev by Date: Re: Re: Using Select with arrays? (Relative newbie)
  • Next by Date: Re: Simplifying an expression in light of relationships between variables?
  • Previous by thread: Re: Re: problem with FindRoot
  • Next by thread: bugs in Mathematica 5.1