📄 runsteamcondenser.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"><html xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!--This HTML is auto-generated from an M-file.To make changes, update the M-file and republish this document. --> <title>runsteamcondenser</title> <meta name="generator" content="MATLAB 7.5"> <meta name="date" content="2008-01-24"> <meta name="m-file" content="runsteamcondenser"><style>body { background-color: white; margin:10px;}h1 { color: #990000; font-size: x-large;}h2 { color: #990000; font-size: medium;}/* Make the text shrink to fit narrow windows, but not stretch too far in wide windows. */ p,h1,h2,div.content div { max-width: 600px; /* Hack for IE6 */ width: auto !important; width: 600px;}pre.codeinput { background: #EEEEEE; padding: 10px;}@media print { pre.codeinput {word-wrap:break-word; width:100%;}} span.keyword {color: #0000FF}span.comment {color: #228B22}span.string {color: #A020F0}span.untermstring {color: #B20000}span.syscmd {color: #B28C00}pre.codeoutput { color: #666666; padding: 10px;}pre.error { color: red;}p.footer { text-align: right; font-size: xx-small; font-weight: lighter; font-style: italic; color: gray;} </style></head> <body> <div class="content"><pre class="codeinput"><span class="comment">% function runsteamcondenser</span><span class="comment">% RUNSTEAMCONDENSER Examples to show how to use the steam condenser model.</span><span class="comment">% By Yi Cao at Cranfield University on 24 January 2008</span><span class="comment">% Example 1</span></pre><pre class="codeinput">K=10.8; <span class="comment">% PID controller gain</span>TI=2.56; <span class="comment">% PID controller integral time constant</span>TD=0; <span class="comment">% PID controller derivative time constant</span>u=0; <span class="comment">% zero for closed loop simulation</span>sim(<span class="string">'SteamCondenser'</span>) <span class="comment">% run the model</span><span class="keyword">for</span> k=1:4 <span class="comment">% plot results</span> subplot(4,1,k); plot(y.time,y.signals(k).values,<span class="string">'linewidth'</span>,2) title(y.signals(k).title) grid<span class="keyword">end</span>xlabel(<span class="string">'time, s'</span>)</pre><img vspace="5" hspace="5" src="runsteamcondenser_01.png"> <pre class="codeinput"><span class="comment">%Example 2</span><span class="comment">% To tune the PID controller through the process reaction curve approach</span>K=0;TI=1;TD=0; <span class="comment">% make the system open loop</span>u=1; <span class="comment">% size od step input test</span>sim(<span class="string">'SteamCondenser'</span>) <span class="comment">% run open loop test</span>[Kp,tau,td]=ReactionCurve(y.time,y.signals(4).values); <span class="comment">% Reaction curve</span>td=td-10; <span class="comment">% adjust time delay from the step test starting time</span>K=-(0.9/Kp)*(tau/td); <span class="comment">% PID tuning based on reaction curve</span>TI=3.3*td;u=0; <span class="comment">% closed-loop without test input</span>sim(<span class="string">'SteamCondenser'</span>) <span class="comment">% run closed-loop test</span><span class="keyword">for</span> k=1:4 <span class="comment">% plot results</span> subplot(4,1,k); plot(y.time,y.signals(k).values,<span class="string">'linewidth'</span>,2) title(y.signals(k).title) grid<span class="keyword">end</span>xlabel(<span class="string">'time, s'</span>)</pre><img vspace="5" hspace="5" src="runsteamcondenser_02.png"> <p class="footer"><br> Published with MATLAB® 7.5<br></p> </div> <!--##### SOURCE BEGIN #####% function runsteamcondenser
% RUNSTEAMCONDENSER Examples to show how to use the steam condenser model.
% By Yi Cao at Cranfield University on 24 January 2008
% Example 1
%%
K=10.8; % PID controller gain
TI=2.56; % PID controller integral time constant
TD=0; % PID controller derivative time constant
u=0; % zero for closed loop simulation
sim('SteamCondenser') % run the model
for k=1:4 % plot results
subplot(4,1,k);
plot(y.time,y.signals(k).values,'linewidth',2)
title(y.signals(k).title)
grid
end
xlabel('time, s')
%%
%Example 2
% To tune the PID controller through the process reaction curve approach
K=0;TI=1;TD=0; % make the system open loop
u=1; % size od step input test
sim('SteamCondenser') % run open loop test
[Kp,tau,td]=ReactionCurve(y.time,y.signals(4).values); % Reaction curve
td=td-10; % adjust time delay from the step test starting time
K=-(0.9/Kp)*(tau/td); % PID tuning based on reaction curve
TI=3.3*td;
u=0; % closed-loop without test input
sim('SteamCondenser') % run closed-loop test
for k=1:4 % plot results
subplot(4,1,k);
plot(y.time,y.signals(k).values,'linewidth',2)
title(y.signals(k).title)
grid
end
xlabel('time, s')
##### SOURCE END #####--> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -