diff --git a/ex2C_peclet_problem/main.py b/ex2C_peclet_problem/main.py new file mode 100644 index 0000000..d8cb768 --- /dev/null +++ b/ex2C_peclet_problem/main.py @@ -0,0 +1,18 @@ +import numpy as np +import matplotlib.pyplot as plt + +def u(x,p): + return (np.exp(p*x) - 1)/(np.exp(p) - 1) + +x = np.linspace(0, 1, 200) + + +plt.figure(figsize=(8, 5)) +for p in [ -3, -1, -0.5, 0.5, 2, 4]: + plt.plot(x, u(x, p), label="p ="+ str(p)) + +plt.xlabel('x') +plt.ylabel('u(x)') +plt.legend() +plt.grid(True) +plt.show()