Solving a system of ODEs in MATLAB
Show older comments
I'm trying to solve two ODEs in MATLAB. I wrote this function, but I keep getting an error message.
function dy = diff_eqs(y,t)
%Constants R = 100; k12 = 33; k21= 33; V1 =10; V2 = 25; k2=8;
%Equations dy = zeros(2,1);
dy(1,1) = (R - k12.*y(1) + k21 .* y(2))./V1;
dy(2,1) = (k12.*y(1) - k21.* y(2) - k2.*y(2))./V2;
end
After I get this down, I plan on using ode45 to solve.
1 Comment
Jan
on 10 Nov 2012
With a standard formatting your question would look nicer.
Whenever your write "I get an error message" in a forum, it is a good idea to post a copy of it. Matlab's error messages are such useful that it is worth to read them.
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!