Area under the curve
古いコメントを表示
I have follwing curve resulting from plotting current in capacitor versus time. (Matlab code is attached).
I want to calculate the charge stored in the capacitor. For that I need to calculate the positive area of the curve. As you can see in the zoomed in image, the current plotted has pulses (switching frequency = 20kHz), and I would like to calculate the charge stored in one fundamental cycle (fundamental frequency = 60Hz).
So theoretically, the capacitor is getting charged when the current flows into it. For the curve it means the value of current that is above zero(positive).
I tried calculating the area of the curve by simplifying the curve into traingles and trapezoids, and then taking the coordinate points values (x,y). But I am pretty sure it is not correct since it does not take into account the presence of pulses.
I also tried the trapz(x,y) in matlab but the calculation does not seem right.
And the expression of the current is not a straightforward function, it is defined in terms of switching functions and duty ratios so I am not sure how to use the integral function in Matlab.

Please help.

7 件のコメント
darova
2019 年 10 月 24 日
What have you tried? Can you fill the area you want to calculate?
Bhuvan Khoshoo
2019 年 10 月 25 日
Bjorn Gustavsson
2019 年 10 月 25 日
But what have you tried to do? Have you looked at the help and documentation for functions like: integral, trapz and sum?
Bhuvan Khoshoo
2019 年 10 月 25 日
Star Strider
2019 年 10 月 25 日
- Post your code.
- Attach your file.
Dimitris Kalogiros
2019 年 10 月 25 日
編集済み: Dimitris Kalogiros
2019 年 10 月 25 日
At the figures you have posted you have depicted current versus time e.g. I(t) . How do you have stored the values of current ? Do you have a vector (lets say) I, which contains dense samples of the signal I(t) ?
Bhuvan Khoshoo
2019 年 10 月 25 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Numerical Integration and Differentiation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!