how to solve a differential and nonlinear algebraic equation simultaneously.

  • dy(2)/d(x)= k*a*(y(1)-y(2)),
  • k*a(Y(1)-y(2))=-(1+sqrt(10-y(1)))
only unknown variable are y(1),y(2) and.

Answers (1)

I would suggest you solve the second equation for y(2), expressing it as a function of y(1). Then in the first equation substitute this expression for y(2) on the right side and its derivative with respect to x on the left side. This gives you an equality entirely in terms of y(1) and dy(1)/dx with y(2) eliminated. You can either solve it for dy(1)/dx and use ode45 or else use ode15i directly. This gives y(1) as a function of x, assuming you know y(1) at some initial x value. Then the above expression of y(2) in terms of y(1) will give you y(2) as a function of x.

Categories

Asked:

on 26 Jul 2015

Answered:

on 26 Jul 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!