## Question:

A water tank is schedule for maintenance. To do that, the water inside the tank need to be emptied through the drain pipe. The water level in the tank can be expressed by Equation 1. dH(t) dt =-129 (6) VH(t) 62 (Eq.1) Estimate the time to empty the tank using suitable numerical method. H(t) is the water level at a time t (sec), D = tank diameter (2 ft), d = drain pipe diameter (1/12 ft) and g = gravitational acceleration (32.2 ft/sec). The initial water level, Ho = 2 ft. How accurate is your estimation with the real answer? (hint: calculate the error). = 2VH-2.8284 (D2 Check with the real answer: t = d2 V29

## Answer:

## Estimating the Time to Empty the Water Tank

We can estimate the time to empty the water tank using the **Runge-Kutta method**, a numerical method for solving differential equations. Here’s how:

**1. Define the Variables:**

- H(t): Water level at time t (ft)
- t: Time (sec)
- H_0: Initial water level (2 ft)
- D: Tank diameter (2 ft)
- d: Drain pipe diameter (1/12 ft)
- g: Gravitational acceleration (32.2 ft/sec^2)

**2. Discretize the Equation:**

We need to convert the continuous differential equation (Eq.1) into a discrete form suitable for numerical calculations. We can do this by dividing the time interval into smaller steps and approximating the derivative at each step using the Runge-Kutta method.

Let’s choose a time step of Δt (e.g., Δt = 0.1 seconds). Then, the water level at time t + Δt can be estimated using the following formula:

H(t + Δt) = H(t) + Δt * f(t, H(t))

where f(t, H(t)) is the right-hand side of Eq.1 evaluated at time t and water level H(t).

**3. Implement the Runge-Kutta Method:**

The Runge-Kutta method involves calculating four intermediate values based on f(t, H(t)) and using them to update the water level at each step. Here’s the fourth-order Runge-Kutta (RK4) method:

```
k1 = f(t, H(t)) Δt
k2 = f(t + Δt/2, H(t) + k1/2) Δt
k3 = f(t + Δt/2, H(t) + k2/2) Δt
k4 = f(t + Δt, H(t) + k3) Δt
H(t + Δt) = H(t) + (k1 + 2*k2 + 2*k3 + k4) / 6
```

**4. Calculate the Time to Empty the Tank:**

Start with the initial water level H(0) = H_0. Use the RK4 method to calculate the water level at each time step until H(t) becomes very close to 0. The time at the last step will be your estimated time to empty the tank.

**5. Estimate the Error:**

Compare your estimated time with the actual time (if known) to calculate the error. You can use the following formula:

Error = |Estimated time – Actual time| / Actual time

**Note:** This is a simplified solution. The accuracy of your estimate depends on the chosen time step and method. You might need to experiment with different time steps and methods to improve the accuracy.

I hope this helps! If you need further assistance with the calculations or have any questions, feel free to ask.