having all the values in the above equation, is the below code correct for dE(t)/d(t) computation?
dEt = beta * (1 - sigma) * St * It - (mu + alpha) * Et
what do i need to do to compute dE(t)/d(t)

4 comentarios

darova
darova el 4 de Abr. de 2021
Looks like differential equation. DO you have initial value ?
You can use ode45
Elysi Cochin
Elysi Cochin el 4 de Abr. de 2021
i too saw ode45 to solve differential equation,
i have all values, but i dont know, how to pass this equation to ode45?
darova
darova el 4 de Abr. de 2021
Do you have any attempts?
John D'Errico
John D'Errico el 4 de Abr. de 2021
What you have not said is explicitly WHAT you have.
What does it mean to have values?
is beta a fixed known constant? How about mu and alpha?
Is S known as a function, or do you have a list of points for S as a function of t?
Similarly for I(t). Is that known?
Is E(t) known, or are you trying to solve for E(t). That would make this a differential equation, if E is an unknown function.
Finally, do you have some sort of initial value for E(t) at some fixed value for t?

Iniciar sesión para comentar.

 Respuesta aceptada

darova
darova el 5 de Abr. de 2021

1 voto

Only you know initial conditions. Imagine the situation: you are throwing the ball, initial conditions are velocity and angle. Only you know how you want to throw the ball
YOu should use for loop to get solution for all your values
for i = 1:size(SIE,1) % numer of rows
S = SIE(i,1);
I = SIE(i,2);
E = SIE(i,3);
[t,E] = ode45(@(t,E) myfunc(t,S,I,E),tspan,E);
line(t,E)
end

2 comentarios

Elysi Cochin
Elysi Cochin el 5 de Abr. de 2021
Editada: Elysi Cochin el 5 de Abr. de 2021
why do i get 10 curves? shouldnt it be one curve? how to get one curve? is it possible with the equation and datas above?
darova
darova el 5 de Abr. de 2021
Editada: darova el 5 de Abr. de 2021
One curve for one set of data. You can't get one curve if you have many values and initial conditions, it's impossible
Imagine you are throwing the bal at different angles but want to get only want trajectory
One angle - one trajectory

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

el 4 de Abr. de 2021

Editada:

el 5 de Abr. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by