Adding macros to vensim
-
- Member
- Posts: 23
- Joined: Thu Mar 22, 2018 9:56 am
- Vensim version: DSS
Adding macros to vensim
is it possible to add a macro program in Vensim so that production variable is changed a number of times within a time step?
Re: Adding macros to vensim
You might be able to do this with the SIMULTANEOUS function, or by using an array dimension as a virtual time axis.
What's the reason for doing this?
What's the reason for doing this?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Member
- Posts: 23
- Joined: Thu Mar 22, 2018 9:56 am
- Vensim version: DSS
Re: Adding macros to vensim
please find the attached files.
I Have some questions about the model.
is the model is ok?
at the initial stage ( 0 months) demand is 300 and shipment is 50 the backorders are showing 0 instead of 250. this 250 has appeared in next month. if I want to get that 250 in the current month in an accumulation mode, how can I get it?
Similarly, FGI is equal to the production rate - shipment[/list][/list]
shipment is showing 50 due to the initial value of FGI is 50 but once shipment happens it becomes 0, please look in this issue.
Demand is 300 units /month, the production rate is also varies based on a cycle time suppose the products are taking 2 months as production time how can i use the delay function in this model?
Demand is 300 units/month but i want to get the production rate in terms of weeks like 1st week, 2nd-week production so that before completion of the month my required demand should be completed. is this possible?
I Have some questions about the model.
is the model is ok?
at the initial stage ( 0 months) demand is 300 and shipment is 50 the backorders are showing 0 instead of 250. this 250 has appeared in next month. if I want to get that 250 in the current month in an accumulation mode, how can I get it?
Similarly, FGI is equal to the production rate - shipment[/list][/list]
shipment is showing 50 due to the initial value of FGI is 50 but once shipment happens it becomes 0, please look in this issue.
Demand is 300 units /month, the production rate is also varies based on a cycle time suppose the products are taking 2 months as production time how can i use the delay function in this model?
Demand is 300 units/month but i want to get the production rate in terms of weeks like 1st week, 2nd-week production so that before completion of the month my required demand should be completed. is this possible?
- Attachments
-
- simple model.mdl
- (4.52 KiB) Downloaded 162 times
-
- Screenshot (30).png (109.45 KiB) Viewed 4986 times
Re: Adding macros to vensim
HI
Goto model, settings and change units and check 'use strict testing' and afterwards test unit dimension. you will see 7 unit errors. Correct them and it may reveal your error.
Regards.
JJ
Goto model, settings and change units and check 'use strict testing' and afterwards test unit dimension. you will see 7 unit errors. Correct them and it may reveal your error.
Regards.
JJ
-
- Member
- Posts: 23
- Joined: Thu Mar 22, 2018 9:56 am
- Vensim version: DSS
Re: Adding macros to vensim
Hi
The basic for good modeling is to have no unit errors; If you set model>setings>use strict testing' it will tell you your unit errors. Correct these unit errors and it may help you to find the other error.
Regards.
JJ
The basic for good modeling is to have no unit errors; If you set model>setings>use strict testing' it will tell you your unit errors. Correct these unit errors and it may help you to find the other error.
Regards.
JJ
-
- Member
- Posts: 23
- Joined: Thu Mar 22, 2018 9:56 am
- Vensim version: DSS
Re: Adding macros to vensim
that's ok sir, but please answer to my another questions
-
- Super Administrator
- Posts: 4573
- Joined: Wed Mar 05, 2003 3:10 am
Re: Adding macros to vensim
JJ is trying to help you. If you fix the errors, it will help.
We will not fix the model for you, but we do help you to fix it yourself.
We will not fix the model for you, but we do help you to fix it yourself.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Member
- Posts: 23
- Joined: Thu Mar 22, 2018 9:56 am
- Vensim version: DSS
Re: Adding macros to vensim
I am very sorry sir, I am not asking you to fix the model but I want to know whether mentioned issues can we fix in Vensim or not?
if it is possible can you please explain sir
if it is possible can you please explain sir
Re: Adding macros to vensim
If you're interested in weekly dynamics, it seems like it would be easier to run the model in weeks.
I think the unit errors are closely related to the conceptual issues you're asking about. For example, you have:
production rate = start rate/cycle time
that transforms units/month into units/month/month, which doesn't make sense. Also, the rate-to-rate connection essentially makes the WIP stock superfluous. The simplest possible first-order equivalent would be:
production rate = WIP/cycle time
If you want to use a higher-order delay, you could use:
production rate = DELAY FIXED(start rate, cycle time, initval)
But again, if cycle time = time step = 1 month, the stock dynamics don't make any difference.
I think the unit errors are closely related to the conceptual issues you're asking about. For example, you have:
production rate = start rate/cycle time
that transforms units/month into units/month/month, which doesn't make sense. Also, the rate-to-rate connection essentially makes the WIP stock superfluous. The simplest possible first-order equivalent would be:
production rate = WIP/cycle time
If you want to use a higher-order delay, you could use:
production rate = DELAY FIXED(start rate, cycle time, initval)
But again, if cycle time = time step = 1 month, the stock dynamics don't make any difference.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Adding macros to vensim
Your shipment equation also contains a unit error:
MIN((Back orders/delivery delay+Demand), FGI )
This takes MIN( units/month , units ) which is inconsistent. You don't need strict checking to discover this; you just need to correct the missing unit in delivery delay first (but JJ is right).
MIN((Back orders/delivery delay+Demand), FGI )
This takes MIN( units/month , units ) which is inconsistent. You don't need strict checking to discover this; you just need to correct the missing unit in delivery delay first (but JJ is right).
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Adding macros to vensim
If you run the model in weeks, but you want shipments to happen discretely every 4th week, you can use PULSE TRAIN as a trigger for the shipments.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Member
- Posts: 23
- Joined: Thu Mar 22, 2018 9:56 am
- Vensim version: DSS
-
- Member
- Posts: 23
- Joined: Thu Mar 22, 2018 9:56 am
- Vensim version: DSS
Re: Adding macros to vensim
Thank you very much sir