Distribution - simpler solution needed

Use this forum to post Vensim related questions.
Post Reply
jmu
Member
Posts: 21
Joined: Fri Nov 14, 2008 12:32 pm

Distribution - simpler solution needed

Post by jmu »

Hi,
this question is not Vensim specific but because I use Vensim there might be a build in function (which I could not find) that helps me out ...

I have a calculated variable (let's say "amount-of-food") that should be distrubuted to some other variables (let's say "food-for-animal-kind-a", "food-for-animal-kind-b", food-for-animal-kind-c", ...)

Currently all I do is to something like this:
food-for-animal-kind-a = 0.3 * amount-of-food
food-for-animal-kind-b = 0.5 * amount-of-food
...
and so on.

The sum of the multiplication factor (0.3 + 0.5 +...) must be <= 1.0

When I want to run some experiments, I have to edit all these multiplication factors. This is a bit cumbersome.

Any idea how to do this in a better way? (I dream about a slider that allows me to change the distribution in a simple way and guarantees that the sum is always eqaul to 1).

Thanks for any help,
jmu
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

A couple of suggestions. Replace the numbers with model constants. It is always best practice to name and give units to every number in a model. You can then change the constants just like any other and they will automatically get sliders in SyntheSim.

In Venapp you can set up linked sliders to assure the sum matches something. But another solution is to just use

food for a = food * target share of a/total target share
total target share = MAX(1,target share of a + target share of b)

the molecules also contain some other approaches.

[Edited on 2008-12-12 by bob@vensim.com]
jmu
Member
Posts: 21
Joined: Fri Nov 14, 2008 12:32 pm

Post by jmu »

Thanks, that helps.

BTW: I always use units and constants. I just wanted to make it clear without lots of typing.

Concerning molecules: as a beginner I am still a little bit lost here.

jmu
Post Reply