0% found this document useful (0 votes)
14 views6 pages

Bisection

The document describes three numerical methods: Bisection Method for determining valve opening in a flow control system, Newton-Raphson Method for finding the interface temperature in a composite wall, and False Position Method for calculating base temperature in a pin fin heat transfer scenario. Each method includes problem definitions, equations, and Python code implementations to solve the respective problems. The methods involve iterative calculations to achieve desired outcomes based on given parameters and tolerances.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views6 pages

Bisection

The document describes three numerical methods: Bisection Method for determining valve opening in a flow control system, Newton-Raphson Method for finding the interface temperature in a composite wall, and False Position Method for calculating base temperature in a pin fin heat transfer scenario. Each method includes problem definitions, equations, and Python code implementations to solve the respective problems. The methods involve iterative calculations to achieve desired outcomes based on given parameters and tolerances.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

BISECTION METHOD:

Problem 1.

For a feedback control system, a valve is controlling the water flow rate going
into a tank. The set point is for the flow rate to be 10 L/min. The system is nonlinear;
that is, the valve opening relationship to the flow rate is not a linear equation. We can
measure the actual flow rate, y, but we can't measure the water level within the tank
directly. We wish to determine the valve opening, u, such that the desired flow rate, y =
10 L/min occurs by using the bisection method. We can measure the actual flow rate, y
given some valve opening, u.

Where:

Define initial conditions:

 Set the minimum valve opening to 0% (u_min) and maximum opening to 100%
(u_max).
 Set the desired flow rate to 10 L/min (y_desired).
 Set a tolerance value for an acceptable error in the flow rate, say 0.1 L/min
(ε).Iterate until convergence:
 Calculate the midpoint valve opening (u_mid) as the average value of u_min and
u_max.
 Measure the actual flow rate (y_actual) for the midpoint valve opening (u_mid).
 Check the difference between the desired and actual flow rates:
 If |y_desired - y_actual| ≤ ε, then u_mid is a solution.\nIf y_desired < y_actual,
then the valve is overshooting the target. Update u_max to u_mid and repeat
from step 2
 If y_desired > y_actual, then the valve is undershooting the target. Update u_min
to u_mid and repeat from step 2.

Python:
CODE:

def measure_flow_rate(valve_opening):
# Simulate measurement (replace with actual sensor data)
return valve_opening * 0.8 # This is a non-linear relationship between valve opening
and flow rate

def find_valve_opening(y_desired, epsilon, u_min=0, u_max=100):


while u_max - u_min > epsilon:
u_mid = (u_min + u_max) / 2
y_actual = measure_flow_rate(u_mid)
if abs(y_desired - y_actual) <= epsilon:
return u_mid
elif y_desired < y_actual:
u_max = u_mid
else:
u_min = u_mid
return None # No solution found within tolerance

# Example usage
y_desired = 10 # L/min
epsilon = 0.1 # L/min
valve_opening = find_valve_opening(y_desired, epsilon)

if valve_opening is not None:


print("Valve opening for desired flow rate:", valve_opening, "%")
else:
print("Solution not found within tolerance.")
NEWTON RHAPSONS METHOD:

Problem 2.

A composite wall is made of a layer of brick, L1 thick with thermal conductivity k1,
and a layer of concrete, L2 thick with thermal conductivity k2. The surface on one side
of the brick, x = 0, is held at T1, while the surface on the other side of the concrete, x =
L1 + L2, is held at T2. We wish to determine the temperature, Ti, at the interface
between the brick and concrete.

Where:

Problem definition:

 Specify the thicknesses (L1, L2) and thermal conductivities (k1, k2) for the two
materials.
 Specify the constant temperatures (T1, T2) on the outer surfaces.
 We can write an equation relating the interface temperature, Ti, to the heat flux,
q, through the wall using the thermal resistances of each layer. This equation will
be nonlinear due to the temperature dependence of the thermal conductivity
(optional in more complex problems).

Specify the function and its derivative:

 Let f(Ti) be the difference of the heat flux computed from an assumed interface
temperature from the actual heat flux computed from the known temperature
difference T1 - T2.
 The derivative of f(Ti), which is the rate of change of the error with the interface
temperature.
 Apply Newton-Raphson: Guess the interface temperature, Ti_guess.
 Iterate via the equation: Ti_(n+1) = Ti_n - f(Ti_n) / f'(Ti_n)\nRepeat the iterations,
stopping when the absolute change in the interface temperature between two
steps falls below some set tolerance value, epsilon.
Python:

CODE:
def thermal_resistance(thickness, conductivity):
return thickness / conductivity

def heat_flux(T1, T2, L1, L2, k1, k2, Ti):


# Calculate total thermal resistance
R_total = thermal_resistance(L1, k1) + thermal_resistance(L2, k2)
return (T1 - T2) / R_total

def function(Ti, T1, T2, L1, L2, k1, k2):


# Simplified heat transfer equation assuming constant thermal
conductivity
q_assumed = k1 * (T1 - Ti) / L1 + k2 * (Ti - T2) / L2
# Calculate actual heat flux based on temperature difference
q_actual = (T1 - T2) / (thermal_resistance(L1, k1) +
thermal_resistance(L2, k2))
return q_assumed - q_actual

def derivative(Ti, T1, T2, L1, L2, k1, k2):


# Derivative of the function with respect to Ti (constant thermal
conductivity)
return (k1 / L1 - k2 / L2)

def find_interface_temp(T1, T2, L1, L2, k1, k2, Ti_guess, epsilon):


Ti_new = Ti_guess
while abs(Ti_new - Ti_guess) > epsilon:
Ti_guess = Ti_new
f_val = function(Ti_guess, T1, T2, L1, L2, k1, k2)
df_val = derivative(Ti_guess, T1, T2, L1, L2, k1, k2)
Ti_new = Ti_guess - f_val / df_val
return Ti_new

# Example usage
T1 = 100 # degC
T2 = 20 # degC
L1 = 0.1 # m
L2 = 0.2 # m
k1 = 0.5 # W/m-K
k2 = 1.2 # W/m-K
Ti_guess = 50 # degC (initial guess)
epsilon = 0.1 # degC (tolerance)

interface_temp = find_interface_temp(T1, T2, L1, L2, k1, k2, Ti_guess,


epsilon)

print("Interface temperature:", interface_temp, "degC")

FALSE-POSITION METHOD:

Problem 3.

The heat transfer through a pin fin with temperature-dependent thermal


conductivity, k, is solved. The base temperature, Tb, of the pin fin required to achieve a
specified heat transfer rate, Q, from the base into the surrounding air is determined
using the False Position method. The thermal conductivity, k, of the fin material varies
with temperature, which introduces nonlinearity into the governing heat transfer
equation and makes analytical solutions rather difficult to obtain.

Where:

 Set fin geometry (length, diameter), material properties (density,


specific heat), temperature of surrounding air (T∞), convection heat
transfer coefficient (h), and the desired heat transfer rate (Q).
 Make an initial relation between the thermal conductivity (k) versus
temperature (T). This might be a linear or polynomial approximation
or data from a material property table.
 Formulate the equation:Derive an equation for the heat transfer rate
(Q) in terms of the base temperature (Tb). This will involve the
integration of the temperature distribution along the fin length and
using the temperature-dependent thermal conductivity.
 Apply False Position method:\n\nDefine a function f(Tb) that
represents the difference between the calculated heat transfer rate
based on the assumed Tb and the desired heat transfer rate, Q.
 Choose two initial guesses for the base temperature, Tb1 and Tb2,
such that f(Tb1)*f(Tb2) < 0. This ensures the opposite signs for initial
function values.\nIterate using the False Position formula given as:
Tb_new = Tb1 - f(Tb1)*(Tb2-Tb1)/(f(Tb2) - f(Tb1))
 Do the iteration until the difference between consecutive base
temperatures or absolute value of f(Tb_new) becomes smaller than a
set tolerance value (epsilon).

Python:

You might also like