How do integrate this function over t=0 to t=165?

조회 수: 1 (최근 30일)
Chukwunememma Uponi
Chukwunememma Uponi 2019년 11월 29일
답변: Star Strider 2019년 11월 29일
mi=2290000;
mf=130000;
tb=165;
t=linspace(6.5,165);
mr=mi-((mi-mf)*(t/tb))
plot(t,mr, 'blue')
hold all
g = 9.81;
Isp=263;
u=g.*(Isp.*log(mi./mr)-t)

채택된 답변

Star Strider
Star Strider 2019년 11월 29일
I am not certain what you want to integrate, or what you want the final result to be.
Try this:
mi=2290000;
mf=130000;
tb=165;
t = linspace(0, tb, 150);
mr = mi-((mi-mf)*(t/tb));
mr_int = cumtrapz(t, mr); % Integrate ‘mr’
figure
semilogy(t,mr, 'blue')
hold on
plot(t, mr_int, 'g')
g = 9.81;
Isp=263;
u = g.*(Isp.*log(mi./mr)-t);
u_int = cumtrapz(t, u); % Integrate ‘u’
plot(t, u)
plot(t, u_int)
hold off
legend('mr', 'mr\_int', 'u', 'u\_int', 'Location','SE')
I ploltted the vectors in semilogy so they would all be visible.
Experiment to get different results.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by