Re: I need some help about this error
- To: mathgroup at smc.vnet.net
- Subject: [mg39325] Re: [mg39305] I need some help about this error
- From: Tomas Garza <tgarza01 at prodigy.net.mx>
- Date: Tue, 11 Feb 2003 04:42:19 -0500 (EST)
- References: <200302100608.BAA23852@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
The problem seems to be that t doesn't have x as an explicit argument. Try the following (which can perhaps be further simplified): In[1]:= f[x_] := x^2 - 2; Ne[x_] := x - f[x]/f'[x]; ap = NestList[Ne, 1.5, 5]; In[2] : = Clear[tang]; tang[h_, x_] : = f[h] + f'[h] (x - h); In[3]:= Plot[Evaluate[Table[tang[ap[[j]]*j, x], {j, 1, Length[ap]}]], {x, -10, 10}, PlotRange -> {{-5, 5}, {-3, 5}}]; Tomas Garza Mexico City ----- Original Message ----- From: "baruch" <spin9 at terra.com.br> To: mathgroup at smc.vnet.net Subject: [mg39325] [mg39305] I need some help about this error > f[x_] := x^2 - 2 > Ne[x_] := x - f[x]/f'[x] > ap = NestList[Ne, 1.5, 5] > tang[h_] := f[h] + f'[h](x - h) > t = tang /@ ap > > Plot[{t}, {x, -10, 10}, AxesOrigin -> {0, 0}, > PlotRange -> {{-5, 5}, {-3, 5}}] > > Now, How can I plot the last command? > > I got the following errors: > > Plot::"plnr": "\!\(te[x]\) is not a machine-size real number at > \!\(x\) = \ > \!\(-9.999999166666667`\)." > Plot::"plnr": "\!\(te[x]\) is not a machine-size real number at > \!\(x\) = \ > \!\(-9.188660168541684`\)." > > I want to make a "program" that will plot the successives tangent > lines of approximations of any function (when possible) using the > Newton Methods... any idea on how can I implement or solve that > problem? > > Thank you very much! > >
- References:
- I need some help about this error
- From: spin9@terra.com.br (baruch)
- I need some help about this error