Code covered by the BSD License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

4.8
4.8 | 13 ratings Rate this file 37 Downloads (last 30 days) File Size: 4.39 MB File ID: #23972 Version: 4.2

### Chebfun Team (view profile)

30 Apr 2009 (Updated )

Numerical computation with functions

### Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

File Information
Description

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.

Acknowledgements

This file inspired Chebpack, Gauss Quadrature Nodes And Weights., and Dynamical System Viewer.

Required Products MATLAB
MATLAB release MATLAB 7.14 (R2012a)
MATLAB Search Path
/
/chebfun
/chebfun/chebbench
/chebfun/chebtests
/chebfun/chebtests/basic
/chebfun/chebtests/chebops
/chebfun/chebtests/linops
/chebfun/chebtests/misc
/chebfun/chebtests/quasimatrices
/chebfun/examples
/chebfun/examples/approx
/chebfun/examples/approx/html
/chebfun/examples/complex
/chebfun/examples/complex/html
/chebfun/examples/fun
/chebfun/examples/fun/html
/chebfun/examples/geom
/chebfun/examples/geom/html
/chebfun/examples/integro
/chebfun/examples/integro/html
/chebfun/examples/linalg
/chebfun/examples/linalg/html
/chebfun/examples/ode
/chebfun/examples/ode-eig
/chebfun/examples/ode-eig/html
/chebfun/examples/ode/html
/chebfun/examples/opt
/chebfun/examples/opt/html
/chebfun/examples/pde
/chebfun/examples/pde/html
/chebfun/examples/roots
/chebfun/examples/roots/html
/chebfun/examples/stats
/chebfun/examples/stats/html
/chebfun/guide
/chebfun/guide/html
Tags for This File   Please login to tag files.
Comments and Ratings (20)
08 Jan 2015 A. Gowrisankar

### A. Gowrisankar (view profile)

Hi,

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.

21 Nov 2014 Nick Hale

### Nick Hale (view profile)

Hi Mehedi

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

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

Regards

Nick

Comment only
17 Nov 2014 Mehedi

### Mehedi (view profile)

Hello,
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

23 Apr 2013 Nick Hale

### Nick Hale (view profile)

Hi 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! :)

Comment only
08 Apr 2013 Peter Green

### Peter Green (view profile)

Another 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

08 Apr 2013 Peter Green

### Peter Green (view profile)

An 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

15 Feb 2013 Raghuram

### Raghuram (view profile)

23 Oct 2012 Shashank

### Shashank (view profile)

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

Comment only
16 Nov 2011 Mark Shore

### Mark Shore (view profile)

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

Comment only
16 Nov 2011 Mark Shore

### Mark Shore (view profile)

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

Comment only
16 Nov 2011 Mark Shore

### Mark Shore (view profile)

27 Oct 2011 Chebfun Team

### Chebfun Team (view profile)

Hi 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/

Comment only
27 Oct 2011 Jiro Doke

### Jiro Doke (view profile)

I 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?

29 Jun 2009 Erdal Bizkevelci

### Erdal Bizkevelci (view profile)

11 Jun 2009 Siyi Deng

### Siyi Deng (view profile)

this toolbox is awesome.

25 May 2009 Erdal Bizkevelci

### Erdal Bizkevelci (view profile)

07 May 2009 John D'Errico

### John D'Errico (view profile)

Thanks 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.

07 May 2009 Toby Driscoll

### Toby Driscoll (view profile)

The 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.

Comment only
04 May 2009 John D'Errico

### John D'Errico (view profile)

I'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.

02 May 2009 Derek O'Connor

### Derek O'Connor (view profile)

An 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

30 Apr 2009 1.4

Changed the screenshot of the logo.

10 Jun 2009 1.5

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

12 Jun 2009 1.7

Summary corrected.

21 Jun 2009 1.8

08 Jan 2010 1.9

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

25 Oct 2011 1.10

Updated information on new release.

16 Nov 2011 1.15

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

16 Nov 2011 1.16

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

05 Apr 2012 1.17

Updated to v4.2.2194.

Release notes at www.chebfun.org/notes/

20 Jun 2014 1.18

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

20 Jun 2014 1.19

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

24 Jun 2014 1.20

Announce V5 release.

29 Oct 2015 4.2

Updated October 29, 2015.