Question: How to calculate Vector[row] y2 using spline fit F(v) with x2?

Hi, 

I was able to determine a cubic spline fit, F(v), to x1 and y1. Now I have vector x2 which I would like to use F(v) to calculate y2 as another Vector[row]. I am having trouble accomplishing this task. Any help is greatly appreciated. Thanks.
 

restart

 x1 := Vector[row]([0.8e-1, .28, .48, .68, .88, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.2]);

 y1 := Vector[row]([-10.081, -10.054, -10.018, -9.982, -9.939, -9.911, -9.861, -9.8, -9.734, -9.659, -9.601, -9.509, -9.4, -9.293, -9.183, -9.057, -8.931, -8.806, -8.676, -8.542, -8.405, -8.265]);

 

m := ArrayTools[Dimensions](x1);

maxx := rhs(m[1]);

 

F := proc (v) options operator, arrow; CurveFitting:-Spline(x1, y1, v, degree = 3) end proc;

 

x2 := Vector[row]([seq(log10(2*10^x1[k]), k = 1 .. maxx)])

 

y2:=?

 

Pts1 := plot(x1, y1, style = point, symbol = diamond, gridlines = true, color = red);

plt_sp := plot(F(v), v = x1[1] .. x1[maxx], color = blue);

plots:-display(Pts1, plt_sp)``

"# How to calculate Vector y2 using spline fit F with x2"? "    x1:=Vector[row]([0.08,0.28,0.48,0.68,0.88,1,1.2,1.4,1.6,1.8,2,2.2,2.4,2.6,2.8,3,3.2,3.4,3.6,3.8,4,4.2]):    y1:=Vector[row]([-10.081,-10.054,-10.018,-9.982,-9.939,-9.911,-9.861,-9.8,-9.734,-9.659,-9.601,-9.509,-9.4,-9.293,-9.183,-9.057,-8.931,-8.806,-8.676,-8.542,-8.405,-8.265]):    m:=ArrayTools[Dimensions](x1):  maxx:=rhs(m[1]):      F:=v->CurveFitting:-Spline(x1,y1, v,degree=3):    x2:=Vector[row]([seq(log10(2*10^(x1[k])),k=1..maxx)]):                   #` PLOT RESULTS`   Pts1:=plot(x1,y1,style=point,symbol = diamond, gridlines=true, color = red):       plt_sp:=plot(F(v),v=x1[1]..x1[maxx],color = blue):     plots:-display(Pts1,plt_sp);     "

 

``

``


 

Download splfit.mw

Please Wait...