Estoy transcribiendo un código que está hecho en MATLAB a Python, y quiero saber cómo debo crear correctamente las funciones de abajo pero en Python.
Función 1:
function init=initial(x)
init=0.09 * exp(-x.ˆ2/50);
Función 2:
function fl=flux(rho)
vf = 15;
rhomax = 0.2;
fl = vf*(1-rho/rhomax).*rho;
Leyendo la documentación sobre métedos en Python, hice lo siguiente:
def initial (x):
init=0.09*math.exp(-x**2/50);
return init
def flux(rho):
vf=15;
rhomax=0.2;
fl=vf*(1-rho/rhomax)*rho;
return fl