How to integrate given the two data columns

조회 수: 7 (최근 30일)
Grigorios Chatziandreou
Grigorios Chatziandreou 2022년 4월 29일
답변: Torsten 2022년 4월 29일
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?

답변 (2개)

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

댓글을 달려면 로그인하십시오.


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

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by