Question: 1. Modify and run the VBA script to obtain the solution for t =0.1 to 10 minutes at 0.1 intervals. Provide the revised script and

1. Modify and run the VBA script to obtain the solution for t =0.1 to 10 minutes at 0.1 intervals. Provide the revised script and results as answer. ii. Modify and run the VBA script to obtain the solution for t =0.1 to 10 minutes using a new material (Heat Capacity, C = 0.09195 cal(g. C)) and density (P) = 8.9 g/cm3. Provide the revised script and results as answer. Option Explicit Sub Explicit Dim i As Integer, As Integer, np As Integer, ns As Integer Dim Te (20) As Single, dTe (20As Single, tpr (20) As Single, Tepe (20, 20) As Single Dim k As Single, dx As Single, I As Single, te As Single, tf As Single Dim tp As Single, t As Single, tend As Single, h As Single L=10 ng = 5 dx = 2 * 0.835 Te ( 0100 Te (5) - 50 te = 0.1 tf1 EP = 0.3 np = 0 tpr (np) = t For i = 0 Tons Tepe (1, np) = Teki Next 1 Do tend t + tp I tend > t Then tend te h = te DO If t + h > tend Then h = tend t Call Derivs (Te, dTe, ns, dx, k) For = 1 Tons - 1 Te(j) - Te (3) + dTeh Next 3 tt+h If t > tend Then Exit Do Loop Tip np + 1 tpr (np) - t For j - 0 To ng Tepej, np) = Te(s) Next 3 If t > tThen Exit De Loop Sheets("sheet1").Select Range("a4") - Select For i = 0 Torp ActiveCell.Value - tpr (1) For 3 = 0 Tons ActiveCell. Ofset(0, 1). Select ActiveCell.Value = Tepr (s. 1) Next 2 ActiveCell.Offset(1, -as - 1).Select Next 1 End Sub Sub Derivs (Te, die, ns, dx, k) Dim As Integer For 3 - 1 To na - 1 dTe) = t(Tel) - 1) - 2 - Tel + Tel + 1)) I dx - 2 Next 3 End Sub
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
