Upload files to "ex2C_peclet_problem"
This commit is contained in:
parent
5c841021af
commit
d506e3d2c8
1 changed files with 18 additions and 0 deletions
18
ex2C_peclet_problem/main.py
Normal file
18
ex2C_peclet_problem/main.py
Normal file
|
|
@ -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()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue