フィルターのクリア

Integration of one array variable wrt other array variable

6 ビュー (過去 30 日間)
Somnath Kale
Somnath Kale 2021 年 1 月 29 日
編集済み: Somnath Kale 2021 年 2 月 1 日
Hi
I am trying to integrate the current with respect to time to get polarization value. i have both time and current array can anyone help me with this to get proper integration
I am currently using following code:
Thickness = 15*10^-4;
Area = 350
data = readtable('Good PE Loop.txt')
time = data{:,1}
current= data{:,4}
polarization =data{:,5}
field = data{:,2}/Thickness
plot(time,current)
p1 = cumtrapz(current)
p = (10^5/3.5)*p1
plot(time,p)
plot(field,p)
but the value of polarization which im getteing is not correct. and im unable detect the mess up!
thanks in advance!!
  • datafile is attached. (my calculated values should be as in the array polarization)

回答 (1 件)

Amanpreetsingh Arora
Amanpreetsingh Arora 2021 年 2 月 1 日
If the time spacing for integration is non uniform, then you will also need to pass the time vector to "cumtrapz" or else it assumes unit spacing for integration. Try passing time vector in the following fashion and see if it yields expected results.
p1 = cumtrapz(time,current)
For more information on function "cumtrapz", refer to the following documentation.
  5 件のコメント
Amanpreetsingh Arora
Amanpreetsingh Arora 2021 年 2 月 1 日
Does the integral have an initial condition? If it has then you will have to add that initial value to "p" becuase "cumtrapz" computes the definate integral considering zero as initial condition.
Somnath Kale
Somnath Kale 2021 年 2 月 1 日
編集済み: Somnath Kale 2021 年 2 月 1 日
can u just add condition from -40 to +40 and wirte small code?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by