Help with Custom Graph, Table, or Report & Subscripts

Use this forum to post Vensim related questions.
Post Reply
jmcfarland
Newbie
Posts: 1
Joined: Thu Aug 25, 2011 10:48 pm

Help with Custom Graph, Table, or Report & Subscripts

Post by jmcfarland »

Hi everyone,

I could use some help to creating a stacked column graph in Vensim OR data table that I could readily paste into excel. I am modeling the changes in the costs for 17 technologies for electric power generation over 100 years. I want to produce a column graph showing the technology cost (y-axis) vs. technology (x-axis) for a single time (e.g., t=1, 25, 50, OR 100). The column for each technology would break-out the cost components into categories such as capital, O&M, fuel, other.

In other words, I have the variable cost indexed by technology and cost component.
cost[Tech, CostComp]

Example Cost Table:
Tech1 Tech2 ... TechN
Capital 5 10
O&M 2 3
Fuel 4 2
Other 2 1

I have not this issue addressed in the help files of Vensim DSS 5.11 nor in the forum. I searched for several permutations of custom graphs, tables and reports.

Based on what I read in Chapter 15 of the reference manual, customization and modification of the .vgd file is needed. Here are the issues and questions I have for the three approaches (graph, table, and report):

Custom Bar Graph - The examples in Ch 15 show unstacked bar graphs. Can the cost components be stacked? If so, how?

Custom Table - I can produce a single row of cost components over a column of technology types, but cannot generate a table with multiple rows indexed by a variable other than time.
Is it possible to index the table by a subscript instead of time?

Custom Report - This seems like a workable, but slightly unpleasant option. I have two issues with this option. First, I do not know how to continue long lines of code in a .vgd file onto the next line. Using the backslash "\" at the end of the line appears to comment out the line. Sample code below works for 2 technologies, but I have 17 and the report is only recognizing about 7 or 8 in a single line of text. Second, I get the following error with the code below: "Got zero 0 but expected 4 variable descriptors." The report code still works, but the fact that I am getting an error suggests that something is wrong.

Report code
:REPORT Cost
:VAR capital portion[tech1]@10
:VAR fixed om portion[tech1]@10
:VAR capital portion[tech2]@10
:VAR fixed om portion[tech2]@10
Capital \real LCOE capital portion[tech1]/ \real LCOE capital portion[tech2]/
OM \real LCOE fixed om portion[tech1]/ \real LCOE fixed om portion[tech2]/
:END-OF-REPORT

Report Output
Capital 14.65 35.70
OM 1.931 3.918


Thanks for the help.

best,
Jim
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Help with Custom Graph, Table, or Report & Subscripts

Post by Administrator »

I would just take the normal table output, paste into a worksheet in Excel and then use VLOOKUP/HLOOKUP from another sheet on the Vensim numbers to create the graph.

Vensim does not support stacked bars (unless someone tells me otherwise).
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
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Help with Custom Graph, Table, or Report & Subscripts

Post by tomfid »

Also, if you right-click the Table tool, and check the "2d subscripting" option, you can generate a table across subscript elements rather than over time.

You could then select cost[Tech, CostComp] and generate a table of the entire contents of the array at any point in time that you choose. That's probably the easiest approach.

Tom
Post Reply