MATLAB: How to solve the differential equation y(a-y)dy = udx/k

calculusdifferential equationsintegrationnumerical solutionodeode23ode45

Here u, k and a are constants.

Best Answer

By integrating both sides of the equation:
integral_{y=y0}^{y=y}y*(a-y) dy = (a*y^2/2 - y^3/3) - (a*y0^2/2 - y0^3/3)
integral_{x=x0}^{x=x}u/k dx = u/k*(x-x0)
Thus
(a*y^2/2 - y^3/3) - (a*y0^2/2 - y0^3/3) = u/k*(x-x0)
and the inverse function if the solution is given by
x = x0 + k/u*((a*y^2/2 - y^3/3) - (a*y0^2/2 - y0^3/3))
Best wishes
Torsten.