syms u(t) v(t) x(t) y(t)ode1 = diff(u,t) == 3*u + 4*v +5*x +6*y;ode2 = diff(v,t) == -4*u + 3*v +9*x +8*y;ode3 = diff(x,t) == -3*u + 9*v +4*x +6*y;ode4 = diff(y,t) == 6*u + 8*v +9*x +5*y;odes = [ode1;ode2;ode3;ode4];S = dsolve(odes);uSol(t) = S.u;vSol(t) = S.v;xSol(t) = S.x;ySol(t) = S.y;[uSol(t), vSol(t), xSol(t), ySol(t)] = dsolve(odes)cond1 = u(0) == 0;cond2 = v(0) == 0;cond3 = x(0) == 0;cond4 = y(0) == 0;conds = [cond1; cond2; cond3; cond4];[uSol(t), vSol(t), xSol(t), ySol(t)] = dsolve(odes,conds);ezplot(uSol)hold onezplot(vSol)hold onezplot(xSol)hold onezplot(ySol)grid on;legend('uSol','vSol','xSol', 'ySol')
MATLAB: I failed to solve 4 equation differential equation. I’m giving the code. the same code for two equation worked well. The point the program stuck is dsolve(ode1,ode2,ode3,ode4) or dsolve(odes) and never it finishes.
differential equationdsolveode
Best Answer