How to show or get a discrete data

Use this forum to post Vensim related questions.
Post Reply
yusuke
Member
Posts: 48
Joined: Sun Apr 27, 2008 11:41 pm

How to show or get a discrete data

Post by yusuke »

Hello.
Thank you for always supporting .

My simulation is timestep "week" and for two years.
I want a month information when a signal is generated.
This signal is discrete.

I try
(1)
Making a custom table.
But table size is large, 4week/month*12*2year=98
and discrete data can't use time "by" .
Many unnecessary things are displayed in table.
(2)
MESSAGE function
To read help .
But MESSAGE value shoud literal surrounded by single quotes or a String variable.
So, i cant set 'get month' message.

I expected to display the message function show a dialog
when the signal was sent.

Are there alternatives?
or correct funciton?
Attachments
weekyear.mdl
(1.88 KiB) Downloaded 312 times
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

I really don't understand what you are trying to achieve. If the model is in weeks you can define a variable

month = INTEGER(Time/weeks per month)

or

month = INTEGER(Time/weeks per month + 0.5)

depending on how you want to round.

Then to capture the month something happens you would use

month last signal received = SAMPLE IF TRUE(signal > 0,month,-100)

I hope that is helpful. As I say I can't really understand what you want to achieve.
yusuke
Member
Posts: 48
Joined: Sun Apr 27, 2008 11:41 pm

Post by yusuke »

Thank you Bob.

I'm sorry the explanation ..bad... .

Your approach is the completely true.

But I want to show only when the signal >0
" SAMPLE IF TRUE(signal > 0,month,-100)"

Vensim store data base in timestep. I know.
(1)Can I show table data only signal >0
"basic show" " I want to show"
signal month signal month
0 -100 1 3
0 -100 1 4
1 3 1 8

(2)Or , can I get information dialog whith message?
I want to know how to use MESSAGE function.
Help show MESSAGE('msg',display)
'msg' shoud be string.
Can I use variable data "month" in 'msg' ?

Thank you for your help.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

I am still not sure I follow you but I can answer one part of the question. Pass as the string to the message function

'The month is \month/'

and it will show the number.
yusuke
Member
Posts: 48
Joined: Sun Apr 27, 2008 11:41 pm

Post by yusuke »

Thank you bob.
I can do what I want.
Using \month/' as string value is helpful.

In MESSAGE dialog, I can see only signal data.
It is very useful for me .

Thank you very much
Post Reply