Electrical Switch

Use this forum to post Vensim related questions.
Post Reply
walin
Junior Member
Posts: 15
Joined: Mon Jul 05, 2010 11:59 am

Electrical Switch

Post 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
Administrator
Super Administrator
Posts: 4841
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

Will the PULSE function do what you need?
walin
Junior Member
Posts: 15
Joined: Mon Jul 05, 2010 11:59 am

Post 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
tomfid
Administrator
Posts: 3995
Joined: Wed May 24, 2006 4:54 am

Post 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
Attachments
elecSwitch.mdl
(3.29 KiB) Downloaded 818 times
walin
Junior Member
Posts: 15
Joined: Mon Jul 05, 2010 11:59 am

Post 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]
tomfid
Administrator
Posts: 3995
Joined: Wed May 24, 2006 4:54 am

Post 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
Post Reply