help with modeling

Use this forum to discuss any issues relating to Systems Dynamics and Systems Thinking.
Post Reply
siddus
Junior Member
Posts: 4
Joined: Mon Nov 29, 2010 8:56 am

help with modeling

Post by siddus »

Hello all,

I am new to the modeling process. I am trying to make a simplified system for leadership development. A part of the system depicts the relationship between monetary perks and employee morale.

I have modeled the perks as a stock with an inflow. The inflow simply adds a constant amount (in 100$ steps) to the stock. So say at time 0, the perks stock is 100. At time 1 the user increases the perks inflow to 100, consequently increasing the stock by 100 so that the new value is 200.

The morale is also modeled as a stock with a inflow which is controlled by the morale-perks function. For, this function I have created a graph that directly varies with the perks stock. So for example if the perks are 100 then the morale increases by 10. If the perks are 200 then the morale become 20 and so on.

However, I realized that if over 2 time periods the perks remain at a constant 100 then the morale should not be affected. However, currently the morale stock increases by 10 at each time interval.

How can I control the flow of the morale stock such that it increases only if there is a change in the perks amount?

Any help in this regards will be most appreciated.

Many thanks,
Sid.

[Edited on 11-29-2010 by siddus]
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

Do you need morale modelled as a stock?

It sounds as if you already have a lookup that relates perks to morale (ie, perks = 100, morale = 10 and perks = 200, morale = 20), so just use that to calculate a morale level.
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Post by LAUJJL »

you must trace the variation of perks by storing at each time step, the previous perks in a level so as to conserve its value the next time step, and compare that level with the new perks. you have then to calculate the difference and calculate how the morale depends on it.
JJ
siddus
Junior Member
Posts: 4
Joined: Mon Nov 29, 2010 8:56 am

Post by siddus »

Thank you for the prompt reply.

@Administrator - Yes, I want to model the morale as a stock. And I do have a look up that related perks to morale. Its a direct relationship (a simple linear graph of perks vs. graphs). However, the problem with this approach is that it is unrealistic. For example if I have 4 time periods of 1 week each. Then, if the manager were to raise the perks to 100$ in the first time period, then the morale would raise to a certain level (say 10%). However, in the next week I would not expect a further rise in morale (by 10%) if the perks were to stay at 100. A rise in morale in the next week would be justified if the perks were to be further increased (say to 200$).

By the nature of the look up graph, the morale stock rises by another 10% in the second week even when the perks remain at 100$.

@JJ - I think I get what you are trying to say here but am not sure how to achieve this exactly. I have attached a model where I have used the delay function to trace the variation between the perk amount between two consecutive time periods. However, the design is still imperfect and wont cater to certain conditions like time period 1. Can you please look at my model (attached) and suggest any changes?

I am a student and am using STELLA for learning. I hope you guys don't take offense to this. Nevertheless, I very much appreciate your open contribution to the subject.

Thanks again for your help.

Best
Sid.

[Edited on 11-30-2010 by siddus]
Attachments
delaytest2.STM
(15.69 KiB) Downloaded 4 times
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Post by LAUJJL »

Hi Siddus

I do not use Stella. But the best way for you, if you are learning Stella, is to download a free personnal learning edition of Vensim called PLE. It is very easy to use and is very similar to Stella at least for the most current features needed the first year of learning.
The vensim package has a great advantage over Stella: it has the reality checks features available in the PLE version.
You can choose two methods to keep the trace of a value for the next step. Store it in a level or use the delay fixed function that exists too in Stella with a delay equal to the time step.
joined a vensim model that can be read with the vensim ple version with the two methods implemented.
Regards.
JJ

[Edited on 30-11-2010 by LAUJJL]
Attachments
example.mdl
(2.81 KiB) Downloaded 405 times
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

help with modeling

Post by LAUJJL »

a new version of the model that recalculates the previous A value and uses the reality check features to test that the three differences are equal.
Regards.
JJ
Attachments
example2.mdl
(4.13 KiB) Downloaded 398 times
siddus
Junior Member
Posts: 4
Joined: Mon Nov 29, 2010 8:56 am

Post by siddus »

JJ,

Thanks a ton for your inputs. I will look at your model. I am forced to use stella because my university uses it. I have tried vensim PLE in the past and I liked it very much. I find stella to be quite frustrating sometimes.

I have two more questions for you:

1) Do you know of any resources I could use to mathematically model my decisions? For example: the perk-morale function I used in my model is a simple linear look up. I am sure there is a better way to model the relation so that it is much closer to the real world.

2) Another problem that I have faced is with the choice of integration method to use. Sometime back I modeled a system consisting of an employee stock with two flows, hiring rate and attrition rate. The hiring rate could be adjusted (1%-100%). I initially had 100 employees in my system. I set the hiring rate at 10% (attrition at 0). DT was set at 1 and the method I used was Eulers. When I advanced the simulation by 1 time unit, I correctly noticed the employee stock change to 110. However, with the same setup if I use the RK4 method, I get a slightly higher number.

Now I understand that the RK4 method adds the flow to the stock 4 times in each DT. However, in my model this is not a realistic approach. I need to have the correct number.

Does this mean that I cant use RK4 at all and have to stick to Eulers with a DT of 1? (because even when I decrease DT to 0.25) 4 calculations are performed and again I get undesired results!

Can you explain what I am missing here?


Many thanks for your patience.

Best,
Sid.
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Post by LAUJJL »

Sid

If you want to choose another function than a linear lookup, use a non linear lookup. if you need an analytical function, then the best way is to define the y and x values and look for a software that finds analytical functions that best adjusts to these values. There are free software that do that job.

It is difficult for me to advice you, because I make models that I use and it is a very different problem than making models as a student.

I use Euler integration, because there is not much difference between Euler and Runge Kutta. The difference is not big enough to bother about it.

The best solution is to try and find the best solution from experience.

Regards.

JJ
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Post by LAUJJL »

I just tested some models using the Runge Kutta method to see the differences. But I forgot setting back the model to the Euler method. I was working on a model with plenty of reality checks. When I went to a higher version and I tested the RC there were different errors and it was due to the different way of calculating with RK. When I set the calculations back to Euler, the RC were OK. I think that RK methods are more difficult to track than with Euler where it is easy to calculate the rate. With RK methods the rate is somewhere between the rate at the beginning of the period and at the end of the period, and that makes controls more difficult to execute.
JJ
siddus
Junior Member
Posts: 4
Joined: Mon Nov 29, 2010 8:56 am

Re: help with modeling

Post by siddus »

JJ, technically the RK method integrates the stock with the flow 2 or 4 times in each time interval. That may be the reason for a difference in the values. Anyways I am happy to use Eulers because my models dont really require a very high level of accuracy.

There is one difficulty I always face - Is there a way to limit the stock to a particular value. For example, if my stock represents a room with a capacity of 100 people and my flow is set to 10 people/month. If my simulation runs for 12 months then the room will fill to its capacity in 10 months but for the rest of the 2 months, I cannot avoid it from filling by another 20 people. So basically is there a way to cap the level on a stock to a particular value?

Thank you for your help.

Sid.
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: help with modeling

Post by LAUJJL »

To limit the rate so that the level does not get over a limit is very simple.
You must calculate a difference = limit - level at each time step
You must first calculate the rate without limitation say rate
Then calculate a rate limited = min (difference / time step,rate)
It will limit automatically the level to the limit.
Regards.
JJ
Post Reply