Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: newbie alert: FindRoot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49429] Re: newbie alert: FindRoot
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Mon, 19 Jul 2004 07:46:26 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <cdb18e$ahd$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

a _ (underscore) is used by Mathematica to specify
a pattern and you can't use it in variable names

Vt = 49.833666;
Vr = 49.837507;
Pt = 372331487.64643341;
Pr = 5406.0310;
Psit = 1.4213396;
Psir = 2.0724097;
Fdop = 363893.42;

FindRoot[{Vt*Cos[Thetat] - Vr*Cos[Thetar] - Fdop == 0, 
    Pt*Sin[Thetat - Psit] + a == 0, Pr*Sin[Thetar - Psir] + a == 0},
{Thetat, 
    0}, {Thetar, 10}, {a, 100}]

Regards
  Jens


Ralf Schaa wrote:
> 
> Hi Folks,
> 
> I am programming in IDL and I have this set of nonlinear equations,
> which can be solved numerically in IDL with Broyden's method ... so
> far so good.
> Now, when i slightly vary the initial guess the solutions vary hugely.
> 
> Now the question for the community:
> I'd like to check my programming code with mathematica using the
> FindRoot function like this:
> 
> Vt := 49.833666;
> Vr := 49.837507;
> Pt := 372331487.64643341;
> Pr := 5406.0310;
> Psi_t := 1.4213396;
> Psi_r := 2.0724097;
> Fdop := 363893.42;
> 
> FindRoot[
> {Vt*Cos[Theta_t] - Vr*Cos[Theta_r] - Fdop == 0,
> Pt*Sin[Theta_t - Psi_t] + a == 0,
> Pr*Sin[Theta_r - Psi_r] + a == 0},
> {Theta_t, 0}, {Theta_r, 0}, {a, 100}];
> 
> But all I get is something like this:
>  ... "is not a length 3 list of numbers at {Theta_t,Theta_r,a} =
> {0.`,0.`,100.`}."
> 
> So how has this to be done correctly ?
> 
> Thanks in advance!
> -Ralf


  • Prev by Date: Re: Mathlink memory hog
  • Next by Date: Re: using file txt in mathematica
  • Previous by thread: newbie alert: FindRoot
  • Next by thread: AW: Using a Result from NMinimize