In MATLAB, I need to numerically integrate two ODE's. Say I have variables time $t$, $x_1(t)$ and $x_2(x_1)$.
First differential equation: contains $dx_2/dx_1$
Second differential equation: contains $dx_1/dt$
time doesn't explicitly occur in either equation. However, $x_1$ and $x_2$ occur in both ODE's. But since these are coupled equations, how do I simultaneously integrate at least numerically in MATLAB. Please note the variable of integration is different in each ODE.
Ideally, I'd like to integrate ODE#1 to tell me how $x_2 $varies with $x_1$. Then integrate ODE#2 to tell me how $x_1$ varies with respect to time. $x_1$ vs. time is what I'm really after. I need to do this repeatedly by manually varying the parameters of the equation. So, I'd like to automate the process of integration. Please let me know if you'd like to see the exact equations if this helps. I can update my question. Thanks.
Use the chain rule, $\frac{dx_2}{dt}=\frac{dx_2}{dx_1}\frac{dx_1}{dt}$ to get a coupled system depending on time.
That way, if $$ \frac{dx_1}{dt}=f(t,x_1,x_2)\\ \frac{dx_2}{dx_1}=g(t,x_1,x_2) $$ you get the system $$ \dot x_1=f(t,x_1,x_2)\\ \dot x_2=f(t,x_1,x_2)g(t,x_1,x_2). $$
Or use the inversion formula $\dfrac{dt}{dx_1}=\dfrac1{f(t,x_1,x_2)}$ to get everything in dependence of $x_1$, as long as $f$ is non-zero.