How to integrate given the two data columns
4 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(2 个)
Riccardo Scorretti
2022-4-29
Most probably like this:
CHARGE = sum(CURRENT(1:end-1) .* diff(tz));
1 个评论
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
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!