Post Reply 
(48G 49G 50G) Runge-Kutta Diff Eqn solver
06-07-2021, 07:52 AM (This post was last modified: 06-07-2021 09:22 AM by Werner.)
Post: #5
RE: 48G-50G Runge-Kutta Diff Eqn solver
Having never used the differential equation solver in the 49/50, I had to look up how to use it.
Given Y' = F(X,Y), with X the independent and Y the dependent variable, it expects an equation or a program to return the value of Y', given X and Y.
In your case, you have a second-order Diff.Eq
y' = v
v' = g - k*v^2
that we'll rewrite as a first-order one:
U' = F(U,t)
with U = [ y v ]
and F(U,t) = [ v g-k*v^2 ]
Instead of an equation for F, the calculator also accepts a program, so all we need to do
is write one that will return [ v g-k*v^2 ] from U = [ y v ]

Code:
\<<
  U 2. GET
  g OVER SQ k * - \->NUM
  2. \->ARRY
\>>

Seeing that the program is very small, just type it in your 50g, without the backslashes ;-)
Store the program in the reserved variable EQ, fire up the num. solver, diff eq.
The program is shown as 'F', enter indep. var' t' and soln 'U' and all the other parameters, and SOLVE. Should work.

Update: two more remarks
- the equation should be v' = -g - k*v^2 (you're falling down, no?)
- the inital value for U must be given as a 1x2 vector [ y0 v0 ] eg [ 1000. 0. ] so falling from 1000m high, initial velocity 0. m/s
Solving for Final will then give the final value of U [ vf vf' ]

Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: 48G-50G Runge-Kutta Diff Eqn solver - Werner - 06-07-2021 07:52 AM



User(s) browsing this thread: 1 Guest(s)