Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using the fsolve function of SCILAB (not MATLAB) to Solve - Problem 2 Figure P8.

ID: 1846029 • Letter: U

Question

Using the fsolve function of SCILAB (not MATLAB) to Solve - Problem 2

Figure P8.32 shows a circuit with a resistor, an inductor, and a capacitor in parallel. Kirchhoff's rules can be used to express the impedance of the system as where Z = impedance (ohm) and omega = the angular frequency. Find the omega that results in an impedance of 75 (ohm) using both bisection and false position with initial guesses of 1 and 1000 for the following parameters: R = 225 ohm, C = 0.6 10-6 F, and L = 0.5 H. Determine how many iterations of each technique are necessary to determine the answer to s = 0.1%. Use the graphical approach to explain any difficulties that arise. Solve the problem using the function fzero in Matlab, or fsolve in Scilab.

Explanation / Answer

r=225;

c=0.6e-6;

l=0.5;

a=1;

b=1000;

f=sqrt((1/r^2)+(a*c-(1/(a*l)))^2)-(1/75);

if f<0

flag=0;

else flag=1;

end

count=0;

err=0.1;

while abs(err)>=0.001

count=count+1;

w=(a+b)/2;

f=sqrt((1/r^2)+(w*c-(1/(w*l)))^2)-(1/75);

if flag==0

if f<0

a=w;

else

b=w;

end

end

if flag==1

if f>0

a=w;

else

b=w;

end

end

  

  

err=f;

end

disp(a)

disp(b)

x=['frequency is ',num2str(w)];

disp(x)

y=['number of iterations required are ',num2str(count)];

disp(y)