PyAMS  (the software under revision)

AM Voltage


Ideal linear electrical voltage source

Information

Frequency Modulated Sinusoidal Voltage Source Model based or described by the following formula:

V(t) = VO + VA sin[2pfct] + VA  m  sin[2pfct] sin(2pfst)]

Parameters

NameDefaultDescription
Va15.0Amplitude of Vam [Volt]
m1.0Modulation index
fc1KhzCarrier frequency [hz]
fs100.0hzSignal frequency [hz]

PyAMS definition

from PyAMS import Signal,RealTime
from math  import sin
from math import pi


class SourceVam:
     def __init__(self,p,n):
         #Signal
         self.Vam = Signal('out','potential',p,n)
         #Paramatres
         self.Va=15.0      #Amplitude of Vam
         self.m=1.0        #Modulation index
         self.fc=1000.0    #Carrier frequency
         self.fs=100.0     #Signal frequency
         self.Offset=0.0
         self.StartTime=0.0
     def StepTime(self):
          return min(1/(80.0*self.fc),1/(80.0*self.fs))
     def analog(self):
         time=RealTime()
         self.Vam+=self.Offset   
         if time>=self.StartTime:
         self.Vam+=self.Va*sin(2*pi*self.fc*time)+self.Va*self.m*sin(2*pi*self.fs*time)*sin(2*pi*self.fc*time)

Documentation generated by PyAMS