Steady State Temperature
Steady State Temperature
The steady state temperature (T1 and T2 ) at two points (mid-point and the free end) of the one dimensional fin correspond to the minimum of the function given below. Determine the temperature T1 and T2.
Mathematical formulation:Minimize:clc; // Objective function function f=ObjectiveFunction(t) f = 0.6382*t(1)^2 + 0.3191*t(2)^2 - 0.2809*t(1)*t(2) - 67.906*t(1) - 14.29*t(2); endfunction // Initial guess x0 = [100 200]; disp(x0, "Initial guess given to the solver is ") input("Press enter to proceed: ") [xopt,fopt,exitflag,output,gradient,hessian] = fminunc(ObjectiveFunction,x0) // Result representation clc if exitflag == 0 then disp("Optimal Solution Found") disp(xopt', "The optimum solution obtained is") disp(fopt, "The optimum objective function value is") elseif exitflag == 1 then disp("Maximum Number of Iterations Exceeded. Output may not be optimal.") disp(xopt', "The solution obtained is") disp(fopt, "The objective function value is") else disp("Error encountered") end disp(output) |
Expected Output:
Optimal Solution Found The optimum solution obtained is 64.36 50.72 The optimum objective function is - 2547.72 Iterations: 2 Cpu_Time: 0.011 Objective_Evaluation: 3 Dual_Infeasibility: 1.167D-09 Message: "Optimal Solution Found" |