@Amal Matrafi, could you please provide the ode45 code so that we can check? We are not experts in the SI model. Is 'SI' an abbreviation for something?
By the way, could you solve this ODE and plot the derivative of ?
There are other, more direct (and probably more accurate) ways of calculating it from the original differential equation function. That requires a loop.
You can use deval() to obtain the first derivative. Alternatively, as suggested by @Star Strider, you can also use the gradient() approach to obtain the first derivative.
beta = [0.1, 0.2, 0.25];
N = 1000;
tend = 150;
I0 = 10;
tspan = [0,tend];
S0 = N - I0;
y0 = [S0; I0];
opts = odeset('RelTol', 1e-2, 'AbsTol', 1e-4);
for j = 1:numel(beta)
sol = ode45(@(t, y) SIRfunc(t, y, beta(j), N), tspan, y0, opts);
Before learning to use deval(), I utilized the right-hand side of the state equation by directly substituting the solution from ode45(). This is pure math stuff!
Da Änderungen an der Seite vorgenommen wurden, kann diese Aktion nicht abgeschlossen werden. Laden Sie die Seite neu, um sie im aktualisierten Zustand anzuzeigen.
Translated by
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.