0

I do have three differential equations of the form:

dx/dt= (-K1*x)
dI/dt= ((K1*(x) - (K2*I**2))/2)
dm/dt= 0.5*(K2*I**2)

I have data for time, x, I and m, with respect to time. How to calculate K1 and K2 using available packages in python? Can anyone help me with a sample code?

Thank you

  • Check [this SO question](https://stackoverflow.com/a/6885864/8353711). – shaik moeed Mar 06 '20 at 09:36
  • This question is likely off-topic here, as it is not a problem with code, but to find a numerical algorithm. Try scicomp.SE. // This is more about applying some method from scipy.optimize or similar optimization packages, or possibly python-GEKKO like in https://stackoverflow.com/q/57598778/3088138, I found no direct documentation for this application case. – Lutz Lehmann Mar 06 '20 at 10:50
  • While it could be made more pythonic and also use the integrator more efficiently, https://adventuresinpython.blogspot.com/2012/08/fitting-differential-equation-system-to.html is a nice instruction on how to solve such problems. – Lutz Lehmann Mar 06 '20 at 11:42

0 Answers0