File: controls.dem

package info (click to toggle)
gnuplot 4.6.0-8
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 16,920 kB
  • sloc: ansic: 84,661; cpp: 6,631; lisp: 5,013; makefile: 2,129; sh: 1,092; objc: 647; asm: 539; perl: 298; awk: 235; pascal: 194; csh: 179; tcl: 88; python: 46
file content (27 lines) | stat: -rw-r--r-- 702 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#
# $Id: controls.dem,v 1.3 1999/10/17 19:16:58 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