def _bodes_from_comp(self, f): th_u_opts = self.find_opt("theta", "u") self.th_u_bode = rwkbode.rwkbode( output="theta", input="u", compin=self.th_u_comp, seedfreq=th_u_opts.seedfreq, seedphase=th_u_opts.seedphase ) self.th_u_bode.PhaseMassage(f) a_u_opts = self.find_opt("a", "u") self.a_u_bode = rwkbode.rwkbode( output="a", input="u", compin=self.a_u_comp, seedfreq=a_u_opts.seedfreq, seedphase=a_u_opts.seedphase ) self.a_u_bode.PhaseMassage(f) self.bodes = [self.th_u_bode, self.a_u_bode]
def calc_and_massage_Bodes(f, params, func=mod.Bodes, \ **kwargs): s = 2.0j*pi*f th_comp, a_comp = func(s, params) a_bode = rwkbode.rwkbode(compin=a_comp) th_bode = rwkbode.rwkbode(compin=th_comp) a_bode.seedfreq = 2.0 a_bode.seedphase = 30.0 a_bode.PhaseMassage(f) a_bode = SFLR_TMM.a_massage(a_bode, f, **kwargs) th_bode.seedfreq = 1.2 th_bode.seedphase = -90.0 th_bode.PhaseMassage(f) return th_bode, a_bode
def calc_and_massage_Bodes(self, params, **kwargs): s = 2.0j*pi*self.f th_comp, a_comp = self.func(s, params) a_v_bode = rwkbode.rwkbode(compin=a_comp) th_bode = rwkbode.rwkbode(compin=th_comp) a_v_bode.seedfreq = 2.0 a_v_bode.seedphase = 30.0 a_v_bode.PhaseMassage(self.f) #a_v_bode = SFLR_TMM.a_massage(a_v_bode, f, **kwargs) th_bode.seedfreq = 1.2 th_bode.seedphase = -90.0 th_bode.PhaseMassage(self.f) self.th_bode = th_bode self.a_v_bode = a_v_bode return th_bode, a_v_bode
def comp_to_Bode(comp, f, bode_opt, PhaseMassage=True): bode = rwkbode.rwkbode(compin=comp, input=bode_opt.input_label, output=bode_opt.output_label) if PhaseMassage: _PhaseMassage(bode, bode_opt, f) return bode
def tf_to_Bode(G, f, bode_opt, PhaseMassage=True): comp = G.FreqResp(f, fignum=None) bode = rwkbode.rwkbode(compin=comp, input=bode_opt.input_label, output=bode_opt.output_label) if PhaseMassage: _PhaseMassage(bode, bode_opt, f) return bode