How to integrate given the two data columns

8 visualizaciones (últimos 30 días)
Grigorios Chatziandreou
Grigorios Chatziandreou el 29 de Abr. de 2022
Respondida: Torsten el 29 de Abr. de 2022
Hello. I have used ode45 to figure out current wrt time.
I have my matrix tz and my matrix CURRENT for values of current with time from tz(1)=0 to tz(end). How can I intagrate it? Any clever way if I do not know the time step in tz?

Respuestas (2)

Riccardo Scorretti
Riccardo Scorretti el 29 de Abr. de 2022
Most probably like this:
CHARGE = sum(CURRENT(1:end-1) .* diff(tz));
  1 comentario
Riccardo Scorretti
Riccardo Scorretti el 29 de Abr. de 2022
Something better can be done, but if you have a large number of points, it will give more or less the same result.

Iniciar sesión para comentar.


Torsten
Torsten el 29 de Abr. de 2022
Add the differential equation
dz/dt = CURRENT, z(t0) = 0
to your system of ODEs.
z will automatically be the integrated CURRENT over time.

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by