text outputs

Use this forum to post Vensim related questions.
Post Reply
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

text outputs

Post by nikvyas »

Hello.

I have a query wrt text outputs. For instance, I have a subscript with 12 elements. If an element is between 0 and 24, I want to display "a". If it's between 24-48, I want to display "b" etc etc. Following this, I want to sum the subscript so that I get the total number of "a" 's, "b" 's etc etc at any point in time. Unfortunately I'm stuck at the IFTHENELSE statement - I want to say something like:

IFTHENELSE(test[test1]<24, "a", etc etc

Thanks

Nik
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

I guess the main question is where you want to show and a,b,c and so on. None of the regular analysis tools support such a display. There is a way to do this in Venapps, but that is probably not what you are after.
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks Bob.

I don't know if you guys know what FE@R is (forced elements at readiness), but what it basically shows is the readiness of an aircraft. If an aircraft is immediately ready (for take-off), it is considered to be at "R0". If an aircraft is 24 hours from being ready, it is considered to be at "R1" and so on (up to 90 days readiness which is R10). I already have a subscript with this information (as a number) - i.e. there are nine elements and, at any particular time period it gives the number of maintenance hours remaining for each element (aircraft). I just need to convert this to text if possible (using IFTHENELSE) so that at any particular time period I can see how many aircraft are at R0, how many at R1 etc etc. So ideally we'll have a graph with nine curves (one for each element/aircraft) showing the readiness states of each over the time period. And then a summation graph showing the total aircraft at R0, the total at R1 etc etc over the time period.

Hope this is a little clearer.

Thanks

Nik
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

From your description it sounds like you need something like:

Readiness:(R0-R10)
LReadiness:(R1-R10)
EReadiness:(R0-R9)->LReadiness
Days Required[Readiness] = 0,1,2,3,5,10,20,30,90,1000
Aircraft at Readiness[R0] = SUM(Repair Time Remaining[Aircraft!] <= Days Required[R0],1,0)
Aircraft at Readiness[LReadiness] = SUM(Repair Time Remaining[Aircraft!] <= Days Required[LReadiness] :AND:
Repair Time Remaining[Aircraft!] > Days Required[EReadiness] ,1,0)

I can't think of a simpler representation - but Aircraft at Readiness would be the variable you want to graph and you can name the subscripts to most clearly convey the meaning of the readiness level or just us R0-R10 as I have. - Careful with Units I have assumed everytihng is in Days, but it sounds like you have things in hours.
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks for your response Bob - much appreciated.

Unfortunately it seems as if you've ventured into an advanced subscript topic that I've yet to visit. Could you please explain how LReadiness and EReadiness are defined please? I'm assuming they are some sort of sub-subscript of Readiness? I've tried to look for help in the manuals, but I can't find any (maybe I'm looking in the wrong place?).

Thanks

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

Post by LAUJJL »

Hi Nik

You should study subscript mapping which is one of the trickiest part of the Vensim language. Take your time to study it. It is in the reference guide.
JJ
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks jj - I'll found the section in the Reference Guide. It looks like I might have to make myself a strong coffee before I read it!
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Actually the Chapter on Subscripts in the User's Guide (17) does cover subscript mapping and subranges so it is a good place to start.
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks Bob.
Post Reply