Numerically solving a system of linear ODEs with different time conditions?

95 Views Asked by At

I am interested in solving the following system of ODEs numerically \begin{align} x'=2x+3y+z\\ y'=x-3y+2z\\ z'=x+2y-4z \end{align} with conditions at distinct times, even at time at infinity. \begin{align} x(0)=1, y(0)=1, z(+\infty)=0 \end{align}

Can I use PYTHON or MATLAB to solve it? If yes, where I can find such tutorial? Many thanks for your help!

1

There are 1 best solutions below

1
On BEST ANSWER

This is a linear system, you can solve it via eigen-decomposition. This produces a positive and two negative eigenvalues. The solution has to lie in the eigenspaces of the negative eigenvalues. This gives the missing initial condition as $$ z(0)=-5.024155419109322. $$ Long-term numerical simulation with this initial condition will likely not converge to zero in all components, as numerical errors will build up some small coefficient for the component with a positive eigenvalue, which will then grow exponentially.

$$ (λ_1,λ_2,λ_3)=( 2.93491425,\, -2.40143568,\, -5.53347857), \\ V=(v_1,v_2,v_3)= \begin{bmatrix} 0.95198356& 0.56546078& 0.16012843\\ 0.2289107& -0.66866328& -0.64979254\\ 0.2032909 & -0.48284938& 0.74305352 \end{bmatrix}\\ (c_1,c_2,c_3)=(0.0,\,3.11077114,\, -4.74006433) \\ y(t)=\sum_{k=1}^3c_cv_ke^{λ_kt} $$