#1153 cspline does not work

closed
5
2008-05-16
2007-03-23
Anonymous
No

Maxima version: 5.11.0Maxima build date: 12:25 2/10/2007host type: i686-pc-mingw32lisp-implementation-type: GNU Common Lisp (GCL)lisp-implementation-version: GCL 2.6.8 I am running Vista on a pc and using
wxMaxima

with p:matrix([-1,0.8619948],[-0.5,0.95802009],[0,1.0986123],[0.5,1.2943767])

cspline(p) gives
(%o5) 9.14034523948868*10^-22*(
(71825435496803423232*x^3+215476306490410269696*x^2+407633004344606888418*x+1207048040965873240689)*
charfun2(x,-inf,-0.5)+(-102765973994457923520*x^3+154148960991686885280*x^2+
376969355089246552430*x+1201937400000985205250)*charfun2(x,0,inf)+
(30940538497654500288*x^3+154148960991686885280*x^2+376969273915256356068*x+1201937400000985205250)*
charfun2(x,-0.5,0))
This is a free or natural cubic spline and x^2 terms are supposed to be zero for the infinite range parts and the middle part which is indicated by charfun2(x,-.5,0) is the same as the part corresponding to
charfun2(x,0,inf) is the same except for the x^3 coefficient.

Discussion

  • Robert Dodier

    Robert Dodier - 2007-03-30
    • labels: --> Share Libraries
    • assigned_to: nobody --> riotorto
     
  • Robert Dodier

    Robert Dodier - 2008-05-15

    Logged In: YES
    user_id=501686
    Originator: NO

    I don't understand what is the problem here. When I try this with cspline I get

    foo : (.06565092800000027*x^3+.1969527840000008*x^2
    +.3725906320000009*x+1.103283576)
    *charfun2(x,minf,-0.5)
    +(-.09393164799999938*x^3+.1408974719999991*x^2
    +.3445629760000002*x+1.0986123)
    *charfun2(x,0,inf)
    +(.02828071999999911*x^3+.1408974719999991*x^2+0.344562976*x
    +1.0986123)
    *charfun2(x,-0.5,0)

    and when I plot that via

    draw2d (explicit (foo, x, -2, 1), points ([-1, -0.5, 0, 0.5], [0.8619948, 0.95802009, 1.0986123, 1.2943767]));

    I see the spline is a smooth curve which passes through the points.

    Can someone point out what is wrong here?

     
  • Mario Rodriguez Riotorto

    Logged In: YES
    user_id=1270759
    Originator: NO

    I don't see any problems. The abscissas from the given points range from a=-1 to b=0.5, and according to the definition of natural cubic splines, if p is the interpolation function, the boundary conditions are p''(a)=p''(b)=0; it's easy to check that the result given by cspline fits this restriction.

    I don't understand why "x^2 terms are supposed to be zero".

     
  • Robert Dodier

    Robert Dodier - 2008-05-16

    Logged In: YES
    user_id=501686
    Originator: NO

    Closing this report as "rejected". Mario, thanks for looking at it.

     
  • Robert Dodier

    Robert Dodier - 2008-05-16
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks