Return degraded state to a certain value

Use this forum to post Vensim related questions.
Post Reply
nesheim
Junior Member
Posts: 14
Joined: Mon Apr 30, 2018 12:12 pm
Vensim version: PLE

Return degraded state to a certain value

Post by nesheim »

Hi

I need help on how to make my "Bearing condition" return to value 10 (100% condition) after it has been replaced (maintenance)

Right now I just put the equation as IF THEN ELSE(Bearings Condition EL 1<=2, 10, 0), so that every time the condition drops to 20% it is replaced.
However, as you see here the value given when statement is true us 10. I have 2 remaining = 12. Setting true statement to 8 will not solve my problem, as I need in several places in my simulation values set to its original ( starting) value after a maintenance event.

Is there a function to set a level to its original value when it has reached a certain value.

+Is there a way to count these events? (Number of times a level has been set to original value)

Thanks
Attachments
screenshot
screenshot
Capture7.PNG (45.73 KiB) Viewed 5231 times
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Return degraded state to a certain value

Post by Administrator »

Can you upload the model?

It's straightforward to do, and much easier if we can look at your model and show you how to do it.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
nesheim
Junior Member
Posts: 14
Joined: Mon Apr 30, 2018 12:12 pm
Vensim version: PLE

Re: Return degraded state to a certain value

Post by nesheim »

I uploaded the model
Attachments
System Design V1,4.mdl
(5.41 KiB) Downloaded 186 times
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Return degraded state to a certain value

Post by tomfid »

The generic approach is as follows.

You have:

stock = INTEG( flow, init val )

you can reset the stock with:

stock = INTEG( flow + reset, init val )
reset = (desired stock - stock)/TIME STEP - flow

In other words, the reset has to (a) adjust the stock toward the desired value (which might be init val) instantly, and (b) cancel out any net flows that would otherwise disturb it.
nesheim
Junior Member
Posts: 14
Joined: Mon Apr 30, 2018 12:12 pm
Vensim version: PLE

Re: Return degraded state to a certain value

Post by nesheim »

I still can't figure this out.

Is "reset" a function? I can not find it in the functions list. I tried both in the stock and flow boxes.
I am using Vensim PLE 7.2a

Typing in reset does not work either.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Return degraded state to a certain value

Post by tomfid »

"reset" is an additional variable.
nesheim
Junior Member
Posts: 14
Joined: Mon Apr 30, 2018 12:12 pm
Vensim version: PLE

Re: Return degraded state to a certain value

Post by nesheim »

I got it to work. What a great forum.

Thanks for the quick reply!
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Return degraded state to a certain value

Post by tomfid »

Great!
krissCraft
Junior Member
Posts: 4
Joined: Thu May 24, 2018 12:02 pm
Vensim version: PLE

Re: Return degraded state to a certain value

Post by krissCraft »

I kind of have the same problem, except I have a negative rate reducing the value in a Level. I use the same kind of "reset", however, the value does not Return to the initial value, but "initial value-rate"

How can I stop the rate from affecting the stock when need it reset?

Lets say the initial value is 100, and rate -20. When value reaches 20, I want it reset to 100. But it resets to 80, most likely because the rate made it 100-20=80
How do I make the rate = 0 when I need the stock level reset?

Thanks :)
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Return degraded state to a certain value

Post by Administrator »

krissCraft wrote:I kind of have the same problem, except I have a negative rate reducing the value in a Level. I use the same kind of "reset", however, the value does not Return to the initial value, but "initial value-rate"

How can I stop the rate from affecting the stock when need it reset?

Lets say the initial value is 100, and rate -20. When value reaches 20, I want it reset to 100. But it resets to 80, most likely because the rate made it 100-20=80
How do I make the rate = 0 when I need the stock level reset?

Thanks :)
Can you upload the model? It's much easier to give you an answer if we can see what you are doing.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Return degraded state to a certain value

Post by tomfid »

Your case should just be the negative of the solution above:

stock = INTEG( - flow + reset, init val )
reset = (desired stock - stock)/TIME STEP + flow
krissCraft
Junior Member
Posts: 4
Joined: Thu May 24, 2018 12:02 pm
Vensim version: PLE

Re: Return degraded state to a certain value

Post by krissCraft »

Now it resets just how I want it to. Thank you. I should have seen that myself.
Post Reply