Calculating integral from data over time - solved

33 vues (au cours des 30 derniers jours)
Robert Mama
Robert Mama le 9 Nov 2020
Modifié(e) : Robert Mama le 9 Nov 2020
Meybe I'm stupid, but, cumtrapz give me a table, I used it for further calculation - meybe it will be F - I don't have time to stay in this point forever
Hi,
I am completely new to the matlab environment, but the current studies threw me into the deep water right away, and on the previous ones they did not even show us a pond.
I have problem like this. I have experimental data -just record of V(t) and I(t) (both around 1000 pints), frequency equals 4800 Hz and I think it is all that is needed for this question. All in AC regime.
I need to calculate
integral V(t) dt
, and to be honest, I don't even know how to start. I found out on the forum, that this integral is equal to:
integral V(t) dt = k * i(t)
Also my teacher mentioned in the email that I should get some integration constant from this and as I looked through further equations k will be needed.
I've been browsing forums and google for the third day, all trapz, cumtrapz are not useful for me, or I don't know how to get the data I need from them. Ordinary integrals do not work when I do not have a formula, and unfortunately, it cannot be derived from the data I have - the sensors simply have their measurement errors and the formulas do not agree with the graphs I got by calculating the time of subsequent measurements from period.
I would also like to add that in later calculations I multiply by the result of this integral, as long as the trapz did it here, because I got one number, not a table as in the case of cumtrapz, the result was completely different from the actual measurements I could find in the textbooks.
Please give me some tips on what I should be looking at or what I have missed.
Thanks in advance
  2 commentaires
Mathieu NOE
Mathieu NOE le 9 Nov 2020
hello
so what are your experimental data look like and what code have you already produced ?
Robert Mama
Robert Mama le 9 Nov 2020
Sorry, didn't see that I answered whole topic :D

Connectez-vous pour commenter.

Réponse acceptée

Robert Mama
Robert Mama le 9 Nov 2020
So, as I mentained:
  • Data that I have is measured in AC regime, its Vrms oraz V(t) [on the left] and I(t) [on the right] - I'm not allowed to put all the data on the internet, so here is a fragment:
0.253689580213472 -0.0459724027807118
0.254260392503034 -0.0445915447659934
0.254704284548489 -0.0463669336420599
0.255190264136031 -0.0414352978752085
0.255951127982832 -0.0420270941672307
0.256796824531654 -0.0406462361525123
0.257451811905391 -0.039758541714479
0.258403384927277 -0.0391667454224569
0.258889364514819 -0.0359118658163349
0.259545009506401 -0.0368981929697052
0.259777148605728 -0.0358132331009979
  • I read data, create tables for Vrms and I
Data=dlmread('Data.txt');
I=Data(:,1);
Vrms=Data(:,2);
  • furter I add some constants and equations that are not related to the question, so I will skip that. Then I add frequency, calculate period from it just like T=1/f and than create timetable for every measured peak:
f=4800; %%Hz
T=1/f; %% s
t=linspace(0,T,height(Data)); %% calculation of t
t=t'; %% idk if this is needed but I do it for plots - I wanted to have data and time vectors looks same
  • Here I have plots and other calculations, but they are not needed to be mantained
  • further I need to calculate Y=x*integral V(t) dt - thats where I have problem, idk how to calculate this integral properly:
  1. My teacher says that I have to compute the indefinite time integral
  2. From this integral I should also recieve some integration constant for further calculations
  3. When I'm using trapz I feel likeit treats all measuring point like - first is in begining of integration, last at the end, interval is 1
  4. cumtrapz gives me table of numbers, I read that the last one should be solution, but idk
  5. Numerical integral functions ofc don't work for data - I'm not surprised here, but I checked anyway :D

Plus de réponses (0)

Catégories

En savoir plus sur Numerical Integration and Differentiation dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by