Type
Age Range
Subject Domains
Languages
Booking Required
Registration Required
Preview Link
Works Offline
Description
This experimental setup represents process simulator made with cascaded RC circuits.
User can choose between first order system, first order system with pure integrator, and second order system with pure integrator.
Laboratory can be programmed via Python programming language in any text editor.
There are two mandatory functions:
def podesavanje(prom) - function for experiment initialization. prom is global variable dictionary, user can make any variable necessery for experiment. Two mandatory variables are sampling rate prom['perioda'], experiment duration prom['vremeTrajanja'], and prom['red'], which is order of the system (0 - first order, 1 - first order with integrator, 2 - second order with integrator).
second function is
def petlja(t,y,prom), called periodically on prom['perioda'] seconds. First argument (t) is current timestep, second argument is current output of the process simulator, and third variable is global variable dictionary. Function returns input to the process simulator.
Example program (Unit step to the first order system with integrator):
def podesavanje(prom):
prom['perioda'] = 0.2 #0.2 s sampling time
prom['vremeTrajanja'] = 20 #20 s duration
prom['red'] = 1 #first order with integrator
def petlja(t,y,prom):
u = 1 # 1 volt
print str(t)+','+str('u')+','+str('y') #print current timestep, current input and current output
return u # send 1 volt to the process simulator
View and write the comments
No one has commented it yet.