How to solve this system of ODEs

1 visualización (últimos 30 días)
Sun
Sun el 22 de Ag. de 2019
Respondida: John D'Errico el 23 de Ag. de 2019
Hi,
I have a system in the form of something like this (a * dy/dt) + (b * y) = (c * dx/dt) + (d * x). Data is available for variables x, y & t. How to estimate parameters a, b, c & d?
Is there any in-built tool on MATLAB that can take custom equations like these? Please let me know. Thanks!
Best,
Sun

Respuesta aceptada

John D'Errico
John D'Errico el 23 de Ag. de 2019
You have ONE equation, not a system of ODEs.
(a * dy/dt) + (b * y) = (c * dx/dt) + (d * x)
But suppose you knew the true solution for those coefficients, estimated as [a, b, c, d], as the "optimal" set of coefficients. Can you know then that [2*a, 2*b, 2*c, 2*d] is not just as good of a solution? In fact, pick any constant k, and we can see that the set [k*a, k*b, k*c, k*d] is a solution as good as any other. k can even be zero.
That tells you that your problem is not well posed. You can choose ANY of those 4 coefficients, and arbitrarily set it to 1, or to any constant. I'd pick a==1, which is as good as any other. So your problem now reduces to something like this:
dy/dt + b*y = c*dx/dt + d*x
Next, although we don't have your data in hand to show how it might work, you have data of the form of a list of values for t, as well as x and y at each point in time.
So just interpolate x(t) and y(t) as splines. Then use them to infer the values of b, c, and d. Assuming t,x, and y are vectors, it would look like this:
xoft = spline(t,x);
xdot = fnder(xoft)
yoft = spline(t,y);
ydot = fnder(xoft)
A = [-y(:),fnval(xdot,t(:)),x(:)];
bcd = A\fnval(ydot,t(:));
bcd will be a vector of length 3, contining the values of b, c, and d. Remember that a was 1.
fnval and fnder should be part of the curve fitting toolbox as I recall.

Más respuestas (1)

darova
darova el 22 de Ag. de 2019
Look like system of equations
It has many solutions. For example d=1:

Categorías

Más información sobre Spline Postprocessing 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