Runge Kutta

7
Abellar, Rodgie John Aries, Allen Jerry Borlan, Randolph Yanson, Edsel Problem: A well stirred storage vessel contains 10000 kg of solution of a dilute methanol solution (w A = 0.05 mass fraction alcohol). A constant flow of 500 kg/min. of pure water is suddenly introduced into the tank and a constant rate of withdrawal of 500 kg/min is started. These two flows are continued and remain constant. Assuming that the densities of the solutions are the same and that the total contents of the tank remain constant at 10,000 kg of solution, calculate the time for the alcohol content to drop to 1wt%. Solution: Methanol Balance: dQ dt =Q ¿ Q out Q ¿ = 0, no Methanol entering the vessel dQ dt =−Q out d( 10,000 w A ) dt =−500 w A 10,000 dw A dt =−500 w A dw A dt =−0.05 w A ˙ ˙ m ¿ =500 kg / min Pure water ˙ ˙ m out =500 kg / min Methanol 10,000 kg Methanol Solution, w A,0 = 0.05

description

solving a mixing problem using a numerical method

Transcript of Runge Kutta

Page 1: Runge Kutta

Abellar, Rodgie JohnAries, Allen JerryBorlan, RandolphYanson, Edsel

Problem:

A well stirred storage vessel contains 10000 kg of solution of a dilute methanol solution (wA = 0.05 mass fraction alcohol). A constant flow of 500 kg/min. of pure water is suddenly introduced into the tank and a constant rate of withdrawal of 500 kg/min is started. These two flows are continued and remain constant. Assuming that the densities of the solutions are the same and that the total contents of the tank remain constant at 10,000 kg of solution, calculate the time for the alcohol content to drop to 1wt%.

Solution:

Methanol Balance:

dQdt

=Q¿−Qout

Q¿=0, no Methanol entering the vessel

dQdt

=−Qout

d (10,000wA )dt

=−500wA

10,000d wAdt

=−500wA

d wAdt

=−0.05wA

Analytical Solution:

d wAw A

=−0.05dt

∫w A,0

wA d wAwA

=−0.05∫0

t

dt

˙m¿=500kg/min

Pure water

˙mout=500 kg/min

Methanol Solution

10,000 kg Methanol Solution, wA,0 = 0.05

Page 2: Runge Kutta

Abellar, Rodgie JohnAries, Allen JerryBorlan, RandolphYanson, Edsel

lnwAwA ,0

=−0.05t

t=lnw A

wA ,0−0.05

t=ln

0.010.05

−0.05

t=32. 19min .

The particular solution to the DE is w A=0.05e−0.05 t.

Numerical Solution (Runge-Kutta Method):

d wAdt

=−0.05wA

Letd wAdt

=f (w A ),

f (wA )=−0.05wA

For an accurate result, we take h=0.5

With the aid of MS Excel:

n t wA k1 k2 k3 k4 wA+10 0.0 0.050000 -0.001250 -0.001234 -0.001235 -0.001219 0.0487651 0.5 0.048765 -0.001219 -0.001204 -0.001204 -0.001189 0.0475612 1.0 0.047561 -0.001189 -0.001174 -0.001174 -0.001160 0.0463873 1.5 0.046387 -0.001160 -0.001145 -0.001145 -0.001131 0.0452424 2.0 0.045242 -0.001131 -0.001117 -0.001117 -0.001103 0.0441255 2.5 0.044125 -0.001103 -0.001089 -0.001090 -0.001076 0.0430356 3.0 0.043035 -0.001076 -0.001062 -0.001063 -0.001049 0.0419737 3.5 0.041973 -0.001049 -0.001036 -0.001036 -0.001023 0.0409378 4.0 0.040937 -0.001023 -0.001011 -0.001011 -0.000998 0.0399269 4.5 0.039926 -0.000998 -0.000986 -0.000986 -0.000973 0.038940

10 5.0 0.038940 -0.000974 -0.000961 -0.000961 -0.000949 0.03797911 5.5 0.037979 -0.000949 -0.000938 -0.000938 -0.000926 0.03704112 6.0 0.037041 -0.000926 -0.000914 -0.000915 -0.000903 0.03612613 6.5 0.036126 -0.000903 -0.000892 -0.000892 -0.000881 0.03523414 7.0 0.035234 -0.000881 -0.000870 -0.000870 -0.000859 0.03436415 7.5 0.034364 -0.000859 -0.000848 -0.000849 -0.000838 0.03351616 8.0 0.033516 -0.000838 -0.000827 -0.000828 -0.000817 0.03268817 8.5 0.032688 -0.000817 -0.000807 -0.000807 -0.000797 0.03188118 9.0 0.031881 -0.000797 -0.000787 -0.000787 -0.000777 0.03109419 9.5 0.031094 -0.000777 -0.000768 -0.000768 -0.000758 0.03032720 10.0 0.030327 -0.000758 -0.000749 -0.000749 -0.000739 0.029578

Page 3: Runge Kutta

Abellar, Rodgie JohnAries, Allen JerryBorlan, RandolphYanson, Edsel

21 10.5 0.029578 -0.000739 -0.000730 -0.000730 -0.000721 0.02884722 11.0 0.028847 -0.000721 -0.000712 -0.000712 -0.000703 0.02813523 11.5 0.028135 -0.000703 -0.000695 -0.000695 -0.000686 0.02744124 12.0 0.027441 -0.000686 -0.000677 -0.000678 -0.000669 0.02676325 12.5 0.026763 -0.000669 -0.000661 -0.000661 -0.000653 0.02610226 13.0 0.026102 -0.000653 -0.000644 -0.000645 -0.000636 0.02545827 13.5 0.025458 -0.000636 -0.000628 -0.000629 -0.000621 0.02482928 14.0 0.024829 -0.000621 -0.000613 -0.000613 -0.000605 0.02421629 14.5 0.024216 -0.000605 -0.000598 -0.000598 -0.000590 0.02361830 15.0 0.023618 -0.000590 -0.000583 -0.000583 -0.000576 0.02303531 15.5 0.023035 -0.000576 -0.000569 -0.000569 -0.000562 0.02246632 16.0 0.022466 -0.000562 -0.000555 -0.000555 -0.000548 0.02191233 16.5 0.021912 -0.000548 -0.000541 -0.000541 -0.000534 0.02137134 17.0 0.021371 -0.000534 -0.000528 -0.000528 -0.000521 0.02084335 17.5 0.020843 -0.000521 -0.000515 -0.000515 -0.000508 0.02032836 18.0 0.020328 -0.000508 -0.000502 -0.000502 -0.000496 0.01982737 18.5 0.019827 -0.000496 -0.000489 -0.000490 -0.000483 0.01933738 19.0 0.019337 -0.000483 -0.000477 -0.000477 -0.000471 0.01886039 19.5 0.018860 -0.000471 -0.000466 -0.000466 -0.000460 0.01839440 20.0 0.018394 -0.000460 -0.000454 -0.000454 -0.000448 0.01794041 20.5 0.017940 -0.000448 -0.000443 -0.000443 -0.000437 0.01749742 21.0 0.017497 -0.000437 -0.000432 -0.000432 -0.000427 0.01706543 21.5 0.017065 -0.000427 -0.000421 -0.000421 -0.000416 0.01664444 22.0 0.016644 -0.000416 -0.000411 -0.000411 -0.000406 0.01623345 22.5 0.016233 -0.000406 -0.000401 -0.000401 -0.000396 0.01583246 23.0 0.015832 -0.000396 -0.000391 -0.000391 -0.000386 0.01544147 23.5 0.015441 -0.000386 -0.000381 -0.000381 -0.000376 0.01506048 24.0 0.015060 -0.000376 -0.000372 -0.000372 -0.000367 0.01468849 24.5 0.014688 -0.000367 -0.000363 -0.000363 -0.000358 0.01432550 25.0 0.014325 -0.000358 -0.000354 -0.000354 -0.000349 0.01397251 25.5 0.013972 -0.000349 -0.000345 -0.000345 -0.000341 0.01362752 26.0 0.013627 -0.000341 -0.000336 -0.000336 -0.000332 0.01329053 26.5 0.013290 -0.000332 -0.000328 -0.000328 -0.000324 0.01296254 27.0 0.012962 -0.000324 -0.000320 -0.000320 -0.000316 0.01264255 27.5 0.012642 -0.000316 -0.000312 -0.000312 -0.000308 0.01233056 28.0 0.012330 -0.000308 -0.000304 -0.000304 -0.000301 0.01202557 28.5 0.012025 -0.000301 -0.000297 -0.000297 -0.000293 0.01172958 29.0 0.011729 -0.000293 -0.000290 -0.000290 -0.000286 0.01143959 29.5 0.011439 -0.000286 -0.000282 -0.000282 -0.000279 0.01115760 30.0 0.011157 -0.000279 -0.000275 -0.000275 -0.000272 0.01088161 30.5 0.010881 -0.000272 -0.000269 -0.000269 -0.000265 0.01061262 31.0 0.010612 -0.000265 -0.000262 -0.000262 -0.000259 0.01035063 31.5 0.010350 -0.000259 -0.000256 -0.000256 -0.000252 0.01009564 32.0 0.010095 -0.000252 -0.000249 -0.000249 -0.000246 0.009846

Interpolating the 63rd and 64th iteration for w A=0.01approximately gives t=32.00min .

The time for the ethanol content in the tank to drop to 1wt. % is 32.2 min (by means of analytical solution) or approximately 32.0 min (Runge-Kutta, h=0.5).