function rlc_f_newton_raphson C1 = 2e-6; C2 = 7e-6; x = C1; if (f(x)*dfdf(x)>0) x = C1; else x = C2; end for i=1:100 %x = x-f(x)/df_a(x) x = x-f(x)/df_n(x) if(abs(f(x)) < 1e-7) break; end end x i end function y = f(x) L = 20e-3; y = 500 - 1./(2*pi.*sqrt(L*x)) end function y = df_a(x) y = 0.562698./(x^(3/2)); end function y = df_n(x) dx = 1e-8; y = (f(x+dx)-f(x))/dx; end function y = dfdf(x) y = -0.844047./(x^(5/2)); end