# Chebfun

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Chebfun
> Markdown URL: https://mediated.wiki/source/Chebfun.md
> Source: https://en.wikipedia.org/wiki/Chebfun
> Source revision: 1354836173
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Numerical computation software system}}
{{Infobox software
| name                   = Chebfun
| logo                   = Cheblogo.png
| logo size              = 250px
| developer              = The Chebfun Team, University of Oxford
| programming language   = [MATLAB](/source/MATLAB)
| genre                  = [Numerical software](/source/Numerical_software)
| license                = [BSD](/source/BSD_licenses)
| website                = {{URL|http://www.chebfun.org/}}
| latest_release_version = v5.7.0
| latest_release_date    = 02 June 2017
}}

'''Chebfun''' is a [free/open-source](/source/Free_and_open_source_software) software system written in [MATLAB](/source/MATLAB) for numerical computation with functions of a real variable.  It is based on the idea of overloading MATLAB's commands for vectors and matrices to analogous commands for functions and operators.  Thus, for example, whereas the SUM command in MATLAB adds up the elements of a vector, the SUM command in Chebfun evaluates a definite integral.  Similarly the backslash command in MATLAB becomes a Chebfun command for solving differential equations.<ref name="Battles2004">{{Cite journal | last1 = Battles | first1 = Zachary| last2 = Trefethen | first2 = Lloyd N.| doi = 10.1137/S1064827503430126 | title = An Extension of MATLAB to Continuous Functions and Operators| url = https://www.chebfun.org/publications/chebfun_paper.pdf| journal = SIAM Journal on Scientific Computing | volume = 25 | issue = 5 | pages = 1743–1770| year = 2004 | bibcode = 2004SJSC...25.1743B}}</ref><ref name="Trefethen2007">{{Cite journal | last1 = Trefethen | first1 = Lloyd N. | doi = 10.1007/s11786-007-0001-y | title = Computing Numerically with Functions Instead of Numbers| url = https://www.chebfun.org/publications/trefethen_functions.pdf| journal = Mathematics in Computer Science | volume = 1 | pages = 9–19 | year = 2007 }}</ref><ref name="Pachon2009">{{Cite journal | last1 = Pachón | first1 = Ricardo | last2 = Platte | first2 = Rodrigo B. | last3 = Trefethen | first3 = Lloyd N. | doi = 10.1093/imanum/drp008 | title = Piecewise-smooth chebfuns| url = https://people.maths.ox.ac.uk/trefethen/publication/PDF/2010_134.pdf| journal = IMA Journal of Numerical Analysis | volume = 30 | issue = 4 | pages = 898&ndash;916 | date = October 2010 }}</ref><ref name="Driscoll2008">{{Cite journal | last1 = Driscoll | first1 = Tobin A. | last2 = Bornemann | first2 = Folkmar| last3 = Trefethen | first3 = Lloyd N.| doi = 10.1007/s10543-008-0198-4 | title = The chebop system for automatic solution of differential equations| url = https://www.chebfun.org/publications/driscoll_born_tref.pdf| journal = BIT Numerical Mathematics | volume = 48 | issue = 4 | pages = 701&ndash;723| date = December 2008 }}</ref><ref name="Townsend2013">{{Cite journal | last1 = Townsend | first1 = Alex| last2 = Trefethen | first2 = Lloyd N. | doi = 10.1137/130908002 | title = An Extension of Chebfun to Two Dimensions| url = https://www.chebfun.org/publications/Chebfun2paper.pdf| journal = SIAM Journal on Scientific Computing | volume = 35 | issue = 6 | pages = C495–C518| year = 2013 | bibcode = 2013SJSC...35C.495T}}</ref>

The mathematical basis of Chebfun is numerical algorithms involving piecewise polynomial interpolants and [Chebyshev polynomials](/source/Chebyshev_polynomials), and this is where the name "Cheb" comes from.  The package aims to combine the feel of symbolic computing systems like [Maple](/source/Maple_(software)) and [Mathematica](/source/Mathematica) with the speed of floating-point numerics.<ref name="Trefethen2007" /><ref name="Pachon2009" />

The Chebfun project is based in the Mathematical Institute at the [University of Oxford](/source/University_of_Oxford) and was initiated in 2002 by [Lloyd N. Trefethen](/source/Lloyd_N._Trefethen) and his student Zachary Battles.<ref name="Battles2004" />  The most recent version, Version 5.7.0, was released on June 2, 2017.

Chebfun2, a software system that extends Chebfun to two dimensions, was made publicly available on 4 March 2013. Following Chebfun2, Spherefun (extension to the unit sphere) and Chebfun3 (extension to three dimensions) were made publicly available in May and July 2016.

==Features==

* Approximation of functions in 1D, including functions with jumps
* Approximation of smooth bivariate functions (Chebfun2)
* Approximation of smooth trivariate functions (Chebfun3)
* Approximation of smooth functions on the unit sphere (Spherefun)
* Quadrature
* Rootfinding
* 1D global optimisation
* Bivariate and trivariate rootfinding
* Ordinary differential equations
* Partial differential equations
* Vector calculus

==Example usage==

A user may begin by initialising the variable x, on the interval [0,10], say.

<syntaxhighlight lang="matlab">
>> x = chebfun('x',[0,10]); 
</syntaxhighlight>

This variable can now be used to perform further computations, for example, computing and plotting roots of a function:

<syntaxhighlight lang="matlab">
>> f = sin(x) + sin(x.^2);  plot(f)
>> r = roots(f); hold on, plot(r,f(r),'.r'), hold off 
</syntaxhighlight>

500px

The definite integral can be computed with:

<syntaxhighlight lang="matlab">
>> sum(f) 
ans 
   = 2.422742429006079 
</syntaxhighlight>

== References ==
{{reflist|30em}}

== External links ==
* {{Official website|http://www.chebfun.org/}}
* Related projects and partial replacements in other languages: [https://www.chebfun.org/about/projects.html]

Category:Mathematical software

---
Adapted from the Wikipedia article [Chebfun](https://en.wikipedia.org/wiki/Chebfun) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Chebfun?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
