I have a system of equations which describe dynamic nature of a system. There is no closed form solution for this system. So I want to solve it numerically with Matlab solver ODE. But as I'm beginner in this area, I can't write correct code despite of several hours effort. System of equations is as follow:
$$I_c=I_1 + I_2 + I_3$$ $$R_3 = \frac{V_3}{I_3}$$ $$I_1=(C_0+2KV_1)\frac{dV_1}{dt}$$ $$V_1=V_3-I_1 R_1$$ $$I_2=C_2\frac{dV_2}{dt}$$ $$V_2=V_3-I_2 R_2$$ In these equations $I_c, R_1,R_2, R_3, C_0, C_2,$ and $K$ are constants and given. I want to have $V_1, V_2, V_3$ evolution over time t.
You only have derivatives for 2 dependents. The easiest solution would be to express all other dependents in these two, $v_1, V_2$. You have $$ V_3=R_3I_3 \\ \left.\begin{aligned} V_1=V_3-I_1R_1=R_3I_3-R_1I_1 \\ V_2=V_3-I_2R_2=R_3I_3-R_2I_2 \end{aligned}\right\}\implies R_2V_1+R_1V_2=(R_2+R_1)R_3I_3-R_1R_2(I_c-I_3) \\ $$ so given $V_1, V_2$ you can compute $I_3$, then $V_3$ then $I_1, I_2$.
and then, if the matrix dimensions fit (if not, add matrix transpositions to the ODE function)