differential equations - Matlab: finding coefficients of ODE system -
i have data , ode system of 3 equations has 9 unknown coefficients (a1, a2,..., a9).
ds/dt = a1*s+a2*d+a3*f dd/dt = a4*s+a5*d+a6*f df/dt = a7*s+a8*d+a9*f t = [1 2 3 4 5] s = [17710 18445 20298 22369 24221] d = [1357.33 1431.92 1448.94 1388.33 1468.95] f = [104188 104792 112097 123492 140051]
how find these coefficients (a1,..., a9) of ode using matlab?
i can't spend time on this, need use math reduce equation more meaningful:
your equation of order
dx/dt = a*x
ergo solution
x(t-t0) = exp(a*(t-t0)) * x(t0)
thus
exp(a*(t-t0)) = x(t-t0) * pseudo(x(t0))
pseudo moore-penrose pseudo-inverse.
edit: had second @ solution, , didn't calculate pseudo-inverse properly.
basically, pseudo(x(t0)) = x(t0)'*inv(x(t0)*x(t0)'), x(t0) * pseudo(x(t0)) equals identity matrix
now need assume each time step (1 2, 2 3, 3 4) experiment (therefore t-t0=1), solution to:
1- build pseudo inverse:
xt = [s;d;f]; xt0 = xt(:,1:4); xinv = xt0'*inv(xt0*xt0');
2- exponential result
xt1 = xt(:,2:5); expa = xt1 * xinv;
3- logarithm of matrix:
a = logm(expa);
and since t-t0= 1, our solution.
and simple proof check
[t, y] = ode45(@(t,x) a*x,[1 5], xt(1:3,1)); plot (t,y,1:5, xt,'x')
Comments
Post a Comment