[BACK]Return to controls.dem CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gnuplot / demo

File: [local] / OpenXM_contrib / gnuplot / demo / Attic / controls.dem (download)

Revision 1.1.1.2 (vendor branch), Sat Jan 22 14:16:05 2000 UTC (24 years, 4 months ago) by maekawa
Branch: GNUPLOT
CVS Tags: maekawa-ipv6, VERSION_3_7_3, VERSION_3_7_1, RELEASE_20000124, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, RELEASE_1_1_3, RELEASE_1_1_2
Changes since 1.1.1.1: +3 -7 lines

Import gnuplot 3.7.1

#
# $Id: controls.dem,v 1.1.1.1.2.1 1999/10/11 13:25:20 lhecking Exp $
#
# warning:  this demo is SLOW on PCs without math coprocessors!
#
# From _Automatic_Control_Systems_, fourth ed., figure 6-14
# transient response of a second-order system to a unit step input function
#
damp(t) = exp(-s*wn*t)/sqrt(1.0-s*s)
per(t) = sin(wn*sqrt(1.0-s**2)*t - atan(-sqrt(1.0-s**2)/s))
c(t) = 1-damp(t)*per(t)
#
#	wn is natural undamped frequency
#	s is damping factor
#
wn = 1.0
set xrange [0:13]
set samples 50
set dummy t
set key box
#
# plot c(t) for several different damping factors s
#
plot s=.1,c(t),s=.3,c(t),s=.5,c(t),s=.7,c(t),s=.9,c(t),s=1.0,c(t),s=1.5,c(t),s=2.0,c(t)
pause -1 "Hit return to continue"
reset