Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: BSpline function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112824] Re: BSpline function
  • From: "David Park" <djmpark at comcast.net>
  • Date: Sat, 2 Oct 2010 05:44:17 -0400 (EDT)

It's a simple root finding problem but unfortunately neither FindRoot or Ted
Ersek's RootSearch routine works well with BSplineFunction if we have to
take the First or Last parts. But there is a simple solution: generate an
InterpolatingFunction for the Last part and then do the root finding.

pts = {{0.3, 0.74152}, {0.4, 0.650256}, {0.5, 0.588225}, {0.6, 
   0.541167}, {0.8, 0.473432}, {1., 0.425661}, {1.022, 
   0.42067}, {1.25, 0.380029}, {1.5, 0.346518}, {2., 
   0.300173}, {2.044, 0.297321}}; f = 
 BSplineFunction[pts, SplineDegree -> 5]; 

g = FunctionInterpolation[Last[f[s]], {s, 0, 1}] 

Needs["Ersek`RootSearch`"] 

RootSearch[g[s] == s, {s, 0, 1}] 

{{s -> 0.446681}} 

Or FindRoot also works well here:

sroot = FindRoot[g[s] == s, {s, 0.5}] 

{s -> 0.446681} 

Last[f[sroot]] == sroot 

True

If I understand the question correctly.


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  





From: eric g [mailto:eric.phys at gmail.com] 


hello Group,
I want to find the parameter of the spline function @ x=.9 in order to 
find the appropriate value of y?
I can eye ball it using Table [{t,f[t]},{t,0,1,.01}] but I would like to 
get it straihgt...
Also I would like to know what is the appropriate Spline-degree I should 
use?
thnks in advance,
Eric

pts={{0.3, 0.74152}, {0.4, 0.650256}, {0.5, 0.588225}, {0.6,
   0.541167}, {0.8, 0.473432}, {1., 0.425661}, {1.022, 0.42067}, {1.25,
    0.380029}, {1.5, 0.346518}, {2., 0.300173}, {2.044, 0.297321}};
f= BSplineFunction[pts,SplineDegree->5];

f[?]={0.9,?}



  • Prev by Date: Re: Plotting feasible region of a linear programme
  • Next by Date: Re: How to unflatten an array ?
  • Previous by thread: Re: BSpline function
  • Next by thread: Re: How to unflatten an array ?