- You will see updates in your activity feed
- You may receive emails, depending on your notification preferences

version 4.2.0.0 (4.39 MB) by
Chebfun Team

Numerical computation with functions

4.8

9 Downloads

Updated 29 Oct 2015

4.2.0.0 | Updated October 29, 2015. |
||

1.20.0.0 | Announce V5 release. |
||

1.19.0.0 | Removing V5 notification. Didn't expect the change to happen instantly.. |
||

1.18.0.0 | Rename this as V4. V5 will be released on FileExchange (via GitHub) very soon. |
||

1.17.0.0 | Updated to v4.2.2194. Release notes at www.chebfun.org/notes/ |
||

1.16.0.0 | The .zip file didn't seem to have been updated in the previous resubmission. |
||

1.15.0.0 | Updated to most recent software release (V4.1). |
||

1.10.0.0 | Updated information on new release. |
||

1.9.0.0 | Added version number to title and some minor changes to the description. |
||

1.8.0.0 | Updated license information |
||

1.7.0.0 | Summary corrected. |
||

1.5.0.0 | New chebfun release v. 2.0501. Release notes can be found at http://web.comlab.ox.ac.uk/projects/chebfun/notes_V2_0501.html |
||

1.4.0.0 | Changed the screenshot of the logo. |
||

1.0.0.0 |

**Editor's Note:** This file was selected as MATLAB Central Pick of the Week

Old version of Chebfun. To download latest version see www.chebfun.org, www.github.com/chebfun, or the Matlab File Exchange www.mathworks.com/matlabcentral/fileexchange.

Chebfun Team (2021). Chebfun V4 - old version; please download current version instead (https://www.mathworks.com/matlabcentral/fileexchange/23972-chebfun-v4-old-version-please-download-current-version-instead), MATLAB Central File Exchange. Retrieved .

Created with
R2012a

Compatible with any release

**Inspired:**
Gauss quadrature nodes and weights., Chebpack, Dynamical System Viewer, Chebfun - current version

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!Create scripts with code, output, and formatted text in a single executable document.

- ATAPformats.m
- bary(x,gvals,xk,ek)
- barymat(M,N,map,w)
- bary_weights(xk)
- blowup(on_off)
- chebbench(varargin)
- chebfunpref(varargin)
- chebguiedit(varargin)
- chebguiwindow(varargin)
- cheblogo
- cheboppref(varargin)
- chebpoly(n,d,kind)
- chebpolyval(c,kind)
- chebpts(n,d,kind)
- chebsnake(nodes,alpha)
- chebtest(dirname)
- Contents.m
- cumsummat(N)
- diffmat(N,k)
- fov(A)
- hermpoly(n,type)
- hermpts(n,varargin)
- jacpoly(N,a,b,d,flag)
- jacpts(n,alpha,beta,varargin)
- lagpoly(n)
- lagpts(n,int,meth)
- lebesgue(x,varargin)
- legpoly(n,d,normalize,method)
- legpts(n,int,meth)
- mappref(varargin)
- maps(varargin)
- pdeset(varargin)
- ratinterp( f , varargin )
- resampling(on_off)
- scribble.m
- sing(str,bpm)
- splitting(on_off)

- airy_extrema
- besseljextrema
- besseljroots
- cftest
- chebpadetest
- complexrotation
- convspline
- cumsumunbnd
- cumsum_fracexps
- cumsum_infint
- cumsum_oscillate
- diffexp
- diffinf
- difforder
- diffsingmaps
- diffsingmaps
- diff_matrices
- elementary
- ellipjtest
- exps_cumsum
- exps_diff
- exps_sum
- extracting_roots
- falknerskan
- fovtest
- fraccalctest
- fzerotest
- grammatrix
- interp1test
- inverseq
- invtest
- jacptstest
- lebesguetest
- legptstest
- mapends_nan_inf
- matrixnorms
- maxdegree
- maxdoubleroots
- maxtest
- max_and_imps
- max_min
- max_min_unbnd
- mfun_integrate
- misclnttests1
- nanavoidance
- normtests
- pointevals
- polyfittest
- polytest
- quadtest
- ratinterptest
- remeztest
- resampletest
- residuetest
- restrictimps
- restrictscl
- scale
- scaleinvariance
- scaleinvariance2
- scribbleio
- scribbles
- sinx
- splittingtest
- sqrt_test
- suminftest
- sumtest
- test_ratinterp
- unbndpolys
- unboundednorms

- aliasing
- arithtest
- barytest
- blowup_exps
- blowup_scale
- blowup_splitting
- booltest
- breakpoints
- callpref
- chebdomain
- chebfunpreftest
- chebpolytest
- composetest
- ctortest
- evalcomplex
- exact_endpoints
- exps_ctor
- findexps_test
- funscale
- guide2tests
- infimps
- isequaltest
- mappreftest
- minsamples_adapt
- pole_construct
- restrict_roots
- rootspol
- smallintervals
- std_test
- stringinput
- sumcos20x
- vectornorms
- webexamples

- chebop_bc
- chebop_bc2
- chebop_cumsum
- chebop_diff
- chebop_different_syntaxes
- chebop_eigs
- chebop_ellipjode
- chebop_expm
- chebop_feval
- chebop_fitbcs
- chebop_gmrestest
- chebop_intops
- chebop_ivp
- chebop_linop
- chebop_polyeigs
- chebop_pwintops
- chebop_pwlinear
- chebop_scalingtest
- chebop_simplify
- chebop_svds
- chebop_systemeig
- chebop_systemexpm
- chebop_systemsolve1
- chebop_systemsolve2
- chebop_v4tests
- chebop_vs_linop
- paramODE

- linopzerotest
- linop_bcchange
- linop_diag
- linop_eye
- linop_feval_lr
- linop_functionals
- linop_operarith
- linop_systemapply

- bvp45ctest
- circplate
- ivp_test
- ivp_testcomplex
- ivp_ty_test
- lexerParserTest
- mathieu
- orrsommerfeld
- schrodinger_sqwell

- A greedy algorithm for choosing interpolation points
- A wiggly function and its best approximations
- Absolute value approximations by rationals
- Best approximation with the Remez command
- Chebyshev Coefficients
- Chebyshev interpolation of oscillatory entire functions
- Chebyshev polynomials as plotted by Higham and Higham
- Convergence rates for interpolating functions
- Halphen's constant for approximation of exp(x)
- Lebesgue functions and Lebesgue constants
- Local complexity of a function
- Orthogonal polynomials via the Gram-Schmidt process
- Orthogonal polynomials via the Lanczos process
- Polynomial basis for Hermite interpolation
- Rational interpolation, robust and non-robust
- The FFT in Chebfun
- The gamma function and its poles

- A keyhole contour integral
- ANGLE, UNWRAP, and branches of complex chebfuns
- Schwarz-Christoffel toolbox and Chebfun

- Approximation of piecewise linear functions ( chebsnake!)
- Birthday cards and analytic functions
- Can one hear the shape of a chebfun?
- Happy Valentines Day!
- MathJax Introduction
- Merry Christmas!
- Writing a message in 3D

- An ellipse rolling around another ellipse
- Area and centroid of a 2D region
- Bouncing photon, Sinai billiards
- Dual points, lines, polygons and curves
- Lissajous curves
- Perimeter of an ellipse
- Procrustes shape analysis

- Abscissa of the linearized Vlasov-Poisson operator
- Eigenvalues of the Fox-Li integral operator
- Fractional calculus in Chebfun
- Wikipedia integro-differential equation example

- Condition numbers of various bases
- Eigenvalue level repulsion
- Field of values and numerical abscissa
- Nonnormality quiz from Trefethen and Embree
- Resolvent norm on the imaginary axis
- Transient Growth

- Double-well Schrödinger eigenstates
- Eigenstates of the Schroedinger equation
- Frequencies of a drum
- Model of a quantum dot array for solar energy
- Orr-Sommerfeld eigenvalues
- Polynomial eigenproblems with differential operators
- Stability of a thermoelastic rod
- The Nullspace of Linear Operators
- Wave equation with decay band

- A parameter dependent ODE with breakpoints
- A periodic ODE system
- Advection-diffusion equation with a jump
- An Allen-Cahn equation with continuation
- Automatic differentiation in Chebfun
- Blowup equation (Frank-Kamenetskii)
- Boundary layer for advection-diffusion equation
- Carrier equation
- Computing The Complex Singularities Of The Three Body Problem
- Exact solutions of some ODEs
- Half-wave rectifier
- Jump Conditions in BVPS
- Lane-Emden equation from astrophysics
- Linear EXP initial-value problem
- Linear sine/cosine initial-value problem
- Matched asymptotics and boundary layers
- Multiple BVP solutions by solving an IVP
- Nonlinear ODE modeling solar magnetic fields
- Nonstandard 'Boundary' Conditions
- Orbiting around fixed stars
- Parameter-dependent ODEs: Three examples
- Piecewise Operators Demo
- Stability Regions of ODE Formulas
- System of two nonlinear BVPs
- Time independent Black-Scholes with jumps
- Time-independent Schrödinger eqn reflection coefficients
- Wikipedia ODE examples

- Extrema of a complicated function
- Optimization of a parameterised integral
- The Dixon-Szego function in 2D optimisation
- The Rosenbrock function in 2D optimisation

- Coupled system of reaction-diffusion equations
- Heat equation via EXPM
- Maxwell's equations
- Singular Value Decomposition of Compact Operators: A Tool for Computing Frequency Responses of PDEs
- Time-dependent integro-differential equation

- Battery test of Chebfun as an integrator
- Gauss and Clenshaw-Curtis quadrature
- Gauss quadrature nodes and weights
- Gravitational force between two cubes
- Spike integral

- Complex roots near the real axis
- Roots of a Bessel function
- Roots of a complex function via Cauchy integrals
- Roots of a secular equation with poles
- Roots of random polynomials
- The Mystery of Bernoulli Polynomials
- The white curves of Ortiz and Rivlin

- Generalized Polynomial Chaos
- Histogram from function or data
- Least-squares data fitting and POLYFIT
- Mercer's theorem and the Karhunen-Loeve expansion
- Resampling of random variables
- Simple computations with probability distributions
- Stochastic collocation for Burgers' equation

- CHEBFUN GUIDE 10: NONLINEAR ODES AND CHEBGUI
- CHEBFUN GUIDE 1: GETTING STARTED WITH CHEBFUN
- CHEBFUN GUIDE 2: INTEGRATION AND DIFFERENTIATION
- CHEBFUN GUIDE 3: ROOTFINDING AND MINIMA AND MAXIMA
- CHEBFUN GUIDE 4: CHEBFUN AND APPROXIMATION THEORY
- CHEBFUN GUIDE 5: COMPLEX CHEBFUNS
- CHEBFUN GUIDE 6: QUASIMATRICES AND LEAST-SQUARES
- CHEBFUN GUIDE 7: LINEAR DIFFERENTIAL OPERATORS AND EQUATIONS
- CHEBFUN GUIDE 8: CHEBFUN PREFERENCES
- CHEBFUN GUIDE 9: INFINITE INTERVALS, INFINITE FUNCTION VALUES, AND SINGULARITIES
- CHEBFUN GUIDE: INDEX

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Select web siteYou can also select a web site from the following list:

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

- América Latina (Español)
- Canada (English)
- United States (English)

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)

MD SHAHNAWAZ HUSSAINStuart McGarrityThe .m file link in the example does not work: "(Chebfun example geom/Ellipse.m)"

MD. SHAHNEWAZ MASUDA. GowrisankarHi,

I have use R2013a version. I'm try to find the fractional integral of the given function, but I have the struggle.

code:

x = chebfun('x',[0 1]); u = [];

for k = 1:10;

u = [ u cumsum(x.^k,0.5)];

plot(u,LW,lw), drawnow, hold on

end

title('Half-integrals of x^k for k = 1, ...,

Error:

Error using chebfun/cumsum (line 41)

Fractional antiderivatives not yet implemented.10',FS,fs)

xlabel('x',FS,fs);

I would be happy if you can address this issue with a solution. Thanks in advance.

Nick HaleHi Mehedi

I suggest you download the new version of Chebfun from here:

http://www.mathworks.com/matlabcentral/fileexchange/47023-chebfun

Regards

Nick

MehediHello,

Great stuff! However, on 'guide - 7' this code segment does not work and gives the following error --

code :

L = chebop(@(x,u) diff(u,2),[0,pi]);

L.bc = 0;

[V,D] = eigs(L);

diag(D)

clf, plot(V(:,1:4))

error:

Error using horzcat

Dimensions of matrices being concatenated are not consistent.

Error in chebop/linearise (line 133)

dom = unique([dom domL domR domO]);

Error in chebop/linop (line 18)

[L bc isLin] = linearise(N,[],linCheck);

Error in chebop/eigs (line 44)

L = linop(N);

I would be happy if you can address this issue with a solution. Thanks in advance.

BR

Mehedi

Nick HaleHi Jeff

Sorry for the delay in replying. In your first problem, you haven't quite the boundary condition syntax correct. The following should work:

L = chebop(@(x,u) diff(u,4), [0,1]);

B = chebop(@(x,u) sin(x) + 0*u, [0,1]);

L.lbc = @(u) [diff(u,2), diff(u,3)];

L.rbc = @(u) [diff(u,2), diff(u,3)];

The y''''(x)=lambda*f(x)*y(x) problem should be possible also. Try something like the following, where sin is replaced by the m-file you wish to use to construct f:

f = chebfun(@sin, [0, 1]);

[V, D] = eigs(L, diag(f), 4);

Regards

Nick

P.S. Emailing discuss@chebfun.org or help@chebfun.org should result in speedier replies! :)

Peter GreenAnother question: I want to solve the eigenvalues and eigenfunctions of the following equation

y''''(x)=lambda*f(x)*y(x)

Here f(x) is a function defined in a seperate .m file. Is it possible to use chebfun to solve the eigenvalues and eigenfunctions?

Thanks.

Jeff

Peter GreenAn excellent software!!! Definitely 5 star.

A quick question. I am using the chebfun function to find the eigenvalues and eigenfunctions of the following boundary value problem

D^4 y=lambda*y, y''(0)=y'''(0)=y''(1)=y'''(1)=0,

where D is the differential operator, lambda is the eigenvalue and the solution y is the corresponding eigenfunction.

I used the following code in chebfun:

L = chebop(@(x,u) diff(u,4), [0,1]);

L.lbc = @(u) diff(u,2);

L.lbc =@(u) diff(u,3);

L.rbc = @(u) diff(u,2);

L.rbc =@(u) diff(u,3);

[V,D] = eigs(L,trunc);

disp(diag(D)), toc

HOWEVER, the below error was reported

Error using eig

Matrix must be square.

Error in linop/eigs>bc_eig (line 288)

[V,D] = eig(full(Amat),full(Pmat));

Error in linop/eigs (line 94)

[V1,D1] = bc_eig(A,B,33,33,0,map,breaks);

Error in chebop/eigs (line 57)

[varargout{1:nargout}] = eigs(L,varargin{:});

Looks like I am on the right track but some nonsquare matrix caused that error. Sincerely appreciate your comments and suggestions.

Thanks.

Jeff

RaghuramShashankPerfect toolbox for somebody doing numerical analysis for the first time!

Mark ShoreThere is just so much to learn from this topnotch collection of powerful routines.

Mark ShoreThere is just so much to learn from this topnotch collection of powerful routines.

Mark ShoreChebfun TeamHi Jiro,

Thanks! We're currently in the process of moving to the new OOP system in our development release, which you can find on our website: http://www.maths.ox.ac.uk/chebfun/

jiroI really like the comprehensive User's Guide that you include with this package.

Do you have a plan to implement this using the new MATLAB Class system?

Erdal BizkevelciSiyi Dengthis toolbox is awesome.

Erdal BizkevelciJohn D'ErricoThanks Tobin - that was what i was looking for. Those files are very readable, clearly explaining what a chebfun is and how to use them. I'll now call this a complete package.

I've had the time to do a little more perusal of these tools now too. They work on my Mac, which is sometimes an issue.

Toby DriscollThe guide directory included in the package has 8 published scripts that contain dozens of examples in tutorial style. The resulting HTML files are also installed in the Help Browser under the "Chebfun Toolbox" heading.

John D'ErricoI've not tried this out, nor tested it yet. That will take some time. But what I've seen suggests this will be interesting and potentially useful. A lot of effort has been invested here in these tools.

The only thing I'd have liked to see is a published set of demos, with more explanation around how to use it and what the demos are showing. There is a directory (chebtests) of some tests of the tools, but they have virtually no comments in them. Derek has a good suggestion, to read the paper by Trefethen. Here are a few links of interest:

http://www.comlab.ox.ac.uk/nick.trefethen/trefethen_functions.pdf

http://www.comlab.ox.ac.uk/nick.trefethen/ppt_revised.pdf

http://www.comlab.ox.ac.uk/chebfun/publications/driscoll_born_tref.pdf

The papers shown are quite readable. I'd highly recommend them.

My only source of dissatisfaction here is with a lack of examples. These files need extensive demos and DOCUMENTED examples that explain how to use them for the person who might be interested in using them. The fact is, it does not look like that would be difficult to do, and I'd welcome that addition.

My gut says these tools are worth a 5 star rating, IF you know how to use them and what they do. Without a good set of clearly documented examples, my gut wants to rate them as only 4 stars.

Derek O'ConnorAn excellent system. Passed all tests with Matlab R2008a 64 bit with Windows Vista 64.

Read Trefethen's paper "Computing Numerically with Functions Instead of Numbers" which is a nice short introduction to Chebfun.

http://www.comlab.ox.ac.uk/nick.trefethen/home.html

Derek O'Connor