MATLAB Answers

Which of these solutions is correct for a system of differential equations? And why do they give different results?

1 view (last 30 days)

Accepted Answer

Sulaymon Eshkabilov
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

More Answers (0)

Community Treasure Hunt

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

Start Hunting!