📄 e693.m
字号:
%------------------------------------------------------------------------
% Example 6.9.3: Maximum Power Extraction
%------------------------------------------------------------------------
% Initialize
clc % clear screen
clear % clear variables
global R % used by funf693.m
a = 0; % lower limit
b = 10; % upper limit
x0 = 2; % initial guess
tol = 1.e-4; % error tolerance
m = 500; % maximum number of iterations
% Find optimal load resistance
fprintf ('Example 6.9.3: Maximum Power Extraction\n');
[x,ev,k] = dfp (x0,tol,1,m,'funf693');
show ('Load Resistance R (ohm)',x);
% Compute power dissipated
[i,k] = bisect (0,2*x,tol,m,'funp693');
show ('Current I (A)',i)
show ('Power Delivered P (watt)',-funf693(x))
% Plot objective function
graphfun (a,b,'Objective Function','x','f(x)','funf693')
%------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -