I keep getting errors when I try to integrate kinematic and dynamic differential equation

1 visualización (últimos 30 días)
import numpy as np
from scipy.integrate import quad
def kde_integral(x):
return (1/np.sqrt(2*np.pi))*np.exp(-x*2/2)
def dde_integral(x):
return 2*x*(1/np.sqrt(2*np.pi))*np.exp(-x*2/2)
integ_kde = quad(kde_integral, -np.inf, np.inf)[0]
integ_dde = quad(dde_integral, -np.inf, np.inf)[0]
% Plotting the K-Ko graph
def plot_kk_graph():
x = np.linspace(-5, 5, 1000)
kde_y = kde_integral(x)
dde_y = dde_integral(x)
k = np.trapz(kde_y, x=x)
ko = np.trapz(dde_y, x=x)
plt.plot(k, ko, color='b')
plt.title("K-Ko Graph")
plt.xlabel("K")
plt.ylabel("Ko")
plt.show()
plot_kk_graph()
I get the following errors:
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
How do i fix it?

Respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by