Page 1 of 1
Electrical Switch
Posted: Mon Jul 05, 2010 12:02 pm
by walin
Hi everyone, I have the following problem:
I have a electricity flow which is decribed as: capacity * "CHP on" ~J/S
capacity=5000 ~J/S
CHP on=IFTHENELSE(value X>0,1,0)
so the flow will only be switched on when value X>0 which is good. But at the moment the flow starts it needs to continue for 30minutes (which is de minimum runtime of the machine) regardless what value X will be after that.
Would you have any suggestions how to solve this problem?
thanks in advance,
best regards,
Wouter Maas
Posted: Mon Jul 05, 2010 1:24 pm
by Administrator
Will the PULSE function do what you need?
Posted: Mon Jul 05, 2010 1:30 pm
by walin
The problem I encountered with the pulse function is that you have to specify a starting time. I only know that the installation is switched on when x>0... Not at what time this will happen
Posted: Mon Jul 05, 2010 1:42 pm
by tomfid
The key is that the minimum run time constraint means that the machine's state is not memoryless. That means the machine's run status needs to be a level (state variable).
One approach is in the attached model.
You might also take a look at the discrete event models in the user guide, in C:\Program Files\Vensim\models\mguide\9DISCRET
Tom
Posted: Wed Jul 14, 2010 1:10 pm
by walin
Dear Tom,
thanks a lot for the help! The system like this works indeed. I am only wondering about one the device starting and stopping. YOu devide there with the time step which makes the unit 1/minute. That means that I have to change the unit into 1/second if I change my timestep to second?
And I assume that the last start time needs to be: HP starting >0,Time,Time?
thanks again,
gr Wouter
[Edited on 7-14-2010 by walin]
[Edited on 7-14-2010 by walin]
Posted: Wed Jul 14, 2010 1:55 pm
by tomfid
Correct on both points.
- units change to seconds (or whatever your time dimension is).
- my syntax of SAMPLE IF TRUE( starting, time, time ) works, because Vensim treats starting like a boolean variable, 0=false, >0 = true (I think) but your formulation, SAMPLE IF TRUE( starting>0, time, time) is probably clearer and more robust.
Tom