Sysquake Remote Live
Unforced Dynamic Response
This pages reproduces the script of Fig. 2.38 of
Dorf and Bishop 98 (p. 81), with a few additional
lines of code to let you change parameters.
Source code
Here is the code inserted in the file stored on the server. If you look at
the source of this page in your browser, you will see only the HTML code
produced by Sysquake Remote.
<?sqr
y0 = 0.15; wn = sqrt(2);
zeta1 = 2 / (2 * sqrt(2)); zeta2 = 1 / (2 * sqrt(2));
t = [0:0.1:10];
%%% a few lines added to permit the visitor to enter other parameters
use sqr;
format = ['y0: %{8}n\n',...
'wn: %{8}n\n',...
'zeta1: %{8}n > 1 (overdamping)\n',...
'zeta2: %{8}n < 1 (underdamping)\n',...
'%{Revert}R%{Update}S'];
names = {'y0', 'wn', 'zeta1', 'zeta2'};
s0 = struct('y0',y0, 'wn',wn, 'zeta1',zeta1, 'zeta2',zeta2);
s = processhtmlform(format, names, s0);
s.zeta1 = max(s.zeta1, 1.001); % must be > 1
s.zeta2 = min(s.zeta2, 0.999); % must be < 1
displayhtmlform(format, names, s, 'GET');
y0 = s.y0; wn = s.wn; zeta1 = s.zeta1; zeta2 = s.zeta2;
zeta2 = min(zeta2, 1); % must not be larger than 1
%%%
t1 = acos(zeta1) * ones(1, length(t));
t2 = acos(zeta2) * ones(1, length(t));
c1 = (y0 / sqrt(1-zeta1^2)); c2 = (y0 / sqrt(1-zeta2^2));
y1 = c1 * exp(-zeta1 * wn * t) .* sin(wn * sqrt(1-zeta1^2) * t + t1);
y2 = c2 * exp(-zeta2 * wn * t) .* sin(wn * sqrt(1-zeta2^2) * t + t2);
bu = c2 * exp(-zeta2 * wn * t); bl = -bu;
beginfigure('size', [400, 300]);
plot(t, y1, 'K'); plot(t, y2, 'B');
plot(t, bu, ':'); plot(t, bl, ':');
label('t [s]', 'y(t)');
str = sprintf('overdamped zeta1=%.3g\nunderdamped zeta2=%.3g', ...
zeta1, zeta2);
legend(str, 'KB');
endfigure;
?>
Reference
R.C. Dorf and R.H. Bishop, Modern Control Systems, 8th ed.
Addison Wesley Longman, Menlo Park, CA, 1998.
|