Load the necessary python libraries.
In [1]:
%matplotlib inline
import glob
from sympy import *
import pandas
init_printing()
In [2]:
x,a,b= symbols('x a b')
v = 2
u = a*cos(pi*x)*sin(pi*x/b)
u
Out[2]:
Compute the forcing function.
In [3]:
f = v*diff(u, x)
f
Out[3]:
In [4]:
str(u).replace('**', '^')
Out[4]:
In [5]:
str(f).replace('**', '^')
Out[5]:
In [11]:
%run convergence.py