es.davy.ai

Preguntas y respuestas de programación confiables

¿Tienes una pregunta?

Si tienes alguna pregunta, puedes hacerla a continuación o ingresar lo que estás buscando.

Tag: .NET-GENERIC-MATH

¿Cómo puedo elegir una función con una función de clase?

class ODEsolver(): def __init__(self): self.init=self def Euler(self, fcn, x0, y0, xend, h): estimate=[y0] z=y0 b=0 t=x0 while(t<xend): slope1=fcn(bisection(t,301,1200,10**-4)) y=z+slope1*h/8 t+=h z=y estimate.append(y) return estimate def heun(self, fcn, x0, y0, xend, h): pass def rungekutta(self,fcn,x0,y0,xend,h): pass def solve(self,which, fcn, x0, y0, xend, h): if which==0: return self.euler(fcn,x0,y0,xend,h) elif which==1: return self.heun(fcn,x0,y0,xend,h) . . . Read more