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.
How can I keep A+B+C=1?
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
Regards
Lee
- Attachments
-
- fractions.zip
- (2.94 KiB) Downloaded 467 times
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.
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.