[Date Index]
[Thread Index]
[Author Index]
Programming question: Iterative solution
*To*: mathgroup at smc.vnet.net
*Subject*: [mg22877] Programming question: Iterative solution
*From*: "J.Guillermo Sanchez" <guillerm at gugu.usal.es>
*Date*: Mon, 3 Apr 2000 00:04:08 -0400 (EDT)
*Sender*: owner-wri-mathgroup at wolfram.com
Dear Friend, I have an iterative problem
Given the list:
In[1]:=
list1 = {1.90, 3.625, 5.18, 6.59, 7.87, 9.02, 10.07, 11.01, 11.87, 12.64};
and the equation (besed on trapezoid approximation for an integral)
In[2]:=
f[n_Integer] :=
Simplify[Sum[g[j - 1]*i[n - j + 1] + g[j]*i[n - j], {j, 1, n}] /. g[0] -> 0]
where
In[3]:=
g[n_Integer] := E^(-0.1*n) /; n > 0
I would like find the solution for any i[n]. I have precedured as follow
In[4]:=
sol[n_Integer] := Solve[f[n + 1] == Extract[list1, n + 1] , i[n]]
Now, I can find the solution . E.g.
In[5]:=
sol[0]
Out[5]=
{{i[0] -> 2.09982}}
In[6]:=
sol[1] /. sol[0]
Out[6]=
{{{i[1] -> 1.05312}}}
In[7]:=
sol[2] /. sol[1] /. sol[0]
Out[7]=
{{{{i[2] -> 1.04989}}}}
But I thing is not to good method,
Can any body give me a more elegant solution?. Thanks
Prev by Date:
**AmatureQ: clipping graphics? Small .nb attached**
Next by Date:
**Re: Re: Greek symbols in AxesLabel and PlotLabel**
Previous by thread:
**Re: AmatureQ: clipping graphics? Small .nb attached**
Next by thread:
**Re: Programming question: Iterative solution**
| |