This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#poisson solver | |
#u_xx = b(x) | |
%matplotlib inline | |
from __future__ import division | |
import numpy as np | |
from numpy import cos, sin, zeros, pi | |
from numpy.linalg import solve, norm | |
import matplotlib.pyplot as plt | |
from matplotlib import rcParams | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Use of 2D FFT for Fourier-spectral solution of | |
% | |
% ut = u_xx + u_yy 0 + u(1-u) , 0< x,y < 1 | |
% | |
% where | |
% u0 = exp(-r^2/(2*sig^2)), | |
% r^2 = (x-0.5)^2 + (y-0.5)^2, sig = 1 | |
% | |
% with periodic BCs on u in x,y, using N = 16 modes in each direction. | |
% Script makes a surface plot of u at the Fourier grid points. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Use of 2D FFT for Fourier-spectral solution of | |
% | |
% ut = u_xx + u(1-u) , 0< x < 50 | |
% | |
% where | |
% u0 = exp(-r^2/(2*sig^2)), | |
% r^2 = (x-0.5)^2 , sig = 1 | |
% | |
% with periodic BCs on u in x,y, using N = 16 modes in each direction. | |
% Script makes a surface plot of u at the Fourier grid points. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%Modified from http://www.wikiwaves.org/Reaction-Diffusion_Systems | |
%Reaction Diffusion | |
% A + E -> 2A | |
% Differential Equations | |
% A_t = A_xx + A*E | |
% E_t = E_xx - E*A | |
% Equivalente to | |
% A_t = A_xx + A*(1-A) | |
clc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% matplotlib inline | |
#modified from | |
#http://nbviewer.ipython.org/github/diogro/ode_examples/blob/master/The%20Fisher-Kolmogorov%20equation.ipynb?create=1 | |
from numpy import * | |
from scipy.integrate import odeint | |
from matplotlib.pyplot import plot, xlabel, ylabel, figure, axes, style | |
style.use('ggplot') | |
#import time | |
from timeit import default_timer as timer | |
import Fmodules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from matplotlib import cm, colors | |
from mpl_toolkits.mplot3d import Axes3D | |
import numpy as np | |
from matplotlib.patches import FancyArrowPatch | |
from mpl_toolkits.mplot3d import proj3d | |
class Arrow3D(FancyArrowPatch): | |
def __init__(self, xs, ys, zs, *args, **kwargs): | |
FancyArrowPatch.__init__(self, (0,0), (0,0), *args, **kwargs) |