# Runge-Kutta Method

Problem 1

1. Write an Matlab m-file to solve this problem with Runge-Kutta method. Solve the concentration of T1 and T2 (or salt content) as function of time (up to 100 minutes). Both T1 and T2 are mixing tanks (assume immediate mixing). T1's capacity is 100 gallon and T2's capacity is 200 gallon. Initially, T1 contains full tank of salt solution which has 100 pounds of salt, T2 has full tank of pure water. When the input valve on T1 is turned on, the input flow rate (F1) is 10 gallon per minute with concentration of salt 0.6 pound per gallon flows into T1, and 15 gallons per minute (R1) of solution flows into T2, and 5 gallons per minute of solution flows from T2 to T1 (R2), and 20 gallons of solution (R3) flows out of T2. Also there is input (F2) flows into T2 at 10 gallons per minute. F2's concentration is 1 pound per gallon.

Â© BrainMass Inc. brainmass.com October 2, 2022, 6:46 am ad1c9bdddfhttps://brainmass.com/engineering/manufacturing-engineering/runge-kutta-method-548485

## SOLUTION This solution is **FREE** courtesy of BrainMass!

Dear student,

This problem is about dynamic of amount of salt flowing through the solution in two compartment (two tank) system. This dynamic system can be solved by Runge-Kutta method using ode45 solver in MATLAB programing. The Matlab code is attached with this post. Doc file named "548485_Problem 1_Solutin_updated.docx" explains the solution thoroughly, it also contains solution output as a figure showing plot between salt concentration vs. time. Matlab programs are written in m-files attached with this post which are named as "ftank.m" and "tank_sys.m". File "tank_sys.m" gives solution in terms of graph in figure-1 by using ode45 solver and "ftank.m" is a function file which describes right side of both eq.1 and eq.2 to be solved by ode45. Add all values of parameters in "tank_sys.m" file as explained in the comments of that file. In order to get the solution, run the program file "tank_sys.m" while keeping both files "ftank.m" and "tank_sys.m" in the same folder.

All the best.

BK

Note:

(1) Remember that use of copy-pasted solution is plagiarism.

(2) Do complete some necessary points in MATLAB CODE by yourself as per your requirements.

(3) Do not hesitate to ask if you still have any doubt regarding this post.

(4) After complete review give expert rating according to your satisfaction.

https://brainmass.com/engineering/manufacturing-engineering/runge-kutta-method-548485