Vensim equivalent function for Dynamo's CLIP

Use this forum to post Vensim related questions.
Post Reply
malli
Member
Posts: 44
Joined: Wed Nov 15, 2006 5:10 am

Vensim equivalent function for Dynamo's CLIP

Post by malli »

Hi,

Am reading Tarek Hamid's Software Project Dynamics. While the models are described in DYNAMO and I had no problems in understanding most of the functions -

I could not make out what would be the vensim equivalent of dynamo's CLIP (A, B, C, D) . Essentially - there are always 4 vars inside the CLIP function - but what exactly does it do and what is the Vensim equivalent?

Thanks
Malli
Administrator
Super Administrator
Posts: 4680
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

I know nothing about Dynamo, but I found a description of the CLIP macro at the following location

http://www.scs.org/getDoc.cfm?id=1947

Look on pages 2 and 4.

CLIP(PQRS)=P if is R> or =S;
If is P=1, and Q=0 then CLIP(1,0,R,S) = 1;

CLIP(PQRS)=Q if is R<S;
If is P=1, and Q=0 than CLIP(1,0,R,S) = 0;


My best guess at implementing this as a Vensim macro would be

:MACRO: CLIP(P,Q,R,S)
CLIP = if then else ( R >= S , P , Q )
~ dmnl
~
|
:END OF MACRO:


Remember that this is a guess, maybe someone else who actually used Dynamo can give a better answer.

Tony.
malli
Member
Posts: 44
Joined: Wed Nov 15, 2006 5:10 am

Post by malli »

Thanks Tony. That conceptually makes sense. I will check this with the text.

Malli
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

CLIP was also called FIFZ - First if First Zro so that CLIP(a,b,c) = IF THEN ELSE(a = 0,b,c)
Post Reply