really struggling to get a script for the energy in a capacitor.
Using the formula:
v(t) = (1/c)*int(i(t)) dt
The script need to be able to accept arrays i.e.
t = 0,1,2,3,4
i = 2,3,5,5,8
Where C is a fixed value for example, I'm sure this is very easy for someone experienced in coding. But personally I’m having a nightmare with it!
Any help is greatly appreciated!!
Many Thanks
Lee