Numerically Integrating the differential equation below?

i know some boundary conditions such as, t0= 0 and v0=7000m/s (<===newly updated v0) and vf=0.... but do not know what, tf, i equal to.

댓글 수: 4

Look like ODE. What about ode45?
I don’t really know how I can implement ode45 to this problem. I have never used it before. Any guidance on it is much appreciated!
I know the basic syntax but since t_span requires tf I do not know what I can do if I no tf.
James Tursa
James Tursa 2019년 11월 18일
편집: James Tursa 2019년 11월 18일
I'm not really sure what is being asked for here. The expressions for dr/dt and dtheta/dt are just going to be based on the integrals of your double_dot equations. What are you being asked for beyond that? The post doesn't ask for numerical solutions. Is that something you added?
Bilal Arshed
Bilal Arshed 2019년 11월 18일
편집: Bilal Arshed 2019년 11월 18일
so i need to numerically integrate both double dot equations in order to get them in the from which equals dr/dt and dtheta/dt so then i can integrate them again and have [r,theta] which i will use to plot the path taken by the reentry vehicle.
By numerically integrating it, i will have something to plot.
Also i have said v0=0 that is wrong, v0=7000ms^-1 (an arbitary choosen value)

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

 채택된 답변

James Tursa
James Tursa 2019년 11월 18일
편집: James Tursa 2019년 11월 18일
You've got two 2nd order DE's, so that means you have a 4th order system (2x2=4) and thus your state vector will contain four elements. You could define them as follows:
y = your 4x1 state vector with the following definitions
y(1) = r_r
y(2) = v_r
y(3) = r_t
y(4) = v_t
Then your derivative function outline would be:
function dy = myeqn(t, y)
% put some constants here or pass them in, e.g. mu etc.
dy = zeros(size(y));
dy(1) = y(2); % derivative of r_r is v_r
dy(2) = ___; % you fill this in from your r_r doubledot equation
dy(3) = y(4); % derivative of r_t is v_t
dy(4) = ___; % you fill this in from your r_t doubledot equation
end
For the dy(2) and dy(4) code, you will need to calculate your gamma value from the y vector. You could either hardcode the other stuff (D, L, m, etc.) or pass them in as input arguments. To start with, you will need to define initial values for all four states, not just v0. Also, I would have expected to see a factor somewhere on the r_t double dot equation based on the atmospheric density (a function of altitude), but I don't see it ... and this seems suspicious to me.

댓글 수: 2

Bilal Arshed
Bilal Arshed 2019년 11월 18일
편집: Bilal Arshed 2019년 11월 18일
thanks, it is pretty late here so i will have a look into this tommorow morning. if all goes well i will accept the answer but i might have question when i come to atmepting it.
Thank you for helping, much appreciated!
P.S what is the y vector?
Is this the vector created by combining the tangent and radial velocities?
James Tursa
James Tursa 2019년 11월 18일
편집: James Tursa 2019년 11월 18일
The y-vector is exactly what I have stated. It contains four elements as defined above. The radial position, radial velocity, tangential position, and tangential velocity.

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

추가 답변 (1개)

darova
darova 2019년 11월 18일

0 개 추천

  • Any guidance on it is much appreciated!
Helpfull page: ODE45
  • I do not know what I can do if I no tf.
Try tf = 5. This should work

댓글 수: 7

Bilal Arshed
Bilal Arshed 2019년 11월 18일
편집: Bilal Arshed 2019년 11월 18일
If tf=5 in mins or seconds because this is for the reentry of a space shuttle. If seconds then I should probably scale it up to be 5 minute equivalent no?
You can run a code only one time? Why don't just experiment?
I tried this and it, gives me this error.
Screen Shot 2019-11-18 at 22.10.49.png
Is there any connection between these red circles? Any ideas?
123.png
Please post the actual code as text that we can copy and run. We can't copy and run pictures of code.
i don't think so, that usually works just fine.
% { you can just use placeholder values for global variables like L and D.
function dv = myeqn(t, v)
mu_e = 3.986e14;
r=6378e3;
m=5000;
global L;
global D;
gamma=40; % not sure what to start at
v0=7000;
t0=0;
tend=5;
[t,v] = ode45(@myeqn, [t0,tend], v0)
dv = ((mu_e)./(r^2)) + ((v^2)./r) + (1./m)*(D*sin(gamma)+L*cos(gamma)); % radial accel equation

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

카테고리

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

태그

질문:

2019년 11월 18일

편집:

2019년 11월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by