18997
Comment:
|
19007
|
Deletions are marked like this. | Additions are marked like this. |
Line 414: | Line 414: |
{{{ | {{{#!sagecell |
Sage Interactions - Differential Equations
goto interact main page
Contents
-
Sage Interactions - Differential Equations
- Euler's Method in one variable
- Vector Fields and Euler's Method
- Vector Field with Runga-Kutta-Fehlberg
- Linear two-dimensional ODEs
- Euler's Method, Improved Euler, and 4th order Runge-Kutta in one variable
- Mass/Spring systems
- Picard iteration example
- Euler-Maruyama method and geometric Brownian motion (a common simple model of the stock market)
- Autonomous equations and stable/unstable fixed points
- Heat equation using Fourier series
- Heat equation using finite diferences in cython
- DE with boundary values
Euler's Method in one variable
by Marshall Hampton. This needs some polishing but its usable as is.
Vector Fields and Euler's Method
by Mike Hansen (tested and updated by William Stein, and later by Dan Drake)
Vector Field with Runga-Kutta-Fehlberg
by Harald Schilly
Linear two-dimensional ODEs
by Marshall Hampton
Euler's Method, Improved Euler, and 4th order Runge-Kutta in one variable
by Marshall Hampton. This is a more baroque version of the Euler's method demo above.
Mass/Spring systems
by Jason Grout
These two interacts involve some Cython code or other scipy imports, so I've posted a file containing them. You can download the worksheet or copy it online.
Picard iteration example
by Marshall Hampton and David Joyner
Euler-Maruyama method and geometric Brownian motion (a common simple model of the stock market)
by Marshall Hampton
Autonomous equations and stable/unstable fixed points
by Marshall Hampton This needs the Cython functon defined in a seperate cell. Note that it is not a particularly good example of Cython use.
Heat equation using Fourier series
by Pablo Angulo
Heat equation using finite diferences in cython
by Pablo Angulo
#interact box wrapping the code above var('x') @interact def _(f=input_box(default=x*exp(-x^2),label='f(x)'), longitud=input_box(default=2*pi), tiempo=input_box(default=0.1), M=input_box(default=100), k=input_box(default=1), tsteps=input_box(default=2000) ): efe=f._fast_float_(x) dx=float(longitud/M) xs=[n*dx for n in range(M+1)] u0=[efe(a) for a in xs] s=k*(tiempo/tsteps) /dx^2 if s>0.5: print 's=%f > 1/2!!! The method is not stable'%s ut=calor_cython(u0,dx,k,tiempo,tsteps) show( line2d(zip(xs, u0)) + line2d(zip(xs, ut), rgbcolor='green') )
DE with boundary values
The following interact demo looks at the DE+BC y'+y=0, y(0)=a, y(b)=c, and has a slider for b. When b=pi "problems arise":-)