Math. Runge-Kutta Application To A Tank Concentration. Jeff Munic
Math. Runge-Kutta Application To A Tank Concentration. Jeff Munic
Math. Runge-Kutta Application To A Tank Concentration. Jeff Munic
A brine solution containing 0.2 lb of salt/gallon of water is added at a rate of 5 gallons per minute to
a tank with 1000 gallons of pure water. The volume in the tank is maintained at a constant volume
of 1000 gallons with an overflow drain. Find the concentration change with time.
Outline
5 gpm
5 gpm
0.2 lb/gal V=1000 gal
Ms(t)
s - salt
Data Material balance
gallons per minute to Ms : Mass of salt in the tank Mass of sal entering
t a constant volume C : Salt concentration Msi =
Ci : Salt concentration in the inlet flow
Ci = 0.2 lb/gal Msi =
Co : Salt concentration in the outlet flow,
also, the salt concentration in the tank Mass of salt leaving
Mso =
V : tank volume
5 gpm V= 1000 gal Salt mass content change
Q : Flow rate in the tank
Q= 5 gal/min dMs =
dMs =
Ms(t=0) = 0 lb dMs =
dMs/dt =
rev. cjc. 03.04.2018
Msi - Mso
Q * Ci * dt - Q * C * dt
Q * (Ci - Q ) * dt
Q * (Ci - Ms/V)
Q * Ci - Q * Ms/V
Q * Ci - Q/V * Ms
1.0 lb/min
0.005 * Ms
-0.005 * Ms +1
rev. cjc. 03.04.2018
page 1 of 1
Differential equation
dMs/dt = -0.005 * Ms +1
Ln ( -0 . 005⋅M s +1 ) Ms
|=t
−0 . 005 0
Ln ( -0 . 005⋅M s +1 )|0Ms=t⋅(−0. 005 )
Ln ( -0 . 005⋅M s +1 )−Ln ( -0. 005⋅0 +1 )=t⋅(−0 . 005 )
Ln ( -0 . 005⋅M s +1 )=t⋅(−0 . 005 )
-0 . 005⋅M s +1=exp(-0. 005⋅t )
-0 . 005⋅M s =exp(-0 . 005⋅t )-1
0 . 005⋅M s =1−exp(-0 .005⋅t )
1−exp(-0. 005⋅t )
M s=
0 . 005
Microsoft Equation
3.0
rosoft Equation
3.0
Runge Kutta Method
In this application
dMs/dt = -0.005 * Ms +1
Change Function click here to insert a different function
Activate Function
Activates the change by using the function once
n t Ms dMs/dt k1 k2 k3 k4
Function RuKu(x, y)
'*****************************************************************
'CHANGE THE RIGHT SIDE OF THE FUNCTION BELOW TO ADD YOUR FUNCTION:
'*****************************************************************
End Function
1.0
0.8
Y
0.6
0.4
0.2
0.0
0 200 400 600 800 1000 1200 1400
X
f(x) = NaN ln(x) NaN
R² = NaN
Chart Title
1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0.0
0 200 400 600 8
See also
Math. Least squares method. Regressions linear, second to sixth grades parabolas and expone
7. Best fit for an exponential curve by the least squares method
Exponential curve through the N pairs of points (xn, yn)
the assumed
quite good the data
page 1 of 2
Runge Kutta
k1 = h.f(xn ,yn)
k2 = h.f(xn+h/2, yn+k1/2)
k3 = h.f(xn+h/2, yn+k2/2)
k4 = h.f(xn+h, yn+k3)
Calculation error
|et| = Abs( (yexact - ycalc) / yexact ) * 100
h= 1.5 h= 0.5
0 1400
page 2 of 2
Chart Title
R-K
http://www.chemecalcs.com/about-the-author.php
The method solves an ordinary differential equation of the form: x - independent variable
y- dependent variable
dy/dx = f(x,y) h - increment amount
parameters
with initial condition: n - subscript for each step
y(x0) = y0
k1 = h.f(xn ,yn)
k2 = h.f(xn+h/2, yn+k1/2)
k3 = h.f(xn+h/2, yn+k2/2)
k4 = h.f(xn+h, yn+k3)
RK1(x,y) = F(x,y)
To solve a 1st-order ODE problem, just change the function, input the initial conditions and
increment amount. The table can be easily expanded by copying the bottom row and pasting into
rows below.
The Runge-Kutta Runge-Kutta
Fourth-Order Method
Method is a commonly used numerical method for s
differential equations (ODEs) with a known initial condition. The metho
develops the solution to the ODE by proceeding stepwise in small incr
itself to spreadsheet calculations. This spreadsheet uses Excel's abili
functions to provide a general purpose algorithm. The user only needs
Formulas
location rather than altering formulas in an entire table.
dy/dx = f(x,y)
y(x0) = y0
k1 = h.f(xn ,yn)
k2 = h.f(xn+h/2, yn+k1/2)
k3 = h.f(xn+h/2, yn+k2/2)
k4 = h.f(xn+h, yn+k3)
RK1(x,y) = F(x,y)
To solve a 1st-order ODE problem, just change the function, input the
increment amount. The table can be easily expanded by copying the
rows below.
d numerical method for solving 1st-order ordinary
nitial condition. The method starts at a known point and
ding stepwise in small increments. The method lends
adsheet uses Excel's ability to generate user-defined
thm. The user only needs to change the function in one
ntire table. Notation