-
Notifications
You must be signed in to change notification settings - Fork 0
/
bodes_with_and_without_accel.py
60 lines (43 loc) · 1.43 KB
/
bodes_with_and_without_accel.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from matplotlib.pyplot import *
from scipy import *
from scipy import optimize
from numpy.linalg import inv, eig
import rwkos, rwkbode
reload(rwkbode)
import txt_data_processing, bode_utils
import control
from rwkdataproc import thresh
import sys
import copy
from IPython.core.debugger import Pdb
figure(1)
clf()
figure(2)
clf()
args1 = ('v','theta')
kwargs1 = {'seedfreq':2.45, 'seedphase':-200.0, 'label':'old data'}
args2 = ('v','a')
kwargs2 = {'fignum':2, 'seedfreq':10.0, 'seedphase':-150.0, 'label':'old data'}
myfile = txt_data_processing.Data_File('swept_sine_kp_1_amp_50.txt')
#myfile.bode_plot('v','theta',seedfreq=2.45, seedphase=-200.0, label='exp')
#myfile.bode_plot('v','a',fignum=2, seedfreq=10.0, seedphase=-150.0, label='exp')
myfile.bode_plot(*args1, **kwargs1)
myfile.bode_plot(*args2, **kwargs2)
kwargs1['clear'] = False
kwargs2['clear'] = False
myfile2 = txt_data_processing.Data_File('with_accel_01_28_14_test_1.txt')
kwargs1['label'] = 'with accel'
kwargs2['label'] = 'with accel'
args2b = ('v','accel')
myfile2.bode_plot(*args1, **kwargs1)
myfile2.bode_plot(*args2b, **kwargs2)
myfile3 = txt_data_processing.Data_File('without_accel_01_28_14_test_2.txt')
kwargs1['label'] = 'no accel'
myfile3.bode_plot(*args1, **kwargs1)
import pylab_util as PU
PU.SetLegend(1, loc=3, axis=0)
PU.SetPhaseLim(1,[-260,180])
PU.SetFreqLim(1,[0.1,50])
PU.SetMagLim(1,[-50,30])
PU.mysave('with_and_without_accel_attached.png', fi=1)
show()