Re: NSolve and SplineFit
- To: mathgroup at smc.vnet.net
- Subject: [mg44148] Re: NSolve and SplineFit
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 24 Oct 2003 04:24:18 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <bn8eha$niu$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
use FindRoot[] instead of NSolve[] because *Solve[] is almost for
algebraic equations.
Regards
Jens
Mizrandir wrote:
>
> Hello.
>
> I have a list of (x,y) points. They are equally spaced in the x-axis
> so I have decided to use SplineFit in order to have a function I can
> evaluate in whichever intermediate point I like. Up till there
> everything's ok: I can evaluate the function, I can plot it and I can
> even use NIntegrate. Here is more or less what I've done:
>
> In[1]:= <<NumericalMath`SplineFit`
>
> In[2]:= fun=SplineFit[{{4.55},{4.98},{25.42},{73.36},{150.85},{260.07}},Cubic];
>
> In[3]:= fun[2.3]
> Out[3]= {36.863}
>
> In[4]:= NIntegrate[fun[x][[1]],{x,0,5}]
> Out[4]= 376.97
>
> My problem comes when I try to do something like:
>
> NSolve[fun[x] == 50,x] or NSolve[fun[x][[1]] == 50,x]
>
> and Mathematica doesn't allow me to do this.
>
> Any suggestions are welcome, miz.