18 lines
326 B
Python
18 lines
326 B
Python
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()
|