MATLAB program: plotting differential equation

조회 수: 4 (최근 30일)
Andy.P
Andy.P 2021년 11월 29일
편집: Andy.P 2021년 12월 1일
Compute the new velocity and acceleration of the aircraft after a change in power level. During a test flight, the test pilot has set the engine power at 50,000 Newtons, which causes the 20,000 Kg aircraft to attend a cruise speed of 250 m/s. The engine throttles are then set to a power level at 80,000 Newtons, and then the aircraft begins to accelerate. The differential equation that determines the acceleration of the aircraft is dv/dt = a(v,t) = T/m - 0.00005v^2
T = thrust level in Newtons (80,000 Newtons)
m = mass in Kg (20,000 Kg)
  댓글 수: 1
Steven Lord
Steven Lord 2021년 11월 29일
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.

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

답변 (1개)

Image Analyst
Image Analyst 2021년 11월 29일
편집: Image Analyst 2021년 11월 29일
Here's a start
T1 = 50000; % Initial thrust.
T2 = 80000; % Second thrust.
m = 20000;
v1 = 250; % Initial velocity.
% Note v2 = v1 + a * t, and a(t) = T2/m - 0.00005v(t)^2 (the stated formula)
v2 = v1;
for t = 2 : 40
a = T2/m - 0.00005 * v2(t-1)^2;
v2(t) = v2(t-1) + a * t;
end
plot(v2, 'b-', 'LineWidth', 2)
grid on;
xlabel('Time')
ylabel('Velocity')
  댓글 수: 2
Andy.P
Andy.P 2021년 11월 30일
편집: Andy.P 2021년 11월 30일
Great and how come you did * v2 ( t -1 ) ^ 2. Why t - 1 ?
Also do you integrate dv/dt ?
Image Analyst
Image Analyst 2021년 11월 30일
Let's say that you have the last (past) time point, and you have a (future/next) time point that you want to compute. The acceleration cannot depend on the next velocity value -- you don't know that velocity yet! So you have to compute the acceleration based on the only velocity you know, which is the last velocity.
I didn't do any integration or differentiation. It was just strictly digital algebra. If you want/need to integrate some curve you can use trapz(), sum(), or maybe integrate().

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

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by