       Re: Recursive FindRoot with initial values as a list

• To: mathgroup at smc.vnet.net
• Subject: [mg77031] Re: [mg77023] Recursive FindRoot with initial values as a list
• From: DrMajorBob <drmajorbob at bigfoot.com>
• Date: Fri, 1 Jun 2007 02:40:42 -0400 (EDT)
• References: <2191662.1180607342761.JavaMail.root@m35>
• Reply-to: drmajorbob at bigfoot.com

```f[a_, b_] = Integrate[Sin[x] + 3, {x, a, b}]

-3 a + 3 b + Cos[a] - Cos[b]

s1 = FindRoot[{f[a, b] == 2, f[0, b] == 0}, {{a, 0}, {b, 0}}]

{a -> -0.757908, b -> 0.}

x1 = a /. s1

-0.757908

Bobby

On Thu, 31 May 2007 04:32:58 -0500, R.G <gobiithasan at yahoo.com.my> wrote=
:

> Greetings...
> Say I have a function defined as:
> f[a_, b_]:= Integrate[Sin[x] + 3, {x, a, b}]
>
> I can find b with given f[a,b]=2 and initial value=0:
> In:= Initialvalue = 0;
>      s1 = FindRoot[f[0, unknown] == 2, {unknown,Initialvalue}];
>      x1 = s1[[ 1, 2]]
>
> Now, using the x1 value obtained from FindRoot, I can find x2:
>      s2 = FindRoot[f[x1, unknown] == 2, {unknown,Initialvalue}];=

>      x2 = s2[[ 1, 2]]
>
> If I have initialvalue in a list form:
> InitialValues={initialvalue1,initialvalue2,...,initialvalueN}
>
> in which each si should get InitialValues[[i]], in general form:
>
> \!\(s\_i =
>     FindRoot[{f[x\_\(i - 1\), unknown] \[Equal] 2}, {unknown,
>         InitialValues[\([i]\)]}]\)
>
> where
>
> \!\(x\_i = s\_i[\([1, 2]\)]\)
>
> How do I code it in Mathematica please? Thanking in advance...
>
> ~R.G
>
>
> Send instant messages to your online friends  =

> http://uk.messenger.yahoo.com
>
>
>

-- =

DrMajorBob at bigfoot.com

```

• Prev by Date: Re: Recursive FindRoot with initial values as a list
• Next by Date: Re: Recursive FindRoot with initial values as a list
• Previous by thread: Re: Recursive FindRoot with initial values as a list
• Next by thread: Re: Recursive FindRoot with initial values as a list