Code covered by the BSD License  

Highlights from
Chebfun V4

image thumbnail

Chebfun V4



30 Apr 2009 (Updated )

Numerical computation with functions instead of numbers.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

function pass = chebop_ivp
% This tests solves a linear IVP using chebop and checks
% that the computed solution is accurate.

tol = chebfunpref('eps');

d = [-1,1];
x = chebfun(@(x) x,d);
A = chebop(@(u) diff(u)-u,d);
A.lbc = exp(-1)-1;
u = A\(1-x);
pass = norm( u - (exp(x)+x) ) < 100*tol;

Contact us