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

Use this forum to post Vensim related questions.
Post Reply
Shally
Junior Member
Posts: 2
Joined: Thu Feb 19, 2004 7:52 pm

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

Post 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.
Owain
Junior Member
Posts: 12
Joined: Thu Feb 19, 2004 4:20 pm

Post 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
Attachments
fractions.zip
(2.94 KiB) Downloaded 467 times
Wilson
Administrator
Posts: 51
Joined: Thu Mar 06, 2003 5:05 am

Post 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.
Shally
Junior Member
Posts: 2
Joined: Thu Feb 19, 2004 7:52 pm

Post by Shally »

Thank you, Owain and Wilson. Both solution worked well! :)
Post Reply