I have a plot of data used from testing a rocket engine's thrust vs. time response. I want to find the total impulse under the area that has the thrust. But, thats's only 2 seconds worth of data of the 40 seconds of data recorded and plotted. I want to do a trapz() under that section of data only. How would I go about doing that?

 채택된 답변

Star Strider
Star Strider 2015년 4월 12일

0 개 추천

That depends on the data (that we don’t have). Assuming the there is noise in the data at all times, and a flat baseline before and after the rocket engine is on, the easiest way would be to identify the baseline mean and standard deviation, and consider everything above the baseline mean+3*std as the rocket engine thrust. Find the first and last indices in your vector that exceed those values, consider those the rocket engine thrust signal, and integrate between them. You might have to account for transients afterward, so consider those as well.

댓글 수: 4

N/A
N/A 2015년 4월 12일
I've attached the data file here. Time is "t" and voltage is "d"...we found a calibration equation to convert voltage into thrust:
F = 0.9+(11.01*d - 11.73)
As you can see, I want to know the area under the time interval of 5 to 7.2 seconds (again, rough estimates). Would there be anyway to simply plot that section of the data and then do the integration...is there a way to tell MATLAB that I want data only from t=5 to 7.2 seconds. Or with the entire data set, I want to integrate under the curve only from these two time points?
Apologise for the delay. I had to do some experimenting.
See if this does what you want:
data = load('Quizmaster Trial1.mat');
d = data.d;
t = data.t;
F = @(d) 0.9+(11.01*d - 11.73);
dm = mean(d); % Statistics
ds = std(d);
d1 = ones(size(d)); % For Plotting
ThrustIndex = find(d >= dm+ds); % Signal >= Mean + 1 S.D.
ThrustForce = F(d(ThrustIndex));
ThrustIntegral = trapz(t(ThrustIndex), ThrustForce);
figure(1)
plot(t, d)
hold on
plot(t, d1*(dm+1*ds), '-g')
plot(t(ThrustIndex), d(ThrustIndex), '-r')
hold off
grid
legend('All Data', 'Threshold', 'Thrust Signal')
With these criteria, trapz produces:
ThrustIntegral =
7.5794e+000
N/A
N/A 2015년 4월 12일
Yes! The theory was expected to be around 8 or 9 Ns, and that number makes sense. Doing the whole data set gave me a negative value, due to the noise above and below the x-axis. THANK YOU!!
Star Strider
Star Strider 2015년 4월 12일
My pleasure!
I’ve had to deal with these sorts of problems in my own work, so I’m always happy to share the techniques I’ve discovered to deal with them. That your signal had a very distinct beginning and end helped.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

제품

질문:

N/A
2015년 4월 12일

댓글:

2015년 4월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by