## Heat Transfer Control

We consider the transient heat transfer problem across a slab of thickness 1 and conductivity k=1 shown in Example 1 of pde solver function PDSOLVE. The slab is insulated at the right side, x=1, and is initially at 0 degrees. At time equals 0, the left side of the slab, x=0, is brought to 100 degrees. The simulation below shows that the right side of the slab reaches approximately 89.2 degrees after 1 second.

#### Objective

Our target temperature for the right side of the slab after 1 second is 75 degrees. In this exercise, we will compute the initial condition that will produce the target temperature.

We solve the heat equation for the following configuration

$\frac{\partial u}{\partial t}=k\frac{{\partial }^{2}u}{\partial {x}^{2}}$
Time period t ∈ [0,1] 0 ≤ x ≤ 1 k = 1 ${u}_{x}\left(1,t\right)=0$

### Solution

To be able to control the initial value, we introduce a variable p with initial value of 100 and define a parametrized initial value formula for u, and left boundary condition formula as shown in Table 1. We obtain the initial solution, shown in Table 2, be evaluating the array formula =PDSOLVE(B8, B2:B6, C8,D8, {0,1}, {0,1,2}) in array G8:J30.

Variables with initial values Parameters Equations Left Bc Right Bc A B C D 1 2 t k 1 3 x p 100 4 u =IF(x=0,p,0) 5 ux 6 uxx 7 8 du/dt =k*uxx =u-p =ux

 G H I J 8 t 0 0.5 1 9 x u u u 10 0 100 100 100 11 0.05 0 97.09061 99.15264 12 0.1 0 94.19917 98.31051 13 0.15 0 91.34352 97.47881 14 0.2 0 88.54128 96.66268 15 0.25 0 85.80973 95.86714 16 0.3 0 83.16573 95.09712 17 0.35 0 80.62557 94.35736 18 0.4 0 78.20491 93.65242 19 0.45 0 75.91868 92.98665 20 0.5 0 73.78095 92.36414 21 0.55 0 71.8049 91.78874 22 0.6 0 70.00271 91.26397 23 0.65 0 68.38546 90.79306 24 0.7 0 66.96312 90.37892 25 0.75 0 65.74445 90.02409 26 0.8 0 64.73694 89.73074 27 0.85 0 63.94682 89.50069 28 0.9 0 63.37894 89.33534 29 0.95 0 63.03681 89.23573 30 1 0 62.92253 89.20245

Next, we define a simple constraint in C1 which calculates the difference between the value of J30 of Table 2 which corresponds to u(1,1) and the target value of 75. To solve for the design variable p, we evaluate the formula =NLSOLVE(C1, p) in cell C2. The result shown in Table 3 indicates that the initial left surface temperature should be at approximately 84.0785 in order for the right side temperature to reach 75 in one second.

 C 1 =DYNVAL(J24)-75 2 =NLSOLVE(C1,p)
 C 1 14.20224037 2 84.07859699

Note that we use DYNVAL to select J24 from the solution array because we want to use its dynamic value during the optimization.

Please note. DYNVAL is a new function available in ExceLab 7.0 and later versions only. It replaces deprecated Criterion Functions used in earlier versions.

Question or Comment? Email us:
support @ excel-works.com ExceLab: Transforming Excel into a Calculus Power House

ExceLab functions and methods are protected by USA Patents 10628634, 10114812, 9892108 and 9286286.