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

2 次查看(过去 30 天)
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