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

ut=k2ux2
Time period t ∈ [0,1]
Spatial range 0 ≤ x ≤ 1
Parameter k = 1
Initial condition ux,0= 100x=00else
Left boundary condition u0,t= 100
Right boundary condition ux(1,t)=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.

Table 1
ABCD
1Variables with initial valuesParameters
2tk1
3xp100
4u=IF(x=0,p,0)
5ux
6uxx
7EquationsLeft BcRight Bc
8du/dt=k*uxx=u-p=ux

Table 2
GHIJ
8t00.51
9xuuu
100100100100
110.05097.0906199.15264
120.1094.1991798.31051
130.15091.3435297.47881
140.2088.5412896.66268
150.25085.8097395.86714
160.3083.1657395.09712
170.35080.6255794.35736
180.4078.2049193.65242
190.45075.9186892.98665
200.5073.7809592.36414
210.55071.804991.78874
220.6070.0027191.26397
230.65068.3854690.79306
240.7066.9631290.37892
250.75065.7444590.02409
260.8064.7369489.73074
270.85063.9468289.50069
280.9063.3789489.33534
290.95063.0368189.23573
301062.9225389.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.

Table 3
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.

© 2015-2024, ExcelWorks LLC
Boston, USA