CODE
% Method of false position
% Given constants
L = 5;
C = 10^(-4);
t = 0.05;
qq0 = 100; % q0/q
f=@(R) qq0 * exp(-R*t/2/L) * cos( t * ( (1 / (L*C)) - (R /2/L
)^2)^(0.5)) - 1 ;
err=1; %initial large error
tu = 400; %upper bound
tl = 0; %lower bound
fu = f(tu); %initial values
fl = f(tl);
i=0; % for counting iterations
while err > 10^(-5)
tr = tl -fl*(tu - tl)/(fu-fl); % false method formulation
fr = f(tr);
if sign(fr) == sign(fu) %checking the change of signs
tu=tr;
fu=fr;
else
tl= tr;
fl=fr;
end
err = abs(fr);
i=i+1;
end
fprintf('R of the equation by False-Position Method is found in %d
iterations is %4.6f.\n',i,tr);
SCREENSHOTS


Please go through above code and message me if you have any doubts.
Give me thumbs up. Thanks
1. A typical electrical engineering design problem might involve determining the proper resistor to dissipate energy at a specified rate, with known values for L and C. For this problem, assume t...