Question: USE MATLAB please!! PROBLEM 1 In real life we are never given a differential equation to solve. We must find the differential equation based on

USE MATLAB please!! PROBLEM 1 In real life we are never givenUSE MATLAB please!!

PROBLEM 1 In real life we are never given a differential equation to solve. We must find the differential equation based on what we know about the process and physical laws. Let's look at the tank problem that we did in Week 8, but this time with a slight twist. Two tanks with capacities of 10 liters initially contain 2 grams of salt and 1 liter of water. Water containing 1 g/L of salt enters the first tank at a rate of 2 L/hour, and the well-mixed solution flows out of the first tank into the second tank at a rate equivalent to the volume of the first (i.e., Vi L/Hr). None of the brine flows out of the second tank. (1) Model the problem for the volume in liters as an IVP(s) and by using ode45 (for MATLAB) or solve_ivp (for Python) solve the IVP (ODE + IC) for the volume of water in the tanks. Solve from time t=0 to t= 6 with At 0.01. Save the volume of the first tank at each time as a 601 x 1 column vector named A1 and the volume of the second tank at each time as a 601 x 1 column vector named A2. (2) At what time to the nearest integer does the water start overflowing (hint: use the round function)? Save this integer value as A3. And which tank does it overflow from? Save this integer value as A4. (3) Model the problem for the amount of salt in grams as an IVP(s) and by using ode45 (for MATLAB) or solve_ivp (for Python) solve the IVP (ODE + IC) for the amount of salt in the tanks. Solve from time t = 0 tot 6 with At = 0.01. Save the amount of salt of the first tank at each time as a 601 x 1 column vector named A5 and the amount of salt of the second tank at each time as a 601 x 1 column vector named A6. (4) What is the salt concentration when tank in part (b) is completely full of brine? Save this salt concentration (remember it's amount/volume) as A7. PROBLEM 1 In real life we are never given a differential equation to solve. We must find the differential equation based on what we know about the process and physical laws. Let's look at the tank problem that we did in Week 8, but this time with a slight twist. Two tanks with capacities of 10 liters initially contain 2 grams of salt and 1 liter of water. Water containing 1 g/L of salt enters the first tank at a rate of 2 L/hour, and the well-mixed solution flows out of the first tank into the second tank at a rate equivalent to the volume of the first (i.e., Vi L/Hr). None of the brine flows out of the second tank. (1) Model the problem for the volume in liters as an IVP(s) and by using ode45 (for MATLAB) or solve_ivp (for Python) solve the IVP (ODE + IC) for the volume of water in the tanks. Solve from time t=0 to t= 6 with At 0.01. Save the volume of the first tank at each time as a 601 x 1 column vector named A1 and the volume of the second tank at each time as a 601 x 1 column vector named A2. (2) At what time to the nearest integer does the water start overflowing (hint: use the round function)? Save this integer value as A3. And which tank does it overflow from? Save this integer value as A4. (3) Model the problem for the amount of salt in grams as an IVP(s) and by using ode45 (for MATLAB) or solve_ivp (for Python) solve the IVP (ODE + IC) for the amount of salt in the tanks. Solve from time t = 0 tot 6 with At = 0.01. Save the amount of salt of the first tank at each time as a 601 x 1 column vector named A5 and the amount of salt of the second tank at each time as a 601 x 1 column vector named A6. (4) What is the salt concentration when tank in part (b) is completely full of brine? Save this salt concentration (remember it's amount/volume) as A7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!