Which of these solutions is correct for a system of differential equations? And why do they give different results?
4 views (last 30 days)
Show older comments
Solution 2:
0 Comments
Accepted Answer
Sulaymon Eshkabilov
on 15 Jun 2021
In this one, you have inserted a wrong sign:
function dydt = fSystem(t, y, beta1, alpha2, beta2, p, psi, T)
f2 = -alpha2*y(2)+beta2+y(1)*y(2); %% ERR: 'beta2+' has to be 'beta2*'
g = beta1*y(2)+p*f2*y(1)^(-1)-psi*(T*y(1))^(-1);
dydt(1) = g*y(1)-beta1*y(1)*y(2);
dydt(2) = f2;
dydt = dydt';
end
0 Comments
More Answers (0)
See Also
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!