Page 1 of 1

How can I keep A+B+C=1?

Posted: Thu Feb 19, 2004 8:00 pm
by Shally
I have a problem:

A, B, C are fractions of some events, A+B+C=100%
eg; A=0.4, B=0.4, C=0.2 initially. when A is changed to 0.7 manually, how B and C dynamically change to 0.2, and 0.1 based on the original ratio.

Posted: Fri Feb 20, 2004 9:14 am
by Owain
There may very well be another way, but if I read you right, then the following will work for your particular circumstance. The attached zip file has a Vensim and Excel file. The Excel file holds the 3 fraction values and ensures that they all add up to 1, Vensim reads the values from the excel file.

Regards

Lee

Posted: Fri Feb 20, 2004 3:43 pm
by Wilson
depending what you are trying to achieve, a simple solution would be to enter weights for A.B,C and then let vensim calculate the fractions. ie

Initially constants are :
A=4
B=4
C=2

and Vensim calculates the auxiliary fractions as:

A Frac = A/(A+B+C) =0.4
B Frac = B/(A+B+C) =0.4
C Frac = C/(A+B+C) =0.2

if constant A is changed to 14, and B and C remain unchanged, the new fractions would be :

A Frac =0.7
B Frac =0.2
C Frac =0.1

makes it a little tricky though entering a weight to reflect the fraction you desire, but the fractions will never sum to anything else but 1.

Posted: Mon Feb 23, 2004 4:41 pm
by Shally
Thank you, Owain and Wilson. Both solution worked well! :)