?? solve_diode_equation.m
字號:
function [x] = solve_diode_equation(A, B, C, x)
% Function used to solve the diode equation
% which is in the form Ae^{Bx}+x+C=0
% using the Newton-Raphson method
tolerance = 1e-25;
max_iter = 50;
iter = 0;
f = A * exp(B*x) + x + C;
while ((iter < max_iter) && (abs(f) > tolerance))
fp = A * B * exp(B*x) + 1;
x = x - f/fp;
f = A * exp(B*x) + x + C;
iter = iter + 1;
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -