Derivative of an interpol function, what to do with charfun2



Thanks, that is indeed what I needed, but now I'm having another problem: i
can't make substitution of x for a number in e:

k:ratsubst(x,1,g)$
e:ratsubst(y,k,e)$
e(1);

or

y:g;
e(1);

In e(1) there are still several x'es


2013/11/23 Mario Rodriguez <biomates at telefonica.net>

>
> El 23/11/13 17:16, ???????? ?????? escribi?:
>
>  f:log(%e^(-x)+sin(y))$
> y0:1$
> x1:0$
> x2:10$
> n:40$
> s:float((x2-x1)/n);
> results: rk(f,y,y0,[x,x1,x2,s])$
> load(interpol)$
> g:cspline(results)$
>
>
> After claculating g, write
>
> define(
>   e(x),
>   block([terms, cubics, charac],
>     /* 1 */ terms: args(g),
>     /* 2 */ cubics: map(first, terms),
>     /* 3 */ charac: map(second, terms),
>     /* 4 */ (diff(cubics,x) - f).charac) )$
>
>
>
> 1: list of the terms of g
> 2: list with the cubic polynomials
> 3: list of the corresponding charfun2's
> 4: differentiate, subtract f and multiply each residual by the
> corresponding charfun2 call.
>
> Now, you can calculate:
>
> e(5.6);
>
> I think this is what you are asking for. Perhaps you have to make some
> changes to fit your specific needs.
>
>
>
>
> d:diff(g,x);
> e:d-f;
>
> I want to get some values of e between x1 and x2 and output a descrete
> plot of this values. The problem is that when cspline returns function, the
> function includes charfun2() functions, and when I'm trying to get for
> example e(1) diff says that he expects a variable as a second argument, but
> finds a number. After taking diff there shouldn't be any diffs left, but
> they are written before charfun2.
>  e(x,y) is a <a href='
> https://en.wikipedia.org/wiki/Residual_%28numerical_analysis%29'>residual</a>.
>
>   Is it at least possible in maxima?
>
>
> --
> Mario
>



-- 
http://www.poboltaempoteme.forumy.com.ua/

http://www.jedi.forumy.com.ua/