Documente Academic
Documente Profesional
Documente Cultură
Users Guide
by Powersim Software AS
The Business Simulation Company
-3-
No portion of the contents of this publication may be reproduced or transmitted in any form or by
any means without the express written permission of Powersim Software AS.
Trademark, service mark, and copyright acknowledgements appear in the Powersim Studio 2003
Reference Manual.
The Software License Agreement and Limited Warranty also appears in the Appendix of the
Reference Manual.
We have done our best to ensure that the material found in this publication is both useful and
accurate. However, please be aware that errors may exist in this publication, and that neither the
authors nor Powersim Software AS make any guarantees concerning the accuracy of the
information found here or in the use to which it may be put.
Mention of third-party products is for informational purposes only and constitutes neither an
endorsement nor a recommendation. Powersim Software AS assumes no responsibility of models
created using software marketed by Powersim Software AS.
-4-
Foreword
Making business decisions
Today, business simulations are used in making business decisions. Faced with a decision on where
to build natural gas storage containers, and how big to build these containers, one oil company used
Powersim to build a simulation of the wells, the pipelines, and the markets. Once the simulation
was built, decision-makers at the oil company could try different storage container scenarios. The
consequences of the different scenarios could be understood in a risk-free environment before any
investments in construction of storage containers were made.
Business simulations are also used in explaining business decisions to others in the organizations.
For example, a major telecommunications company saw many of their competitors making risky
forays into interactive television, adventures that were garnering much publicity. It was not enough
to just focus on their core business; they also had to explain to the employees why investing in
interactive TV and similar ventures were bad business decisions. This telecommunications
company built an interactive simulation of how they perceived their business. Over 1200
employees used this simulation in a series of management training workshops, where employees
had an opportunity to run the simulated business and make investment decisions. The employees
gained new appreciation for the corporate strategy, and a better understanding of how the thought
leaders in their organization saw the dynamics of the next few years unfolding.
Both of these simulation success stories were achieved using Powersim software. In each case a
team of modelers and thought leaders from the business collaborated to build a custom model of
the business problem. The models contained enough of the important details and complexities of
the real world situation to be useful and believable.
-5-
-6-
mechanics. Through simulation, a businessperson can thus acquire experience not only without
"field" work, but also without necessarily understanding details of the model behind it.
Powersim Studio supports two approaches to building business simulators: building a simulator
within Powersim itself, and building a simulator in a general-purpose, interface-building language
and using Powersim as a simulation engine through the available Powersim Studio Software
Development Kit (SDK).
Within Powersim Studio, a modeler can use a host of interface objects. You can present the state of
the simulation by a gauge, by a graph of an array, and by many other means. You may also
program events that will occur when certain situations occur in your simulation.
As more and more organizations build business simulators to understand their world, and
communicate it to others within their organization and outside, your job will become more exciting
and more important. We at Powersim are committed to supporting you in your efforts to build
business simulators.
Good luck with your purchase of Powersim Studio 2003!
The Powersim Software Development Team
-7-
Table of Contents
Foreword............................................................................................................................ 5
- 10 -
- 11 -
- 12 -
- 13 -
- 14 -
- 18 -
- 19 -
- 20 -
- 21 -
- 22 -
- 23 -
- 24 -
2.
3.
- 25 -
4.
5.
6.
7.
8.
- 26 -
9.
You can use the Presentation Mode as a "simulation browser," which makes your simulation easily
available for your end-users.
- 27 -
The Risk Assessment task let you analyze the sensitivty of your model.
Hierarchical Models
With the introduction of model hierarchy, Powersim Studio 2003 allows you to divide your
simulation model into smaller submodels that hide away unnecessary implementation details. As each
submodel can contain its own diagram book, modelling these submodels is just as easy as creating
any other model. In addition, submodels can be created from components in any simulation project.
This makes the duplication of existing model structures extremely easy! Utilizing model hierarchy
allows you to make more abstract models, divide your model into subsections that are easier to
maintain and model, and start reusing model structures from project to project.
- 28 -
Hierarchical models allow implementation details to be hidden inside submodels, making your
models easier to read and understand.
Improved simulation capabilities
While you in earlier version of Studio could only have one simulation for each component in your
simulation project, you can now add as many simulations as you wish. Each simulation will maintain
its own set of variable values, but the model structure will be identical between each simulation. A
change to the Shared Diagrams of the component will always be reflected in all simulations. By using
Private Diagrams, however, you can create diagrams that are unique to the simulation you are
working on.
Improvements have also been done to time series, where you are now allowed to record summary
information for periods. You can select between several summary types, such as average,
accumulated, max, min, etc.
Summary types enable you to present your simulation results summarized over a period. You can
display summaries in time graphs and time tables.
The improvements also include optimisations to simulation speed; new and better views for
equations, units, co-models, and ranges; and index variables.
New modelling features
The property pages for variable definitions are greatly improved and simplified, especially when
implementing large variable definition expressions. A new function, the VBFUNCTION, allows you
to create your own custom functions by programming them in VBScript.
Variable expression validation will now be performed when you edit a variables expression directly
in the diagram. You will also experience new user-friendliness when working with connectors (links
and flows) in Constructor diagrams, including more flexible point editing and useful messages on the
status bar while you work. Moving symbols between diagrams is also greatly improved.
- 29 -
Anonymous flows allow you to gather all the flows from a submodel to another variable (level or
submodel) in your diagram in one common flow. An anonymous flow doesnt have a flow rate,
obviously, but is a tidy way of showing how the flows run through your system.
When you have finished your simulation model and are working on documenting it, you can copy
model structures directly into your documents as graphics.
Other improvements and new features include improved delete and undo functionality; text search in
tree views, such as the Equations and Units views; the ability to organize your components and
datasets into your own folders; and much more.
Connectivity
Datasets have gone through a complete overhaul since Studio 2001. The user interfaces are now userfriendlier, and now allow you to drag-and-drop variables from models into the datasets. The internal
workings of the datasets are also vastly improved. The new SAP SEM dataset allows Powersim
Studio 2003 to run stand-alone and still connect to the SAP systems. You can also create multiple
instances of the dataset within Studio. The user interface for the Spreadsheet dataset is also
redesigned, and makes export and import of data from and to Microsoft Excel a lot easier.
Studio 2003 introduces the new Studio Dataset, where you can record your time series to internal data
storages inside your simulation project. The Studio Dataset allows you to store data for later use; edit
time series that are used in the simulation manually; share simulation data between several
components; and more.
You have greater control over your external connections in Studio 2003 than in earlier versions of
Studio.
Presentation of simulations
The improvements to time series mentioned above, makes it easier than before to create interesting
presentations of simulation results. Combined with improvements in graphs and tables available in
Studio, this constitutes a powerful means of conveying your message. And you can now even copy
the history of a time graph to the Windows Clipboard!
Hyperlinks can now be made relative, allowing the same simulation interface to be used for all the
simulations within a component.
The introduction of index variables makes it possible for you to create controls that select between the
dimensions of array variables without having to implement this by the use of model variables.
Index variables can be used as parameters by input controls. You can in turn use the index variable to
index the parameter of output controls, greatly simplifying the user interface of complex simulations.
It is now easier to add parameters to your controls and you can even use controls to set simulation
- 30 -
details, such as the start and stop times. Automatic detection of the states of the Switch control
simplifies the creation of buttons that control index variables and logical variables.
Other new features include field codes; rotation of tick labels; bar and step graphs in the Time Graph
control; the possibility to save and load external data (when using datasets) from Presentation Mode;
and much more.
- 31 -
- 32 -
- 33 -
models are brought to light in the context of an organization, we can begin to see where, how, and
why the models diverge. This is the first step in building a shared understanding within an
organization. As long as mental models remain hidden, they constitute an obstacle to building shared
understanding.
System dynamics is closely related to systems thinking. System dynamics was invented to give
managers a tool to understand the complex systems that they were charged with controlling. The
methodology uses computer simulation models to relate the structure of a system to its behavior over
time. Viewed in this way, system dynamics can translate the understanding gained by systems
thinking into a computer simulation model. By experimenting with this prototype of the system at
hand, we can gain further knowledge about the system. System dynamics is capable of creating a
learning environment - a laboratory that acts like the system in miniature.
Even if building a learning organization - an organization with a high degree of shared understanding
and knowledge about how the organization works - isn't the goal, systems thinking can be a very
valuable tool at the outset of a system dynamics study. It helps bring together the people necessary to
the success of the system dynamics study, and get them in a frame of mind that is open to new ideas,
and allow an evolution of mental models. For change to be successfully implemented, people must be
motivated to learn and able to act on what they've learned, and they must be in an environment of
open and honest exchange. Systems thinking, by helping people in an organization see what the
problems are and how their mental models contribute to the problems, sets the stage for a successful
system dynamics study.
When we conduct a systems thinking or system dynamics study, we must base it on existing
information. The information we can use exists on several levels. The largest and most complete
information available to us is our mental information; everything we carry in our heads. In sheer size,
this information database is the largest and most complete available to us. Next is the written
database, which may be smaller by a factor of a hundred or even a thousand. It represents all the
information we have on paper or stored electronically. Finally, we have a numerical database,
representing all information that is stored as numbers and constituting another hundred- or thousandfold loss in the amount and richness of the information. Obviously, the place to find the most
complete information about a situation is in the mental database. What we do with that information is
another matter. The human mind is a brilliant storage device, but we do have trouble relating cause
and effect, especially when they are not close in time. In such cases, we cannot reliably predict the
outcome of any but the simplest situations with the simplest inputs. This is one of the reasons why
computer simulation can be a useful addition to the method of systems thinking.
A systems thinking study usually produces causal-loop diagrams to map the feedback structure of a
system, and generic structures to illustrate common behavior. System dynamics takes the information
about a system's structure that normally remains hidden in mental models and formalizes it into a
computer model. The behavior generated by that particular structure is revealed when the model is
simulated. It constitutes a powerful tool for understanding complex problems. Instead of trying to
relate pieces of information in our heads, we can use the computers to formalize our ideas and
assumptions and then simulate them through time. That is the beauty and power of system dynamics
models.
- 34 -
Figure 1: A simple causal-loop diagram illustrating connections between price, sales, and unit costs.
Feedback
Feedback is a concept that most people associate with microphones and speakers. A microphone that
isn't properly set up will pick up the sound coming from its own speaker. This sound gets amplified
further by the speaker and picked up by the microphone again. This process keeps going until the
speaker is producing the loudest sound it can or the microphone cannot pick up any louder sound.
If the microphone and the speaker were set up correctly, the system would work linearly. The
loudness of the sound going into the microphone would only affect the loudness of the sound coming
out of the speaker. Because of the misplacement of the microphone, however, the loudness of sound
coming out of the speaker also affects the loudness of sound going into the microphone. Cause and
effect feed back on each other.
- 35 -
This is the general principle of feedback - that some causal chains are linked together so that cause
and effect feed back to each other. This happens everywhere in real world in all kinds of systems,
though people are often not aware of it.
Competitive pricing is one example of such feedback. Competitors set their prices based on our price
based on our competitors' prices.
Infrastructure of network effects is another example. Buyers on eBay are attracted to the large number
of goods available for sale. Sellers on eBay are attracted to the large numbers of buyers. Thus, the
more buyers, the more sellers and the more sellers, the more buyers.
Epidemics are yet another example. Viruses spread when a member of an infected population comes
into contact with someone, who is uninfected, but susceptible. This person then becomes part of the
infected population, and can spread the virus to others. The larger the infected population, the more
contacts, the larger the infected population.
The simple causal-loop diagram presented above illustrates feedback as seen in a price and sales
example. If we used a cost-based pricing strategy, then we could show that as sales increase, the unit
costs for the product goes down. As the unit costs go down, the price can go down. As the price goes
down, the sales go up.
The causal-loop diagram of figure XX shows that the price we charge today will affect what we
charge in the future. A low price will increase sales and reduce unit costs, making it possible to
further reduce price in the future. A high price will reduce sales and increase unit costs, making it
necessary to increase price in the future. This is obviously not the whole story. This structure is only
one part of a larger system and the level of price and sales are also subject to influences from other
variables in the system. But still, this isolated feedback loop is easy to understand.
Feedback relationships can produce a variety of behaviors in real systems and in simulations of real
systems. Figure 2 illustrates four common behaviors created by various feedback loops.
- 36 -
Delays
Not all cause and effect relationships occur instantaneously. Sometimes the consequences of an action
or decision are not apparent until several days, months, or even years after an event has taken place.
Often the relationship between cause and effect is obscured by separation in time. It is difficult to
understand a system when the consequences cannot be seen in close proximity to the behavior. A
child touching a hot stove will immediately understand the consequences of that behavior and will
likely never repeat the mistake. Many decisions have outcomes that cannot be known for years and
may never be linked to early mistakes.
Delays occur everywhere in the real world. A project may for example have cascading side effects
when critical-path tasks are delayed. New investments can have limited "windows of opportunity" for
making a return on investment. Introducing new products or services sometimes has first mover
advantages.
Delays can produce interesting and complex behavior in systems even when those systems have no
feedback and limited cause and effect complexity. To illustrate this let us look at the price and sales
example once again.
Revenue for a product line is determined by multiplying price by sales. So increasing either price or
sales will result in higher revenue, as long as nothing else changes. Figure 3 shows this relationship.
Figure 4: The behavior of the sales, price, and revenue variables. Notice that even though price and
revenue change during the simulation, sales does not change.
However, demand is usually affected by price, though often not immediately. Customers may take
time to adjust their consumption patterns even after a price change. This may be because they have
imperfect information about alternatives, or some infrastructure is temporarily forcing them to a
- 37 -
specific option.
For example, in the early 1970s, gas prices around the world increased quickly and substantially. Car
owners couldn't reduce their demand for gas instantly - they owned an expensive asset (i.e., their big
car with high gas consumption per mile) that couldn't be immediately replaced. Also, a lot of travel
that car owners do isn't optional, for example work commute. Moreover, not many cars with low gas
consumption per mile existed in the early 1970s. It took consumers years before they could adjust
their consumption patterns.
This linkage between price and sales is now similar to the original link we saw in the causal-loop
diagram, except that we have introduced a delay, as shown in Figure 5.
Figure 6: When a sudden change in price occurs, it causes an immediate increase in revenue.
Because of the delay involved, sales will not decrease immediately. After a certain time, however,
sales will drop, resulting in a decrease in revenue as well.
Even though this system contains no feedback and only three cause and effect linkages, the behavior
of the system is already becoming complicated. This is due to the delay in the system. This is also a
good example of how structure creates behavior. Through one additional delayed linkage in the
system, the results are vastly different.
Understanding the concepts of cause and effect, feedback loops, and delays provides a good
foundation when beginning to uncover the intricacies of a system's nature - what elements are acting
on other elements and whether the interaction is positive or negative. However, feedback loops alone
do not indicate what the entire system's behavior will be. It is hard to anticipate the behavior of a
system from a causal-loop diagram representing the feedback structure of a system alone. Such
diagrams are useful when it comes to isolating the feedback structures. When creating a system
- 38 -
dynamics simulation, however, we represent the feedback structures by the use of levels and flows.
Levels and flows are the main building blocks of computer simulation models in Powersim Studio.
Every element in feedback loops, and therefore every element in a system, is either a level or a flow.
Levels are accumulations and flows represent the changes to these levels. Flows fill up or drain the
levels, much as the flow of water into a bathtub fills it, and the drain at the other end (another flow)
empties it. This action of flows being accumulated in levels is the cause of all dynamic behaviors in
the world.
Levels
Things accumulate or pile up around us every day. Many managers deal with the issue of inventory,
one of the most important accumulations in many companies. System dynamics refer to such
accumulations as levels. Levels give a snapshot view of reality. Their values tell us how the system is
doing at any given point in time. If time suddenly stops, levels would remain and be observable and
measurable. Levels can best be understood as the "nouns" of a system; they are somewhat static or
inactive. Levels have several distinct characteristics. They have memory, which means they do not
change instantaneously. They do change, of course, through the actions of flows, but it takes time. If
our inventory is 6,000 units and we want to increase it to 7,500 units in anticipation of an increase in
demand, we must allow some time for those additional 1,500 units to be placed in our warehouse. A
delay is involved in changing any level, be it inventory or the amount of water in a bathtub. A level
may seem to be changing instantaneously, but there is nonetheless a delay, no matter how small.
Flows
If levels are the nouns of a system, flows are the "verbs". Flows are action variables, creating
dynamics when they accumulate in levels. Dynamics are not created by feedback loops, even though
it may seem that feedback (transmission and return of information) is causing the changes to occur.
Dynamic behavior can occur with absolutely no feedback, because it is simply the result of flows
accumulating in levels. Without flows, levels would never change, and there would be no dynamic
behavior. Thus, flows represent the system's activity and are dependent on the values of the levels.
Because levels are increased or decreased only by their associated flows and flows depend on levels,
an alternating level-flow structure must exist for all systems.
Decisions and Policies
Many people intuitively understand the difference between decisions and policies. However, we often
do not realize that every decision we make is somehow governed by a policy. Even the system of a
swinging pendulum can be described in terms of its "decisions" in the face of governing policies (the
rules of physics).
Within corporations, the distinction between the two is extremely important. Managers must often
make decisions based on limited information and their own previous experience. They may have little
or no control over what information they receive, what form it is in, when they receive it, or how
much they receive. When their decisions turn out to be wrong, they are often blamed for
misinterpreting the data. Sometimes the conclusion is that the manager simply didn't have enough
information to make the correct choice. Unfortunately, the actual problem is usually much deeper.
As mentioned earlier, the behavior of a system is a consequence of its structure. Therefore, the only
real changes we can make to a system are changes to the structure. Other changes to the system will
soon be canceled out through the actions of negative feedback loops. Providing the managers with
more and more information is not necessarily the correct solution, since too much detail or complexity
might do more harm than good. It is often a better idea to examine the structure of the organization.
This way we can gain knowledge and insight about the policies of the company; the rules of the
- 39 -
organization, spoken or unspoken, implicit or explicit, that provides the setting for decisions.
We can illustrate this idea easily with the concept of inventory. Companies that must keep inventory
have specific rules for when more inventory is ordered. No matter who orders the inventory, the
decision of when and how much to order will always be the same in the sense that it fulfills the
inventory policy. If the policy is that inventory must not drop below 6,000 units, and it takes four
weeks to receive orders from suppliers, decisions regarding inventory can be made accordingly.
When problems with inventory develop - there is too much or too little inventory or the amount has
fluctuated wildly in the past six months - a common reaction is to look for the person who has been
"ordering the wrong amount". This can be described as a reaction-driven or "open-loop" approach.
However, it is often more appropriate to examine the pattern of behavior and compare it to a desirable
pattern. If the inventory pattern is essentially chaotic while the desired pattern is a flat line, we must
make changes to the structure - the policies - of the organization, not just the decisions.
Decision-making Process
Decisions must always be based on observable variables. In a system dynamics model, this means that
decisions must be based entirely upon levels, as flows are never instantaneously observable and
therefore can never affect instantaneous decision-making. In the example above, the decision on how
much inventory to order must be based on the present value of the level of inventory. Levels can
represent the actual state of the system at a given point in time (current inventory) or the desired state
of the system (desired inventory). When there is discrepancy between actual and desired conditions,
corrective actions are usually taken to move the actual state closer to the desired state.
The first attempt to solve a complex problem rarely succeeds. This is not surprising, given the
complex cause and effect relationships and feedback loops that exist in most systems we are in
contact with. Usually, corrections change the system and lead to a total redefinition of the problem.
Decisions are attempts to move the system toward our goals. Actual conditions are continuously
compared to the desired conditions and action is taken according to the discrepancy between them.
This is an iterative process. In the context of a corporate model, decisions could be how many orders
to submit to the supplier to replace inventory, how many workers to hire, or when to replace capital
equipment.
A decision to replenish inventory should be based on the present level of inventory (a level) and not
on the rate of sales (a flow). Levels should be the only inputs to decisions; decisions control the flows
to and from levels, and the flows determine the change in the levels. As Jay Forrester states it: "Only
rates [flows] resulting from decisions change levels. Only levels control decisions and rates of flows.
In other words, decisions control all processes of change". Decisions are governed by policies.
Therefore, the way decisions control change is through policies. Flows are defined by equations, and
these equations are statements of system policy. Policies describe how and why decisions are made.
Specifically, it is the policy statement that attempts to move the system toward a goal. It provides the
connection between information inputs and the resulting decisions stream.
Policies may be informal, such as a consequence of habit, intuition, personal interest, and social
pressures and power within the organization. They can also be explicit, with a formal awareness of the
reasons of action. In the latter case, participants know exactly what policies are guiding their
decisions and are able to anticipate the actions of others in a similar situation. Informal policies can be
hazy, but the system dynamics model attempts to make them explicit. In such a model, informal
policies are treated with as much concern as explicit policies. They are considered equally important
in understanding the behavior of a complex system. To truly capture the problematic behavior of a
system, a system dynamics model must represent the basic policy structure of that system. The model
can then be used to try out various policies before implementing them in the real system. In this way,
effective policies can be developed to provide a proper guiding framework for the average manager.
The ultimate goal, if real change is sought, is to find the optimal mix of policies that create the desired
behavior (smooth growth of revenue, constant inventory, etc.), no matter who is in the decision-
- 40 -
making process.
Corporations can be designed so that only highly skilled professionals will be able to navigate the
company through the ups and downs of the business world without creating the symptoms of the
corporation's problems. However, with improved policies and structures, managers will have the
tendency to make correct decisions because the structure has been built with an autopilot in mind
(goal-seeking feedback loops, for example). Just as non-pilots in crisis situations have been able to
land planes because of the design of the plane, so can managers more easily "pilot" a well-designed
company.
This doesn't mean that every manager should be thinking in terms of corporate design instead of
corporate management. The people who should be involved in corporate design are those who have
the power to truly change the structure of the company - the executives. According to Forrester,
corporate executives should be corporate designers. They should create the necessary policies so their
managers will be able to make good and informed decisions. Changing the structure - the policies - of
the corporation can eliminate problematic behavior of the corporation, and the only people in a
position to do so are the executives.
- 41 -
Model Boundaries
Given the problem definition, we can start to set the boundaries of the model. Creating boundary
diagrams can be useful at this stage of the process. Such diagrams will help us identify the variables
to include in the model, and whether these variables will be endogenous or exogenous. A boundary
diagram is shown in Figure 7.
Figure 7: The boundary diagram illustrates the scope of the model. Exogenous variables are usually
parameters to the model, while the behavior of endogenous variables are generated within the model.
Endogenous variables are those whose behavior is generated within the model. Exogenous variables
are essentially parameters to the model. Their values come from outside the model, and they can
usually be considered constant. The model should only contain the structure that is required to
generate the problem behavior. We should always attempt to eliminate structures that don't contribute
a significant difference to this behavior. Likewise, if the behavior of the model changes wildly when
parameters are changed, the model is not generating the behavior internally. It is simply too
dependent on outside influences. In such cases the model boundaries should be extended to make
room for these exogenous variables to become endogenous.
Variables and Reference Modes
The next stage in the process is to make reference modes for all relevant variables. Reference modes
graph the behavior of variables over time. It is essential that we have a reference mode of the problem
variable itself. However, we do need reference modes for all other variables as well. This may sound
tedious, but there is a good reason for including them. When we simulate our model and discover that
it isn't working the way we anticipated, we can compare the behavior of the variables to the reference
modes to identify missing or incorrect structures in the model.
We can create reference modes in various ways. One quick solution is to quickly sketch the behavior
of the variables based on your own experience or anticipation. If you are experimenting with
Constructor, or creating small models to illustrate decisions or facts, this can be a desirable way of
working. Another more time consuming and costly way is to base the reference modes on real data.
Sometimes these data are readily available in the organization, but often we will have to gather the
system data ourselves. The process of data collection will of course vary from system to system. No
matter how we collect the data, the purpose is to understand the structure and behavior of the
- 42 -
problem.
When we are comfortable with the collected data, we must identify the key concepts and components
to include in the model. It is important to refer back to the problem definition for the model. This
helps us structure our information, and to start generating names and units of measurement for
variables. The list of variables usually becomes very long. From this list, we should identify primary
system variables. Again, we can use the problem definition and boundaries of the model to identify
these primary system variables. We can throw out the variables that are irrelevant to the purpose of
the model and set aside the variables that we are not sure of. The latter ones might become helpful
later, when we arrive at the stage of model design.
Conceptual Model Design
Now that we have reference modes that we have confidence in, have a clear view of the domain of the
problem, and have generated a list of primary system variables, we are ready to create a conceptual
model design. This is the stage at which we will make causal-loop diagrams and diagrams using
levels and flows. Which comes first is a matter of personal preference, and it might be useful to
experiment with both to find the most comfortable. At this stage we are simply trying to formulate the
problem, using the primary system variables, in terms of feedback loops or levels and flows. It is
usually a good idea to go down the list of variables first and identify levels, flows, or constants.
We can begin to determine which variables influence each other and how they can be connected by
physical connections (flows to levels and levels to flows) or information links (all other connections).
The units of measurement can provide a good check in this stage.
Model Formalization
With the conceptual design in place, we can start creating the Constructor diagrams and defining the
equations of the model. Although Powersim Studio takes care of the calculus, we need to relate the
variables in much the same way as we would create cell expressions in a spreadsheet. The units of
measurement for each variable will now provide an instant check for you, since Powersim Studio
requires the units of measurement to be consistently defined throughout your model.
If we look at a simple inventory model, we would probably have a 'Production Rate' (a flow) filling an
'Inventory' (a level). The flow rate would be dependent on the inventory level, since production will
depend on how much inventory is available. In addition, the flow would also be dependent on two
constants, namely the desired level of inventory ('Desired Inventory') and the time delay in adjusting
the production rate ('Inventory Adjustment Time'). The units of measurement of such a system could
be 'widgets' for 'Desired Inventory' and 'Inventory', and 'weeks' for 'Inventory Adjustment Time'. The
equation defining 'Production Rate' (the flow rate) must combine the variables it depends on in a form
that yields a rate equation with the unit 'widgets/week', as shown below.
('Desired Inventory' - 'Inventory')/'Inventory Adjustment Time'
In addition to specifying the equations, this stage also involves choosing parameter values. We should
always keep the real system in mind when we choose constants. We might already know the values
from the system data we collected at the beginning of the study, or we might have to estimate
reasonable values. The key is to be consistent. Initial values of levels should also be realistic for the
particular system. In the beginning, however, it might be a good idea to stick to round numbers, to
make it easier to evaluate the outcome of the model.
Sometimes we find it difficult to relate variables directly using strict, mathematical equations. In these
cases it is often better to create a graph that expresses the relationship between the variables, and use
graph functions available in Powersim Studio to define them. Graph functions are most useful when
representing nonlinear relationships between variables. These graphs are also specified in this stage.
- 43 -
Simulation
We are now ready for the simulation stage of the system dynamics modeling. When we have put our
conceptual model into the computer using Powersim Studio, and all the variables and equations are
well defined, we can simulate the model and view its behavior over time. It is often useful to try a few
"mental simulation" exercises before simulating the model. We should try to imagine what the model
should do when it is simulated. When the model is simulated, we will see whether the actual behavior
differs from our expectations - it most probably will - and thereby have a starting point in figuring out
why. It could be that the structure of the model is in error. It could be that we forgot to take certain
variables into account and that our expectations of the behavior were wrong.
When we simulate the computer model, we must set up appropriate simulation settings for the model.
The two most important are the time horizon and the time step. The time horizon represents the period
of time we want our model to simulate. It is specified by a start and stop time given relative to the
selected calendar. The time horizon will vary from model to model, and we will usually select it so it
matches the time frame of the problem behavior. The time step represents the time interval that the
simulation progresses for each calculation. The shorter the time step, the more calculations Studio will
perform, and the slower the model will run.
Once we have determined the time horizon and time step of the simulation, we will be able to
simulate our model under different conditions and observe the results. To truly understand the model,
we must relate the structure we have created to the behavior that results from simulating the model.
If we cannot get the behavior we want we must go back and reexamine the structure of the model and
try to determine why it is creating the unwanted behavior. The causal-loop diagram is often useful in
this regard. When we understand why the model generates a certain behavior, we can experiment with
changes in the structure to generate the actual problem behavior as we described it in the early stages
of the model creation. When the model adequately represents the real problem, we can use it for
policy analysis and experimentation. We now have a mini-laboratory in which to simulate the effects
of various policy changes before implementing them in the real system.
- 44 -
Figure 8: When integrating a function, the area underneath the function is measured. This is done by
dividing it into equal-width partitions and summing up the area of all the partitions.
When creating a simulation model graphically in Studio, connecting the variable symbols generates
the integral (flow) equations. Every variable in the model is defined by an equation, in the same way
as cells in a spreadsheet are defined.
In Studio, boxes represent levels. Double arrows represent the flows, and the flow is controlled by a
flow rate. The flow rate is defined in the same way as auxiliaries (see below). Figure 9 shows a simple
model when created graphically in Studio.
Figure 9: A simple model created in the graphical modeling language of Powersim Studio.
Notice the cloud-like symbol to the left of the first flow and to the right of the second flow. These are
the source and sink of the structure, respectively. The cloud symbol indicates infinity and marks the
boundary of the model. For instance, in the simple structure illustrated in the figure, the level is the
'Workforce', measured in people, which is increased by the 'Hiring Rate' (flow) and decreased by the
'Firing Rate' (flow). The clouds tell us that in this model we are not concerned with where the hired
people come from or where the fired people go. That information is beyond the model boundaries.
If we were interested in including this information, we could add another level to the left of the hiring
rate and one to the right of the firing rate extending the model boundary. This is shown in Figure 10,
where we have the hiring rate draining a level of applicants, and the firing rate adding to a level of
former employees.
- 45 -
- 46 -
dependence of the flow on the level, as well as the obvious dependence of the level on the flow, as
seen in Figure 14.
Figure 14: A closed feedback loop representing the interest earned from an account in a bank.
For a Constructor diagram to be consistent, the equation that defines a variable must contain all the
variables that are linked to the variable itself. In the simple model structure in Figure 14, this means
that for the model to be consistently defined, the definition of Interest must include Account and
Interest Rate. In this example, the definition of Interest is simply
'Interest Rate' * 'Account'
Creating a Model
The previous chapters have introduced you to the field of system dynamics and the principles behind
building computer simulation models. To help you create your first simulation models we have
created a Learning Lab that will guide you through the steps of modeling and simulating a model. The
Learning Lab also contains finished models that you can study.
- 47 -
If any conversion function contains the % (percentage) operator, the requirement of the new
- 48 -
conversion functions are not satisfied unless additional parameters are given. Any variable
containing a conversion function where the % operator is used in the parameter (e.g. ROUND
(A*5%)), the variable will become undefined in Studio. You must manually specify the
resolution parameter to define the variable properly.
Functions with side-effects (such as ASSIGN, SHIFTLIF, etc.).
Functions working on complex numbers. In Constructor 2.51 you could emulate complex numbers
by using arrays containing the real part in the first element, and the complex part in the second
element. In Studio, complex numbers are a unique data type, and functions will handle complex
numbers in a much more advanced way. The complex functions from Constructor 2.51 are
therefore obsolete in Studio. If your model used complex numbers (modeled as arrays), you should
go through it after converting it and use complex numbers instead. (The syntax for creating
complex numbers is: (<real>, <imaginary>).)
Functions that were obsolete in Constructor 2.51 (having names with the extension '__OLD').
Functions connected to the Network Gaming Object, such as SELECTDECISION(),
STRATEGICMODE(), etc.
Arrays
Some of the array functionality that was present in Constructor 2.51, is not available in Studio. The
most significant difference is that constrained expressions, as mentioned above, are not supported.
However, the FOR and IF functions can be used to replace these expressions.
You were not always required to include array subscripts when using arrays as input parameters to
functions in Constructor 2.51. This has changed, and when converted, Studio inserts a FOR function in
these cases. However, you might experience problems when this is the case, so if your model uses
unsubscripted arrays, please check your variable definitions before running the simulation.
The syntax for defining and indexing arrays has also changed a bit. When creating arrays, you should
now use the following syntax:
aux A = {1,2,3,4,5,6}
To find elements in arrays, you can still use the SCAN* and LOOKUP functions.
Constrained Expressions
Constrained expressions (expressions containing the keywords WHEN, BUT, OTHERWISE, etc.) are not
supported in Studio. The expressions are, however, converted to expressions that will work in Studio.
The new expressions are built up using nested IF functions combined with the FOR function.
Dimensions
The dimensions defined for a variable, also when using named ranges, will be converted to the new
Studio model. Because Constructor 2.51 in some cases didn't calculate ranges correctly, you might
experience problems for some range definitions. If you run into trouble after converting models
containing this kind of dimension, please check your dimension definitions. The table below shows a
few example of range errors in Constructor 2.51.
- 49 -
Interpretation
Dim. Expression Constructor 2.51 Studio
(-3)..6
3..6
-3..6
(-3+2)..3
2..3
-1..3
Index(2)..4
2..4
Invalid
Units
In Constructor 2.51, the unit field was merely a text field that had no impact at all on the variable
expressions. In Studio, units are an integral part of the variable expression and are computed at run
time. To avoid causing unit inconsistencies in the new model, units from Constructor 2.51 are
therefore not imported. Instead, Studio will automatically detect the unit based on the variable
definition. The contents of the unit field is moved to the variable's note field.
Custom Flow Definitions
When creating custom flow definitions in Constructor 2.51, you could (to a certain extent) create
flows that wasn't dependent on the flow rate itself. Rather, it was dependent on a value that in turn
was dependent on the flow rate. In Studio the flow has to be dependent on the rate itself, thus
restricting some of the flexibility found in Constructor 2.51. Custom flows and flows that are not
expressible through a flow expression in Powersim Studio will therefore by converted by
disconnecting the rate variable and adding a new rate variable that implements the custom flow.
Data Types
Studio supports four data types: INTEGER, REAL, COMPLEX, and LOGICAL. None of these were
present in Constructor 2.51. When converting the model, Studio tries to adapt the data type of the
variable to the variable definition.
Constructor 2.51 models that performed calculations on complex numbers must be revised manually.
Constructor 2.51 emulated complex numbers as (real) arrays with two elements. In Studio complex
numbers are a data type, and you should revise your model to implement complex numbers correctly.
Complex numbers are now created using the syntax (<real>, <imaginary>). For information
on whether a function accepts complex numbers as input parameters, please refer to the function's
reference sheet.
When you convert a model from Constructor 2.51 to Studio, you will have the option of turning data
type conversion off. If you choose to turn off the automatic type conversion, you will manually have
to go through your model to change the data types of the various variables.
Note! Some functions might require that the input parameters have certain data types in order
to work. Most notably is the IF function, that requires the first parameter (the condition) to be a
LOGICAL variable.
Notes
If the model conversion runs into problems when converting a variable expression into the new
format, it will add a note in the note field of the variable, notifying you about the problems.
- 50 -
Lines, frames, and texts are converted using freeform lines and frames (with text);
Number objects are converted using
Table Controls;
Time tables are converted using time
Table Controls;
Time graphs are converted using time
Time Graph Controls;
Array graphs are converted using
Chart Controls;
Button Reports are converted using
Switch Controls;
Gauges are converted using
Gauge Controls.
The new
Chart Control in Studio only accepts arrays (vectors) as input parameters, in contrast to
the Array graph in Constructor 2.51. If necessary, the converter will collect the variable elements
from the Array graph's parameter list into a vector variable and add this to the
Chart Control's
parameter list.
The Button Report in Constructor 2.51 had a lot of features not supported by the new
Control in Studio. Some of the functionality will therefore be lost in the conversion process.
Switch
The Gauge Report in Constructor 2.51 featured sectors, yet unsupported in Studio.
While the Keep Value property for a parameter belonged to each control in Constructor 2.51, the
same functionality is now achieved by using Permanent Variables in Studio. All parameters with the
Keep Value property set in Constructor are therefore converted into permanent variables in Studio.
Note! While you could specify the Keep Value property for a single array element in
Constructor 2.51, Studio requires the entire array (the variable itself and not the element) to be
permanent. When the model is converted, the entire array will therefore become permanent.
Report objects in Constructor 2.51 could contain field codes. These field codes were substituted by
the text information they represented in the diagram. Powersim Studio doesn't support field codes,
and field codes from Constructor 2.51 will be displayed as if it were normal text. In the converted
diagram this will appear as a code enclosed in curly brackets, like '{Par:Global}'. In these
cases, edit the text manually and remove the field codes.
- 51 -
Simulator Layout
A typical simulator layout in Constructor 2.51 utilized control buttons, several windows that
displayed various parts of the diagrams, etc. The windows could be customized to avoid resizing and
scrolling, among other properties.
Although you can still open several windows for the same diagram book in Studio, you can now
create several diagrams for each model. This will, to an extent, eliminate the need of having several
windows for the same diagram. Moreover, the command button is no longer present in Studio.
Because of the difference in the capabilities and uses of the two versions, the window and simulator
layout is not converted with the model. You should go through your model and utilize the new
features in Studio to redo the simulator layout as you please.
Tip! You can use the new Presentation Mode to create simulator interfaces in Studio!
Model Information
The model title, author and summary are transferred to Project Information for the new simulation
project. Information about document dates for creation and last saving are not transferred to the new
component.
- 52 -
- 53 -
The ASSIGN function took two input parameters. The first parameter would be assigned the value of
the second.
The definition of the model above would be:
aux A = ...
aux B = ...
aux C = ASSIGN(A, B)
The result of the simple model above was that the variable A was assigned the value of the variable B.
Studying the diagram, this is not the behavior we would expect. Rather, we would expect the value of
C to be dependent on A and B, not the value of A to be dependent of C and B.
In Constructor 2.51, the ASSIGN function could be used to assign a new value to both constants and
levels. It is also worth noticing that the ASSIGN function didn't take effect immediately. The
assignment was made effective from the start of the next time step in the simulation. Also, when the
assignment had been performed, the new value of A was not dependent on the integration method.
A Model Equivalent of the ASSIGN Function
Although there is no function in itself that covers the functionality of the ASSIGN function, it is
actually not at all difficult to create a model equivalent that performs the same operation.
With the introduction of discrete flows, creating a model structure that behaves like the ASSIGN
function is very easy. The only difference is that the assigned variable must in Studio always be a
level (it can never be a constant). This shouldn't really matter, though, since you can use the level in
any situation where you would normally use a constant. Both have initial values, and both can be used
as target for user input through controls (switch, slider, or chart controls).
In addition, the auxiliary C is defined with the Zero Order or Zero Order Immediate integration
setting (available on the Integration property page in the Properties dialog box). This structure
behaves correctly regardless of what integration method is selected for the component. Note also that
using zero order integration makes the value of C independent of the selected time step.
- 54 -
Note! If you select Zero Order integration, the level A will be changed at the start of the next
time step (similar to the effect caused by the old ASSIGN function). If you select Zero Order
Immediate, the level will be changed at the start of the current time step. Thus, if you are
creating an "assign" structure that reacts to a condition, the first setting will cause the level to
be changed the time step after the condition becomes TRUE, while the second setting will cause
the level to be changed the same time step that the condition becomes TRUE.
If there are other flows connected to the level A, then these should be made dependent on C, so that
they become zero when the "assign" occurs.
The ASSIGN function in Constructor 2.51 was often used in combination with the IF function. This is
also possible with the model structure presented above. If, say, we want the assignment to occur 10
days after the start of the simulation, C would be defined as:
aux C = IF(TIME =STARTTIME+10<<da>>,(B-A),0)
The definitions are shown below (the example assumes the arrays have 10 elements):
aux A = ... (defined as an array with 10 elements)
aux B = ...
aux C = SUM(i=1..10; IF(cond(i), ASSIGN(A(i), B), 0))
The SUM function was often used to "simulate" the FOR function that is now available in Studio. The
expression cond(i) denotes a condition for each array element of the array A. Or to put it in a different
way, it is a condition deciding when the individual elements of the array A should be assigned the
value of B.
This structure can also be modeled in Studio. The model structure is shown below.
- 55 -
Only one minor problem is left to resolve. In some cases, you would maybe use the value of C in the
Constructor 2.51 model in another equation. To solve this, you would have to add a variable, say D, to
your Studio model, and add a link to it from C. Since the return value of the ASSIGN function was B,
the result of the SUM function in the 2.51 model above can be expressed in the Studio model as
aux D = ARRSUM(C)
Using the FOR and IF functions, this can be achieved by the following expression in Studio. Rather
than including the index variable i in the dimension definition of the variable, it is now included in the
FOR function instead.
FOR(i=1..3 | IF(i<=1, A*B, A/B))
Example 2
If you have a model that contains both array structures and scalar variables, you might need to have
them interconnect. The example below shows how to feed scalar variables into an array variable, by
the use of indexed variables and guards in Constructor 2.51.
Say you have a model where different divisions work towards selling software products. The
divisions work in such different ways, that the model does not use arrays to represent sales. But when
it comes to presenting for example sales as economical figures, we want to use arrays for the different
divisions. Four scalar variables will feed their values to every element of the array variable. The
model is shown below.
- 56 -
Alternatively, you could exchange WHEN with '|'and BUT with ';'.
In Studio there is no longer a need to use these constrained expressions, since an array can contain
both literals as well as function expressions and variables. Thus, you can simply enter the equation
aux 'Sales per Division' = {'Sales by Resellers', 'Direct Sales',
'Sales by Salesmen', 'Sales by Consultants'}
Note! You can create long names in Studio including spaces. Just remember to enclose variable
names containing spaces within '.
- 57 -
The model structure below, created in Studio, performs the same conditional, circular shift as the
SHIFTCIF function shown above. The definitions works on an array with ten elements, but you are of
course free to create as many elements you wish.
const Array
aux Condition
aux 'Shift'
aux 'Cycle'
flow Array
=
=
=
=
=
In addition, the two variables Shift and Cycle are defined with the Zero Order or Zero Order
Immediate integration setting (available on the Advanced property page in the Properties dialog box).
This structure behaves correctly no matter what integration method is selected for the component.
Note also that using zero order integration makes the value of C independent of the selected time step.
Note! If you select Zero Order integration, the shift will occur at the start of the time step after
Condition becomes TRUE. If you select Zero Order Immediate, the shift will occur at the start
of the same time step that Condition becomes TRUE.
- 58 -
The model structure below performs the same conditional, linear shift as the SHIFTCIF function shown
above. The structure works on an array with ten elements, but can of course be expanded if necessary.
const Array
=
aux Condition =
aux 'Shift'
=
aux 'Shift Out'
flow Array
=
In addition, the two variables Shift and Cycle are defined with the Zero Order or Zero Order
Immediate integration setting (available on the Advanced property page in the Properties dialog box).
This structure behaves correctly no matter what integration method is selected for the component.
Note also that using zero order integration makes the value of C independent of the selected time step.
Note! If you select Zero Order integration, the shift will occur at the start of the time step after
Condition becomes TRUE. If you select Zero Order Immediate, the shift will occur at the start
of the same time step that Condition becomes TRUE.
Tip! It is also easy to add a new value at the beginning of the array, in the first element. Simply
add a discrete inflow named 'Shift In' containing the new value, and edit the flow definition in
Array to + SUFFIXZERO({'Shift In'}).
- 59 -
The value of Cnt decides the number of places to shift the array elements (a negative number
indicates a left shift), Array is the array to shift, while Input specifies the value of the new elements
that are shifted into the array.
The model structure below performs identically to the SHIFTLCNT function (with the exception that
Cnt must be an integer). The equations are shown below.
const Array
aux Input
- 60 -
) //IF
) // FOR
aux 'Shift Out' = Array
The two variables Shift and Cycle are defined with the Zero Order or Zero Order Immediate
integration setting (available on the Advanced property page in the Properties dialog box). The
definitions above are independent of the time step.
Tip! By changing the Cnt variable into a constant, you can manually change the value using a
input control.
The important part of the model structure is the Shift In variable. It uses a FOR function to create the
new array, and shifts the elements accordingly. It uses twodifferent structures to determine the values
of the new cells. If Cnt is positive, the first check (if i <= Cnt) is TRUE, and the according elements
are given the value of Input. However, if Cnt is negative, the first check will always be TRUE.
However, when the array is indexed with values that are outside the dimension of the array, the
elements will return NAN. This happens for the Cnt last elements in the array. Thus, by checking
whether the indexed elements are NAN or not using the ISNAN function, the last elements can be
replaced by the value of Input.
Tip! If you feel that the new diagram becomes cluttered by the introduction of the new model
structure, you can simply remove it from the diagram by using the Exclude capability of Studio,
which allows you to exclude variables from the diagram without deleting them.
aux
level
const
const
aux
Input
Target
MinVal
MaxVal
Control
=
=
=
=
=
...
// The
...
// The
...
// The
...
// The
LIMIT(Target,
- 61 -
The function causes the controlled variable, in this case Target, to never exceed the value interval
given by the two variables MinVal and MinVal. The return value of the function was the correction
that the function would have to perform on Target, shown below:
result Control = -(MinVal - Target) or (MaxVal - Target)
Input
= ...
// The inflow of the Target level
Target
= ...
// The target variable to control
MinVal
= ...
// The minimum value for the LIMIT function
MaxVal
= ...
// The maximum value for the LIMIT function
Control =
IF(
(Target + Input*TimeStep) < MinVal,
-(MinVal - (Target + Input*TimeStep))/TimeStep,
IF(
(Target + Input*TIMESTEP) > MaxVal,
((Target + Input*TIMESTEP) - MaxVal)/TIMESTEP,
0/TIMESTEP
)
)
= Control * TIMESTEP
aux Return
aux
level
const
const
aux
As we see from the equation above, the value of the flow rate Control must be multiplied with
TIMESTEP for the variable Return to return the same value as the LIMIT function did. This is simply
to make unit of the return value equal to the unit of the limited level. Also, we see that the variable
that controls the level is used as a flow rate for a outflow of the target level. However, when Target is
below MinVal, then the value of the flow rate becomes negative, which means that the direction of the
flow is reversed. We also see that the variable definition of Control is somewhat complicated in
Studio. This is compensated for by the fact that the real influences are shown correctly in the diagram.
Tip! If the Target level contains more in- or outflows, then these must be included in the
Control variable as well, in the same manner as the Input flow rate is; (Target +
Input*TIMESTEP + Flow2*TIMESTEP + ...)
- 62 -
Point to a toolbar button and, after a short delay, a description of the button appears. You will also
see descriptions of the commands on the status bar.
There is a Help button inside the dialog boxes. Click this to get assistance about the dialog box.
Use the online help system to get assistance. There are several ways of finding the help topics you
want, including a Table of Contents, an Index, and Full-text Search. We recommend you try the
index or the table of contents first.
When you are working with variable definitions, you can hover the mouse cursor over a function
name in the definition to view the syntax of the function. Similarly, hover the mouse cursor over a
variable name to view the variable's value.
When you are working in Constructor diagrams, hover the mouse pointer over an object to read
error messages or view the value of a variable. If you are creating links and flows, you will get
helpful information in the status bar as you are working.
Topic Layout
To help you navigate through the help system, we have consistently used symbols to categorize the
information available. In addition, each topic contains an icon in the upper right corner, which
indicates to what part of the software the topic applies.
Note! The formatting referred to below applies to the online help system. The symbols and
icons presented below are not present in the printed manual.
- 63 -
Icons
Below is a short explanation of each icon used in the help system.
Icon
Explanation
The help topic applies to Powersim Studio.
The help topic applies to Constructor Diagrams.
The help topic applies to Powersim Engine, and contains reference information about
functions, etc.
The help topic applies to Powersim Engine, and contains reference information about
functions, etc.
The link leads to an overview topic containing more textual explanations.
The link leads to an 'how-to'-topic containing task descriptions.
The link opens a menu with related topics that you can choose from.
The link leads to a web page, in most cases on Powersim's web site.
The link leads to a task related to the concept.
Indicates a note associated with the topic text.
Indicates a tip associated with the topic text.
Indicates that the heading contains a section that is hidden. Expand it by clicking the
heading.
Indicates that the heading contains a section that is shown. Collapse it by clicking the
heading.
On the left side of the window is the Navigation pane. It contains four navigational tabs: Contents,
Index, Search, and Favorites
On the right side of the window is the Topic pane. It displays the selected help topic, or the default
help topic.
The third pane is the toolbar, which is located below the help window title bar.
The Toolbar of the Help Window, contains buttons that are useful to you when you browse the help
system.
Hide and
Show expands or collapses the left pane.
Locate locates the current topic in the table of contents.
Back opens the previous help topic in the browse history
Forward opens the next help topic in the browse history.
- 64 -
To resize the Navigation or Topic pane, point to the divider between the two panes. When the
pointer changes to a double-headed arrow, hold down the mouse button and drag the divider right
or left.
To shrink or enlarge the entire help window, point to any corner of the Help Viewer. When the
pointer changes to a double-headed arrow, hold down the mouse button and drag the corner.
To change the height or width of the Help Viewer, point to the top, bottom, left or right edge of the
Help Viewer. When the pointer changes to a double-headed arrow, hold down the mouse button
- 65 -
The Help Viewer uses Internet Explorer's HTML engine, and therefore also the same set of
preferences as Internet Explorer. If the page appears difficult to read, please check your Internet
Explorer settings.
Click
Learning Lab on the Help menu. This will bring the Learning Lab up in a stand-alone
window that is easy to position while you work.
In the normal help system, located almost at the top of the Table of Contents.
To browse through a table of contents, click the Contents tab. The table of contents is an
expandable list of important topics.
To search using the index, click the Index tab. The index contains keywords for each help topic in
the help system.
To locate every occurrence of a word or phrase in the help system, click the Search tab, and then
type the word.
The Favorites tab allows you to make shortcuts to the help topics that you often revisit.
Note! Click the contents entry, index entry, search results entry or favorite entry to display the
corresponding topic.
- 66 -
Right-click inside the topic you want to copy, and then click Select All.
Right-click again, and then click Copy. This copies the topic to the Clipboard.
Open the target document.
Position your cursor where you want the information to appear.
On the Edit menu, click Paste.
Note! If you want to copy only parts of a topic, select the portion you want to copy, right-click
and then click Copy.
Click the
Print button on the toolbar.
Right-click inside the topic and select Print on the shortcut menu.
In the Contents tab, right-click the topic you want to print, and select Print on the shortcut menu.
In the Contents tab, right-click a heading and select Print on the shortcut menu to print all the
topics under that heading.
Note! The appearance of the printed page can differ somewhat from the online view.
1. Click the Search tab, and then type the word or phrase you want to find.
2. Click List Topics, select the topic you want, and then click Display.
You can also create more advanced searches by adding the logical operators AND, OR, NEAR, and
NOT. These are available by clicking the arrow to the right of the entry field. These operators will
- 67 -
No operator: Search for topics that contains one or more word from the search string.
AND: Search for topics that contain both words.
OR: Search for topics that contain one (or both) of the words
NEAR: Search for topics where the words in the search string are close to each other.
NOT: Search for topics that contain the first but not the second words.
- 68 -
- 69 -
Language Support
Powersim Studio also allows you to set the language of your simulation project. In fact, you can save
variable names and texts in as many languages as you wish to. This makes it easier to share your
models with users that normally use other languages than your own. Powersim Studio will start in the
language that is selected in Regional Settings on your computer. This is available in the Control
Panel of your computer.
Design and User Mode
When creating simulations in Studio you have different needs than when you run and experiment with
your simulations. Studio therefore offers an option of switching between Design and User mode.
When Studio is in Design mode, you are free to perform any changes you wish to the diagrams and
simulation model. When Studio is in User mode, however, you are only allowed to run and interact
with the model, not change it.
Equations
A component's equations contain the actual implementation of the simulation model. The Equations
View offers complete access to all variables and variable definitions in the component. You open the
Equations View by double-clicking the entry, or by right-clicking it and selecting View on the
shortcut menu.
- 70 -
Private Diagrams
Each simulation can contain its own diagram book. These diagrams are Interaction Diagrams, and
they are located under
Private Diagrams. Interaction diagrams allow you to create user interfaces
using presentation and input objects, but you are not allowed to create or include variable symbols.
When working with Solver Tasks, the task will contain Solver variables that are not available outside
the given task at all. In this tasks, you have to use private diagrams to be able to present the data to the
user.
Co-models
If you need to exchange data with external data stores, you can use datasets that are connect to your
simulation as co-models. When a dataset connection is created in the
Co-models view, a
connection to an external (or internal) data store is established, based on the definition of the dataset.
The dataset variables can be connected to the simulation's interface variables (variables with a defined
transfer direction in the component) in a simple and intuitive manner.
Events
Events enables you to specify actions to be performed when certain conditions in your simulation are
TRUE. By using events you can notify the user through message boxes, get user input interactively
using input boxes, set the value of parameters, and so on. The events system available in Studio is a
great means of giving your simulator an interactive user interface.
Note! Since events are defined for each simulation, they will only work when run inside Studio
(not if you use the Studio SDK to embed your simulation in a stand-alone application).
- 71 -
Project Window.
To create a new project and specifically select the language of the project yourself:
1. Click New on the File menu.
2. Select the language of the new simulation project in the dialog box that appears, and click OK.
If any other simulation project is currently open, this will automatically be closed before the new one
is opened and you will be asked to save or discard any changes.
- 72 -
save your HTML documents to C:\My Documents\Models, and rename the first page of you document
set to MySimulation.htm
To open the project documentation:
1. Select Project Documentation on the Help menu.
Tip! You can also use a hyperlink object pointing to a web page or file to open the project
documentation from inside a diagram.
If you are viewing the simulation in Presentation Mode, the project documentation will be
automatically opened when you hit F1, or when you click
Help on the toolbar.
- 73 -
3. Make sure that Simulation Projects (*.sip) or All Files (*.*). is chosen for Files of type, and type a
name for the new project under File name.
4. Click Save.
Note! The difference between Save As and Save Copy As, is that when you save a copy, you
will continue working on the "old" project. For Save As, you will continue working on the
project with the new name.
Note! You are advised to manually back up your work every now and then. This might be useful
if you need to revert to an earlier stage of your development process.
Open Windows Explorer, and browse to the folder where you saved your simulation project.
Locate the *.sip file containing the project you wish to restore.
Rename the *.sip file if you wish to keep the simulation project, or delete it if it is invalid.
Locate the file with the same file name, but with the extension *.~si.
Rename the extension of the *.~si file to .sip, or give the file a new name (such as MyFile.sip).
Open the file as usual in Powersim Studio.
- 74 -
menu.
In most cases this shouldn't be necessary. However, if you have been changing picture fills a lot
(adding and removing pictures several times, for example), the size of the project might be larger than
what is actually required by the current content of the file.
- 75 -
Run Access: Allows the user to run the simulation. However, he cannot view the model diagrams;
Run and View Access: Allows the user to run the simulation and view the model diagrams and
variable equations. However, he cannot perform changes to the model;
Full Access: Allows the user full access to the simulation project.
By setting passwords for the various levels, you can control the way your users can use your
simulation project.
Levels of Protection
There are three levels of protection available in Powersim Studio: Run Access, Run and View
Access, and Full Access. The list below summarizes the permissions given on each level.
Level
Description
Run Access
The simulation project can only be run. No model diagrams or equations will be
available. The model can, for example, be accessed using Powersim Studio SDK.
The simulation project can be viewed, but not edited. Access to all views are
Run and
available, including units and ranges. However, no definitions can be changed
View Access
(including units, ranges, and variables).
Full Access
Each access level can be locked by an individual password. To unlock a higher protection level,
simply enter the password for that level.
- 76 -
Select
Protect on the Project menu.
Select the desired protection levels by checking the boxes next to them.
Enter the desired passwords for the selected protection levels.
Click OK.
If it is the first time you enter the password, you will be asked to confirm it. Repeat the password,
and click OK again.
The passwords will be activated the next time you save the project.
Redo an Operation
To reverse the effect of the Undo command:
1. Click
Undo an Operation
If you regret an operation:
1. Click
- 77 -
- 78 -
- 79 -
View Equations
The Details Window
1. Click
Details Window.
Tip! The
Details Window is also available when you right-click the diagram tabs at the
bottom of the diagram book.
A tree view of the model variables is displayed in the left section of the active diagram window. You
can choose to show definitions of some or all variables of the underlying model. You can also dock
the Details Window on the top of the diagram window by right-clicking inside the Details Window
pane, selecting Details at Left, and then select Top on the submenu.
From this view you may open property dialog boxes of any variable in the model, delete variables and
add new ones.
The Equations View
1. Double-click
Window).
or
1. Select Equations under Simulation Windows on the View menu.
You can view, edit and create variables in the Equations View. Working in the Equations View and in
the Details Window are similar process.
Tip! You can rearrange the order of the diagram sheets by dragging their tabs to new
positions.
Select Sheets
There are two ways of switching between diagram sheets:
In the diagram window, click the tab of the sheet you would like to see or do something with.
Right-click the arrows next to the diagram tabs, and select the diagram to view on the shortcut
menu. If there are more than 15 sheets in the project, you can select More Diagrams on the
shortcut menu, and select the diagram to view in the dialog box that appears.
- 80 -
Move Sheets
You may move sheets within the component:
1. Select the sheet(s).
2. Drag the sheet(s) to its new position among the existing diagram tabs.
Tip! If you wish, you can move several diagrams at once by selecting multiple sheets at a time.
You select multiple files by holding down SHIFT while selecting more sheets.
Exclude a Sheet
You can exclude a sheet from a diagram book:
1. Right-click the diagram tab of the diagram you wish to exclude at the bottom of the window.
2. Select Exclude Diagram on the shortcut menu.
The include/exclude status of diagrams are saved for each simulation individually. This feature can be
used to contol which diagrams are available in a simulation.
Include a Sheet
You can include a sheet that has previously been excluded in a diagram book:
1. Right-click the diagram tab at the bottom of the window.
2. Select Include Diagram on the shortcut menu.
3. Select the diagram you wish to include on the submenu. If it doesn't appear there, you can select
Diagrams, and select the diagram in the dialog box that appears.
The include/exclude status of diagrams are saved for each simulation individually. This feature can be
used to contol which diagrams are available in a simulation.
Rename a Sheet
1. Right-click the tab of the sheet that you want to rename.
2. Select Rename on the shortcut menu.
3. Type the new name and hit Enter.
- 81 -
Delete a Sheet
Note! This operation cannot be undone!
1. Right-click the diagram sheet you wish to delete, and select
Sort: Click the column header to sort the column in descending order. Click again to sort in
ascending order. A tiny arrow on the column header indicates the sorted column and the sorting
order.
Reorder: Click the column header, and drag the column to a new position in the view while
holding the mouse button. Release the mouse button when you have found a new position for the
column.
Resize: Click the dividers between the column headers and drag the column width to the
appropriate width while holding the mouse button.
Hide/Display: You can hide or display any of the columns in the Equations View by rightclicking the header row and selecting the column you wish to hide or display. The columns
marked with a checkmark are currently displayed.
Select entries while holding down the Ctrl key to expand the selection entry by entry.
Select an entry, and then select one more while holding down the Shirt key to select all
intermediate entries.
Select an entry, and hold down Shift while using the navigation keys to expand the selection
(Arrow Up, Arrow Down, Page Up, and Page Down
Select all entries by hitting Ctrl-A, or by selecting Select All on the shortcut menu.
You can group the treeview by several properties by dragging several column headers to the grouping
area.
- 82 -
The Equations View displaying a model in hierarchical view (left) and flat view.
Note! The parent variable is always included for a child variable, either as the parent node in
the tree, or in the variable's name. This is especially useful if you need to sort the Equations
View based on one of the other fields, as you can clearly identify the variable in question.
Organize Windows
A number of commands are available on the Window menu:
New Window opens a new variable window (a duplicate of the currently active window).
Close closes the active window.
Close All closes all open windows.
Use
Next and
Previous to maneuver between windows.
Use
Tile, Arrange Horizontal and
Arrange Vertical, and Cascade to organize the
position of all open windows.
Select which window to activate from the list at the bottom.
- 83 -
automatically.
Note! If you only change the appearance of windows after opening a project, you will not be
prompted to save your model before exit. If this is your only change to the project, please click
Save before quitting Studio!
Click Maximize in the upper right corner of the window to maximize it.
Click Minimize in the upper right corner of the window to minimize it.
Next or
Click
- 84 -
Expand and collapse the branches of the project tree by clicking Expand and Collapse.
Add folders and structure your project.
Open windows for the various simulations, where you can view and edit the model, diagrams, comodels, runs, and events.
Open views where you can define ranges, units, and datasets.
Tip! The actions you can perform on the various items in the Project Window are available on
the items' shortcut menus. To open the shortcut menu, right-click the relevant item.
When the mouse pointer hovers over a menu command or toolbar button, a description is shown in
- 85 -
Project Window:
1. Drag the Project Window by using the toolbar handle, and position it along one of the edges of the
application. If the window is undocked, drag the window by its title bar.
To undock the
Project Window:
1. Drag the Project Window by using the toolbar handle, and position it somewhere inside the
application area (but not too close to the edges, where it will automatically dock).
Project Window is displayed by default when you create a new simulation project.
To switch it on or off:
1. Click
- 86 -
There are also a number of keyboard shortcuts available in Studio. In addition to the ordinary
Windows shortcuts (Alt to access menus and Alt + underlined characters in dialog boxes as
accelerators), many commands have also keyboard shortcuts (such as Ctrl+C to copy and Ctrl+V
to paste the selected objects) that enable you to use the keyboard instead of the mouse to navigate and
operate Studio. There are also a few modifier keys that you can use to alter the mouse actions (such as
holding down Ctrl while dragging an object in a diagram changes the move operation to a copy
operation).
Tip! To reactivate a toolbar that you have hidden, right-click in the toolbar area of Powersim
Studio and select it on the shortcut menu.
- 87 -
Diagram Commands
Diagram Commands include the tools that you use to create and modify a Constructor Diagram.
Pointer Tool
The default tool, used for selection.
Copy Area as Picture Tool
The area tool allows you to select an area and copy it to the clipboard as a picture file (in Windows
Meta File format).
Level Tool
Create a level variable.
Auxiliary Tool
Create an auxiliary variable.
Constant Tool
Create a constant variable.
Submodel Tool
Create a submodel variable.
Link Tool
Create a link between two variables.
Flow with Rate Tool
Create a flow with a rate attached in the active diagram.
Flow Tool
Create a flow (without a rate) in the active diagram.
Snapshot Tool
Create a snapshot of a variable. If you click the button and then click inside the diagram, a dialog
box appears containing the variables that can be made snapshots of. Alternatively, you can click the
small arrow next to the button and select the variable to snapshot in the drop-down list.
- 88 -
- 89 -
- 90 -
Format Commands
The Format Toolbar contains items that let you choose the visual characteristics of text, symbols, and
other objects in your diagram.
Font Name
Select a font name in the drop-down box to change the font of the selected text.
Font Size
Select a font size in the drop-down box to change the font size of the selected text.
Bold, Italic, Underline
Change the appearance of the selected text, or the text of selected objects. A second click on the
button removes the formatting.
Text Alignment
Alter the text alignment of the selected objects. You can right align, left align, center or justify the
text.
Font Color
Change the text color of selected objects.
Fill Color
Change the fill color of the selected objects.
Line Color
Changes the line color of the selected objects.
Line Style
Changes the line style of the selected objects.
Dash Style
Changes the line dash style of the selected objects.
Shape Type
- 91 -
- 92 -
Layout Commands
The commands on the Layout Toolbar can be used to arrange the objects in your diagram.
Align Left, Right, Center
Align the left or right edges or the center of the selected symbols with the dominant symbol.
Align Top, Bottom, Middle
Align the top or bottom edges or middle of the selected symbols with the dominant symbol.
Make Same Height, Width, Size
Resize the selected symbols to the same height, width, or size as the dominant symbol.
Space Evenly Across, Down
Space the selected symbols evenly either across or vertically.
Bring To Front, Bring Forward
Bring the selected object to front of overlapping symbols, or one step closer to the top layer.
Send Backward, Send to Back
Send the selected symbol one step closer to the back of the stack, or send it to the very back (lowest
layer).
Snap to Grid
Switch grid snapping on or off. When the button is depressed, snapping is turned on.
Snap to Guides
Switch guide snapping on or off. When the button is depressed, snapping is turned on.
- 93 -
Simulation Commands
The simulation commands include commands for controlling the simulation of a model. The most
commonly used simulation controls are also available on the Simulation MiniBar.
Reset Simulation
Reset the simulation.
Play
Start the simulation.
Stop the simulation by clicking once again. When the button is depressed, the simulation is running.
Advance Simulation one Step
Advance the simulation one step.
Add Cue Point
Add a cue point at the current simulation time. A cue point allows you to "rewind" the simulation to
that point, and replay it from that point forward.
Go to Cue Point
Go to the latest cue point in the list. To select a different cue point (if the project contains more than
one), click the small arrow next to the button, and select the desired cue point from the drop-down
list.
Autoscale Now
Update the autoscaling of all variables in the project. Use this command to automatically scale the
value axis of all controls whenever you need to. All variables will also be automatically scaled at the
end of the simulation.
Restore Permanent Variables
Restore the initial values of all permanent variables according to their definitions. Permanent
variables will retain the value they are assigned between simulation runs. Use this command to force
all permanent variables to be reset to their original definitions.
Add to Runs
Add the current simulation run to the saved runs. Runs are available Runs view, under Simulation in
the Project Window. Saved runs can be loaded into the simulation again (and thereby replace the
current run), or they can be used as reference data for the current run.
- 94 -
Reference Data
Select a saved run as reference data for the current run. The reference data must be previously saved
(obviously) in order to appear under Reference Data.
External Data
Load, save, or view details for dataset connections and external data stores.
Load External Data
Load data to dataset connection from external data stores.
Save External Data
Save data from dataset connection to external data stores.
External Data Details
View details for dataset connections and external data stores.
- 95 -
Standard Commands
The standard commands include commands for handling project documents.
New Project
Create an empty project. If you already have a project open, you will be asked to save the changes.
Open Project
Open an existing project.
Save Project
Save the current project.
Print Project
Print the current project.
Cut
Cut the currently selected object from the active view to the clipboard.
Copy
Copy the currently selected object(s) in the active view to the clipboard.
Paste
Paste the content of the clipboard into the currently active view.
Undo
Undo the last operation. If you click the arrow, you can undo the last operations (chronologically).
Redo
Redo the last operation that was undone. If you click the arrow, you can redo the last operations
(chronologically). The Redo button will remain unavailable until at least one operation has been
undone.
Show or Hide Project Window
Toggle the Project Window on/off.
- 96 -
Contents
Open the help system.
- 97 -
Symbol Commands
The Symbol Toolbar contains useful tools for adding auto report and changing the appearance of
flows and their associated flow rates.
Show Auto Report
Turn on auto report(s) for the selected object(s). The auto report type used last time will be selected
when you click the button. To change the auto report type, click the small arrow next to the button,
and select the type from the drop-down menu.
Hide Auto Report
Hide auto report(s) for the selected variable(s). Hiding an auto report doesn't delete it, and you can
later display it again without loosing any formatting.
Unhide Auto Report
Unhide previously hidden auto report(s) for the selected variable(s). The command is disabled if
(none of) the selected variable(s) has hidden auto report(s).
Delete Auto Report
Delete the auto report(s) for the selected variable(s).
Make Single Straight Segment
Convert the segments of the selected line, flow, or link to a single straight segment.
Make Single Curved Segment
Convert the segments of the selected line, flow, or link to a single curved segment.
Move Flow Valve to Next or Previous Segment
Moves the flow valve of the selected flow to the next or previous segment of the flow.
Anonymous Rate
Make the selected flow rate anonymous.
Toggle Elbow Style
Toggle Elbow Style for the selected line(s), link(s), and/or flow(s). When the button is depressed, the
elbow style is enabled for the selected object(s).
- 98 -
Forward
The Back and Forward buttons let you navigate through your browsing history in the same way as
similar buttons in a web browser. By clicking the small arrow next to Back, a list of the most
recently visited windows will be displayed.
Home
Brings you back to the default window of the simulator (as specified in the Presentation Mode Setup
property page).
Reset, Play, Play Stepwise
Identical to the buttons on the Simulation toolbar, these commands let you reset the simulation, play
and stop it, and play stepwise.
Reference Data
Allows you to select reference data to be presented in controls.
Presentation Mode
Switch off Presentation Mode and return to Design Mode of the simulation project. If the project is
protected, you must enter the correct password to unlock the project.
Zoom
- 99 -
- 100 -
View Commands
The view commands include commands for controlling the current view (or project).
Properties
Edit the properties of the selected object(s) in the active view.
Language
Select project language. To change language for the active view only, select a language under
Language on the View menu.
Details Window
Toggle the Details Window on or off (this command is only available for diagrams).
Go to a Variable
Go to a variable in the project. The Go to variable dialog box contains several options where you
can specify search criteria for finding the variable you are looking for. You can search for variables
themselves, variables defined by given variables, or for problematic variables.
Go to Previous Variable
Go to the previous variable that matches the given search criteria.
Go to Next Variable
Go to the next variable that matches the given search criteria.
Zoom
Select or enter the magnification in percent for the active view.
Zoom Tool
Magnify a section of the active diagram. Click the button, and then select the area of the diagram that
you wish to magnify.
Zoom to Fit
Fit the content of the current view to the window.
Presentation Mode
- 101 -
Switch to Presentation Mode. The project's presentation mode settings will be used.
- 102 -
These modifiers can be used when you perform drag-and-drop operations to change the
operation that is performed. You can use several modifiers at the same time, if you
wish to.
Alt
The Alt key has several functions, depending on the drag-and-drop operation you are
performing:
Temporarily reverse snap to grid and guides
If snapping is turned on the Layout menu, you can temporarily turn it off while
dragging an object by holding down the Alt key while you drag the object to its new
position. This also applies when inserting guides.
Data input in chart control
In the
Chart control you can drag any graph that allows input to a new shape by
pointing to it and sweep along the value and element axis. If you hold down ALT
while dragging, you can restrict the input to the selected element (data point) only.
Ctrl
The Ctrl key has several functions, depending on the drag-and-drop operation you
are performing:
Create or reshape segments
Holding down Ctrl while creating line segments (in links or lines) will make the
segments straight.
Create flows
Hitting Ctrl once while creating a flow will turn off the elbow style of that flow.
Holding down Ctrl while creating flow segments will make the segment curved.
Adjusting connected nodes
Holding down Ctrl while moving a connected node or while moving the vertex of a
connected node, will force the control handle to always be perpendicular to the edge
of the symbol.
Selecting nodes in segments
Holding down Ctrl while selecting nodes in line, link, or flow segments, will delete
the selected node.
Drag objects
Holding down Ctrl while dragging diagram objects will copy them rather than
moving them (a small '+' appears on the mouse pointer to indicate that a copy
operation is performed).
Resize objects
Holding down Ctrl while resizing diagram objects will cause the resize to be
symmetrical around the center point of the object rather than extending only the
edges dragged by the mouse.
Shift
The Shift key has several functions, depending on the drag-and-drop operation you
are performing:
Create or reshape segments
Temporarily reverse snapping to the angular grid for straight segments of lines, links
and flows. Thus, if snap to angular grid is turned off in the Grid Settings property
page, you can temporarily turn it on by holding down the Shift key while creating
the straight segment.
Note! Creating a straight line or link requires holding down the Ctrl key (see
above).
- 103 -
Resize objects
Holding down Shift while resizing diagram objects will lock the aspect ratio and
ensure that the shape of the object is maintained.
CtrlAlt
The Ctrl-Alt key combination will usually work as a combination of the two
individual key functions, except in one case:
Adjusting the vertex of a connected node
Holding down Ctrl-Alt while adjusting the vertex of a control handle to a
connected node, will lock the connection point of the node itself.
Del
Delete the last inserted node when you are creating segments (for flows, links, or
lines).
Ins
Insert a new node when you are creating segments (for flows, links, or lines).
- 104 -
F1
Simulation Commands
Ctrl+Space
Edit Commands
Ctrl+X
Cut
Ctrl+C
Copy
Ctrl+V
Paste
Del
Delete
Ctrl+A
Select All
Ctrl+Z
Undo
Ctrl+Y
Redo
Alt+Enter
Go To Commands
Ctrl+G
F3
Go to next variable
Shift+F3
Go to previous variable
Ctrl+F3
Project Commands
Ctrl+N
New project
Ctrl+O
Ctrl+S
Save project
Ctrl+P
Print project
Window Commands
Ctrl+F4
Ctrl+Tab
Next window
Ctrl+Shift+Tab
Previous window
Alt+0
Project Window
Alt+1
Details Window
- 105 -
F5
Presentation Mode
- 106 -
- 107 -
About Simulations
A component can contain several simulations, all of which can use their own individual simulation
settings. Co-models, Events, and Private Diagrams are also unique to each individual simulation.
The list below shows which parts of the settings and controls belong to the global project, component
and simulation.
Project
Global Ranges
Global Units
Project settings for calendar, time unit
Presentation Mode setup
Component
Local Ranges
Local Units
Runs
All variables and definitions
Shared (Constructor) diagrams
Simulation
Co-model connections
Events
Private (Interaction) Diagrams
Simulation Settings, including integration method, start and stop times, time step, reporting
windows and intervals.
Note! Although the variables and their definitions all belong to the component, the Equations
and Shared Diagrams nodes appear below the Simulation in the Project Window. The reason
for this is that the values that will be displayed for each variable belong to the current
simulation. Hence, even though the shared diagrams are identical in all simulations, the values
and time series of the variables will differ with the current simulation time and the selected
simulation settings.
- 108 -
structures of the component. Private diagrams belongs only to the simulation in question, and can
only contain presentation objects (like controls, frames, hyperlinks, etc.).
Shared Diagrams - Constructor Diagrams
Shared Diagrams are
Constructor Diagrams, and are shared by all the simulations and tasks
belonging to the component. These diagrams allow you to create model structures using all the
various model variables, links, and flows. They can also contain presentation objects like controls,
frames, hyperlinks, etc.
Since these diagrams are shared by all the simulations and tasks, a change to the structure in one of
them will be immediately reflected in all other simulations and tasks as well. The reason that the
Shared Diagrams node is present for each simulation, is that all the user input and variable values will
be different in each simulation that uses the diagrams. Hence, the volatile information presented is
unique for each simulation, while the model structures and objects themselves are shared among all
simulations.
Private Diagrams - Interaction Diagrams
Private Diagrams are Interaction Diagrams, and are unique for the simulation in which they are
defined. These diagrams allow you to create user interfaces, and you are limited to using only
presentation and input objects (hence the name).
When working with
Solver Tasks, the task will contain Solver variables that are not available
outside the given task at all. In this tasks, you have to use private diagrams to be able to present the
data to the user.
Rename a Component
1. In the
Project Window, select the component you wish to rename.
2. Hit F2 on the keyboard.
3. Edit the new name for the component, and hit Enter.
- 109 -
- 110 -
variables undefined as well, making it obvious which public child variables should be used for input
to the submodel.
Note! Although the transfer direction indicates that the variables are interface variables, they
will all become public in the resulting submodel. However, the Keep definition in component
copy can only be deselected for interface variables with the transfer direction set to in.
If the component requires special ranges and units, these will also be create in the simulation project
where you copy your component. However, keep in mind that if components that get dimensions and
units via the interface variables are easier to reuse.
When you create a submodel from a component, the diagrams of the component are copied to the
submodel as well. You should therefore remove all empty diagrams from your diagram book prior to
using the component as a submodel. You should also take care that the diagrams are not larger than
necessary.
The name of the component will be used as the name of the submodel as well. You should therefore
name each component in an intuitive way, so it's easy to find the component you need later. You can
rename the component in the
Project Window by selecting the name, hitting F2, typing the name,
and then hit Enter.
To Copy a Component as a Submodel
1. Click
Copy Component as Submodel on the Diagram toolbar
2. Click once in the diagram where you want to insert the submodel. You can control the size of the
resulting submodel symbol by dragging the size of the symbol before releasing the mouse button.
3. Select the simulation project (.sip) containing the component you wish to copy in the Copy
Component from File dialog box that appears.
4. Select the component to copy in the Copy Component dialog box that appears. The dialog box
contains all the components of the simulation project you selected.
5. Click OK to copy the component as a submodel.
By clicking the tiny arrow next to the
Copy Component as Submodel button, you can select the
component to copy from a list containing the recently used copied components as well as the
components of the current simulation project.
Example
The illustration below shows a simple model structure modelling the behavior of an account. The
component is named Account and has four interface variables. The Opening Balance, Period, and
Rate all have a transfer direction of in, indicating that they are supposed to be used as input variables
for the resulting submodel. For all of them, the Keep definition in component copy have been turned
off. The Balance level has a transfer direction of out, allowing it to be used as an output variable in
the resulting submodel.
- 111 -
When the component is copied as a submodel, the interface variables become public child variables,
and the input variables are undefined (resulting in all variables becoming undefined as well).
The public child variables can now be included in the variable next to the submodel symbol itself,
which makes them easily available for definition. When you define them properly, the entire
submodel will soon become valid. Suggested values are Rate = 12<<%/yr>>, Period = 1<<mo>>,
and Opening Balance = 1000<<USD>> (remember to define the unit USD in Global Units).
a)
b)
When the public child variables have been included in the parent's model (a), they can be easily
defined (b). The entire submodel will become well-defined as soon as the three input variables have
been properly defined.
- 112 -
Since the submodel contains one public level, flows can be connected to the level by drawing the flow
directly to and from the submodel. Any number of flows can be connected to the level, but for now
one inflow and one outflow will do.
Flows have been connected to the submodel (and thereby directly to the public level Balance), and the
implementation of the component Account as a submodel is finished.
Delete a Component
1. Right-click the component you wish to delete in the
2. Select Delete on the shortcut menu.
- 113 -
Project Window.
A simple model implementing the functionality of a conveyor. The model contains a submodel Conveyor - which are full-fledged models built within a variable and connected to the surrounding
model by public variables.
Furthermore, make sure to use all the possibilities that Powersim Studio offers in terms of monitoring
the development of crucial variables and bringing the simulation process to life for the audience of
your model. By implementing user input controls, you can even turn the simulation process into a test
laboratory where the user can change the value of key variables before and during the simulation to
- 114 -
- 115 -
- 116 -
- 117 -
Name
Description
Level
Reservoir
Auxiliary
Constant
Submodel
Array variables
- 118 -
Variable with
diagrams
Permanent
variables
A variable symbol with a pin in the upper left corner indicates that
the variable is a permanent variable. Permanent variables keeps
their value when the simulation is reset. The permanent symbol
can appear on constants and levels.
Variable with
A variable symbol with an arrow in the upper right corner
transfer direction pointing outwards, indicates that the variable has its transfer
set to out
direction set to out. This implies that values from the variable is
exported from the model via co-models (such as datasets).
A variable symbol with an arrow in the upper right corner
Variable with
transfer direction pointing inwards, indicates that the variable has its transfer
direction set to in. This implies that values are imported to the
set to in
variable via co-models (such as datasets).
Variable with
A variable symbol with an arrow in the upper right corner
transfer direction pointing both ways, indicates that the variable has its transfer
set to in-out
direction set to in-out. This implies that an initial value is
imported to the variable at the start of the simulation (the hollow
arrow indicates an initial import), while for the rest of the
simulation, values are exported from the variable via co-models
(such as datasets).
Public variable
Snapshot
Flow with
anonymous rate
Information link
Delayed link
- 119 -
variables.
Cloud
Error symbol
Inconsistency in
diagram
Controls, freeforms, auto reports, etc., are also symbols in the diagram. They are however not shown
above, since their appearance and presence in the diagram is immediately obvious.
Read a tool tip describing the error or inconsistency when hovering the mouse pointer over the error
or inconsistency indicator.
Display
Description
Tip!
Inconsistency indicators on
- 120 -
Error indicators on a
submodel indicates that one
or more of the child variables
are not properly defined.
Inconsistency indicators on
anonymous flows indicate
that the flow doesn't
represent a flow in the
underlying model.
Note! If you display your model diagram in User or Presentation Mode, the error (
inconsistency ( )indicators will be hidden.
)and
- 121 -
A number auto report (for 'Income') and a time graph auto report allow you to inspect the behavior of
the variables as the simulation advances. The final report is done using a time graph control.
Together, the controls and auto reports let you create an interactive user interface for your simulation.
The user can enter data into the simulation in one control, for instance a slider, and inspect the results
of the simulation in another, say a time graph.
You can also use pictures to enhance your diagrams. You are allowed to use picture fills for all
controls, symbols, and frames that support fills. The illustration below shows how pictures can be
used.
By using picture fills inside controls, frames, and other symbols, you can make your diagram a
visually pleasing sight.
- 122 -
Click
Click
Click
Click
Note! There are certain restrictions to how you can order the objects and symbols on a page.
As an example, you cannot move a level symbol behind a frame symbol (to read more, click the
The Stacking Order of Diagram Objects link below).
- 123 -
Levels represent accumulations in the system that is being modeled. They can be regular levels
or reservoirs. The latter can never be depleted below zero.
Auxiliaries receive, compute and pass on information. Regular auxiliaries change their value
over time.
Constants are computed only at the initial time step of the simulation. From that time on, they
are constant. They can, however, receive input from input controls, such as tables, switches, etc.
Constants that are marked as Permanent will never be recalculated, and will retain their given
value (user-assigned) between simulations.
Flow rates control flows to and from levels. Any variable that has a value can be used as a
flow rate.
Submodels are hierarchical, and only as containers for their child variables. Submodels doesn't
have values.
- 124 -
About Snapshots
When a model diagram becomes large or complex, you can make snapshots of variables to avoid
awkward links. A snapshot will always have the same value as the original symbol, and you can
create links from it to make it available to other variables' definitions. However, you can only create
links from it, not to it. You can therefore only use snapshots to provide input to other variables, and
not to the variable it represents.
You can have as many snapshots of each variable as you like in the diagram. Although the snapshot
will adopt the formatting of the original variable symbol, you are free to format each snapshot
independently. When working with a snapshot, you should keep in mind that definitions and
documentation refer to the original variable, while symbol formatting refers to the snapshot itself.
Tip! You can go to the original symbol by right-clicking the snapshot and select Go to Original
on the shortcut menu.
Since a snapshot cannot accept incoming links (only outgoing), you will sometimes experience a need
to change a snapshot into the original symbol. This is possible by right-clicking the snapshot and
selecting
Make Original on the shortcut menu. The original symbol will immediately become a
snapshot.
Note! You cannot make a snapshot into an original if the original symbol has input links. In
this case, the menu item will be disabled.
You can only create snapshots of variables that are already present in your diagram. To include a
variable that is not present in your diagram, use the Include Variable command.
If you have several snapshots of a variable in a diagram, and then exclude the original symbol, one of
the remaining snapshots will become the original symbol instead. Thus, to completely exclude all
instances of a variable in your diagram, you must exclude all snapshots as well.
A snapshot is indicated by an extra set of corners around the variable symbol. Apart from that they are
identical to the variables they refer to.
Create a Level
A level is a variable with a memory. It accumulates value very much like a bathtub collects the water
running from the faucet. It is the level that makes a model dynamic. It accumulates flows going into it
and subtracts flows going out of it.
1. Click
Level on the toolbar.
2. Click in the active diagram where you want to insert a level of the default size, or click and drag
to create a level of a different size.
3. Double-click the level to define it.
- 125 -
Levels must have an initial value. This initial value can be a number, but it can also be the value of
another variable.
Tip! You can drag the level to the desired size when creating it, or you can resize it after it has
been created.
Tip! If you double-click
Level, the tool becomes persistent, so that you can insert multiple
levels without having to click the tool each time. When you are finished, click Pointer or hit
Esc.
Create an Auxiliary
An auxiliary receive, compute, and then pass on information within one time step. An auxiliary
change its value over time.
1. Click Auxiliary on the Diagram toolbar.
2. Click in the active diagram where you want to place the auxiliary, or click and drag to create an
auxiliary of a different size.
3. Double-click the auxiliary to define it.
Tip! You can drag the auxiliary to the desired size when creating it, or you can resize it after it
has been created.
Tip! If you double-click
Auxiliary, the tool becomes persistent, so that you can insert
multiple auxiliaries without having to click the tool each time. When you are finished, click
Pointer or hit Esc.
Create a Constant
1. Click
Constant on the Diagram toolbar.
2. Click in the active diagram where you want to place the constant, or click and drag to create a
constant of a different size.
3. Double-click the constant to define it.
A constant will not change over time. Thus, even if it is defined by an expression that would normally
vary as the simulation advances, it will retain the initial value of the expression at the start of the
simulation.
Tip! You can drag the constant to the desired size when creating it, or you can resize it after it
has been created.
Tip! If you double-click
Constant, the tool becomes persistent, so that you can insert
multiple constant auxiliaries without having to click the tool each time. When you are finished,
click Pointer or hit Esc.
- 126 -
A flow rate variable is connected to the valve using an information link. It can also be attached to the
flow valve by dragging it close enough.
Note! A flow rate must always be defined with a unit relative to time and the flow it controls. If,
for example, the level is defined as 'm', then the flow rate must be defined as 'm/s', 'm/da', or
similar. Otherwise the connected flow will not be correctly defined.
Create a Snapshot
A snapshot is a "shortcut" to another variable in your diagram. The snapshot represents the variable
symbol and is a convenient way of creating tidy model diagrams for large models. By using a
snapshot, you can represent a variable many times in the same diagram, avoiding the long links
required to connect the variable to other variables in different places of your model.
You are allowed to create links from a snapshot, but you cannot create links to them. Only the original
variable symbol can have links going into it.
To create a snapshot of a variable (or a group of variables):
1. Select the variable(s) you wish to create snapshot(s) for.
2. Drag the selected variable(s) to the target area using the right mouse button. When you release the
- 127 -
The symbol that was previously the original symbol will automatically be converted into a snapshot.
A snapshot can only have links from itself, and no links to itself. If you perform this operation, you
may therefore get quite a few inconsistencies in your diagram. You must go through the model and
connect all input links to the new original symbol, and remove the input links from the old original
symbol, which is now a snapshot.
Create a Reservoir
A reservoir is a level that cannot be depleted below zero. When the simulation engine depletes a
reservoir, it will subdivide the time step into smaller parts to calculate the depletion exactly. If the
below drops below zero, the value of the reservoir becomes undefined (NAN).
- 128 -
1. Click
Level.
2. Click inside the active diagram where you want to insert a level of the default size, or click and
drag to create a level of a different size.
3. Right-click the level, and select Advanced on the shortcut menu, and then select Reservoir on the
submenu.
or
1. Click
Level.
2. Click inside the active diagram where you want to insert a level of the default size, or click and
drag to create a level of a different size.
3. Double-click the level to define it.
4. Click the Advanced tab.
5. Select the Reservoir option under Characteristics.
6. Click OK to save the changes, or Apply to save the changes without exiting the dialog box.
Just as for ordinary levels, reservoirs must also be defined by an initial value. This initial value can be
a number, but it can also be the value of another variable or expression.
You must make sure that the flows out of the reservoir stops once the reservoir is depleted, since the
reservoir's value will become NAN rather than negative.
A Reservoir Symbol is similar to a Level Symbol, except it has a double line at the bottom.
Note! The simulation engine will recalculate the entire simulation model when the size of the
timestep is altered for the reservoir. You should therefore be aware that your model might
produce slightly different results when using reservoirs than when using ordinary levels.
- 129 -
- 130 -
- 131 -
Using the Alt key will reverse the Snap to Grid and Snap go Guides settings. If these settings are
enabled in the Layout, hitting Alt will temporarily disable them, and vice versa.
Using the Shift key will temporarily reverse the Snap to Radial Grid option, which is available in
Diagram Settings dialog box. If the option is already selected, hitting Shift will temporarily
disable it, and vice versa.
Using the Ctrl key have different effects when working with links and flows. If you are creating
links and flows, using the Ctrl key will toggle the segment type between Straight and Curved. Thus,
pressing Ctrl while creating a link, will create a straight link segment. Pressing Ctrl while creating
a flow, will create a curved flow segment.
Note! New flows are create with the Elbow style by default. The first time you press Ctrl will
automatically disable the Elbow option. You can enable it again on the shortcut menu for the
flow.
When moving a node that is connected to a symbol, the control handle of the node will always be
drawn in a straight line from the center of the symbol and through the node itself. However, by using
the Ctrl key, you can force the control handle to always be perpendicular to the edge of the symbol.
This allows you to move the connection point of the link or flow without significantly changing its
shape.
If you hold Ctrl while selecting a node, the node will be deleted.
Pressing Ctrl-Alt when dragging the vertex of a a control handle, will lock the connection point of
the node to the variable symbol.
You can also hit Del and Ins while creating links and flows. Hitting Ins will insert a new node,
while Del will remove the previously inserted node.
- 132 -
Create a Link
1. Click Link.
2. Click inside the symbol you want the link to start from.
3. Drag the link to the destination symbol. You can divide the link into several segments by clicking
where you want one segment to end and a new one to start.
4. Click inside the destination variable to complete the link.
Hitting Del while drawing a freeform, link, or flow, will delete the last inserted node (except the start
node).
If you wish to create a straight link, hold down CTRL while you drag the link.
A link cannot be detached from one symbol and reattached to another. You have to delete the original
link and create a new one.
If you double-click Link, the tool becomes persistent, so that you can insert multiple links without
having to click the tool each time. When you are finished, click Pointer or hit Esc.
You will get tips in the status bar when you work with links and flows. The tip follows the movement
of the cursor, so if you wonder whether you can perform an action or not, simply hover over the target
symbol and read the message in the status bar!
Studio will automatically detect when the link is used as a delayed link and will change the link into a
- 133 -
Delete a Link
1. Select the link you wish to delete.
2. Select Delete on the Edit menu, or hit Delete on the keyboard.
If you remove a link that is required for the diagram to be consistent, the diagram will become
inconsistent when you delete a link.
If a variable is defined by another variable without being connected by a link, a hash (#) will appear
to indicate the inconsistency. To remove the hash, simply create the link.
You will get tips in the status bar when you work with links and flows. The tip follows the movement
of the cursor, so if you wonder whether you can perform an action or not, simply hover over the target
symbol and read the message in the status bar!
- 134 -
Create a Flow
A flow can be created either between two levels in white space, or into or out of one level.
1.
2.
3.
4.
Click
Flow with Rate (or click
Flow to create a flow without a flow rate).
Click inside the source of the flow and move the pointer in the direction you want the flow to go.
Click in white space to start a new flow segment.
Click inside the destination level to complete the flow.
If you want the source or the sink of the flow to remain unspecified, either start in white space or
double-click in white space to end the flow. A cloud appears, indicating that this end of the flow
extends beyond the boundaries of the model.
The flow snaps to the radial grid by default. Press down the SHIFT key to temporarily turn off the grid.
To make a curved flow, press the Ctrl key.
If you double-click
Flow with Rate, the tool becomes persistent, so that you can insert multiple
flows without having to click the tool each time. When you are finished, click Pointer or hit Esc.
The default flow type created by Studio is a continuous flow. To change it into a discrete flow you
must change the integration settings for the flow variable explicitly.
You will get tips in the status bar when you work with links and flows. The tip follows the movement
of the cursor, so if you wonder whether you can perform an action or not, simply hover over the target
symbol and read the message in the status bar!
Click
Flow.
Click inside the source of the flow and move the pointer in the direction you want the flow to go.
Click in white space to start a new flow segment.
Click inside the destination level to complete the flow.
If you want the source or the sink of the flow to remain unspecified, either start in white space or
double-click in white space to end the flow. A cloud appears, indicating that this end of the flow
extends beyond the boundaries of the model.
The flow snaps to the radial grid by default. Press down the SHIFT key to temporarily turn off the grid.
To make a curved flow, press the Ctrl key.
If you double-click
Flow, the tool becomes persistent, so that you can insert multiple flows without
having to click the tool each time. When you are finished, click Pointer or hit Esc.
You will get tips in the status bar when you work with links and flows. The tip follows the movement
of the cursor, so if you wonder whether you can perform an action or not, simply hover over the target
symbol and read the message in the status bar!
- 135 -
Drag the rate variable away from the flow valve until a link appears. Drop the rate wherever you
want to.
Or:
!
Right-click the flow valve, and select Detach Rate on the shortcut menu.
To attach the rate to the flow valve again, perform the reverse operation.
You will get tips in the status bar when you work with links and flows. The tip follows the movement
of the cursor, so if you wonder whether you can perform an action or not, simply hover over the target
symbol and read the message in the status bar!
Drag the rate onto the linked flow valve. When close enough, the rate snaps to the valve.
or
- 136 -
Right-click the flow valve, and select Attach Rate on the shortcut menu.
A flow rate can be attached to the valve once a link is established and the flow rate dragged close
enough.
The flow rate must be attached to the valve by a link. Any variable can be used as a flow rate, even
levels and constants.
You will get tips in the status bar when you work with links and flows. The tip follows the movement
of the cursor, so if you wonder whether you can perform an action or not, simply hover over the target
symbol and read the message in the status bar!
- 137 -
Delete a Flow
1. Select the flow you wish to delete.
2. Select Delete on the Edit menu.
or
1. Select the flow you want to delete in the diagram.
2. Hit Delete on the keyboard.
The flow rate will not be deleted though you delete the flow it controls.
You will get tips in the status bar when you work with links and flows. The tip follows the movement
of the cursor, so if you wonder whether you can perform an action or not, simply hover over the target
symbol and read the message in the status bar!
- 138 -
- 139 -
About Submodels
A submodel in Studio refers to the variable type submodel and how it is used inside a model. Unlike
auxiliaries, levels, and constants, the submodel doesn't have a definition, and consequently doesn't
have a value during simulation either. The submodel is merely a container for child variables, and as
such it offers more functionality for its child variables than other variables does. A submodel is
represented by an octagon in Constructor diagrams.
The submodel symbol as it appears in a Constructor diagram. You are allowed to alter the size and
aspect ratio of the symbol, unlike other variable symbols.
When using submodels, you can utilize the advanced features listed below.
Diagram book
Each variable in a Constructor diagram can contain its own diagram book. This diagram book is
identical to any other diagram books in Studio, and allows you to create your submodel just as you
would create any other model in your project. That a submodel (or any other variable for that matter)
has its own diagram book is indicated by a small document indicator in the lower left corner of the
variable symbol.
When a submodel (or another variable) has a diagram book, a small document indicator is attached
to the lower left corner of the variable symbol.
Public variables
In a submodel, only public variables can access or be accessed by sibling variables of the parent
variable. A small indicator in the upper right corner of the symbol indicates that a variable is public. A
public variable can also be accessed by child variables of its own sibling variables.
- 140 -
When a variable is made public, an indicator appears on the upper right corner of the variable's
symbol.
Include public variables in parent diagram
You can include any public variable of a submodel in the parent diagram. An included variable will
be connected to the parent symbol with a satellite line. A circle at the boundary of the parent symbol
indicates which of the variables is the parent (useful if you have a submodel as a child).
A public variable can be included in the parent's diagram. It will be connected to its parent with a
satellite line and a small circle indicates the parent of the relationship.
If you include a flow rate in a parent diagram, the flow itself will also be included if it is open in one
end. If it is connected in both ends, the flow will not be included.
Note! When you edit the definition of an included variable, all variable references are relative
to the parent rather than the child variable itself. This means that you don't have to type
"Parent~" for each variable you use in the included variable's definition. However, if other
variables (siblings of the parent) use the included variable in their definitions, they must use the
correct syntax (Model_1.Auxiliary_1 in the picture above).
Anonymous flows
Anonymous flows allow you to merge several flows from a submodel to the same level into one flow
without a flow rate. This hides implementation details if desired, and indicates how flows run through
your system.
Two (or more) flows from the same submodel into the same level can be simplified into an anonymous
flow.
- 141 -
When a variable has a diagram book, it receives a small diagram indicator in the lower left corner.
Any variable in Studio can have its own diagram book.
The diagram book can be opened in two ways:
!
!
- 142 -
a)
b)
- 143 -
In the final model, the auxiliary Payroll Tax can be used to control a flow deducting the payroll tax
from the company account. To see the entire example, please click here.
a)
b)
A flow can either be connected directly to a) a submodel or to b) a public level that is included in the
parent diagram.
Public flows to and from submodels
Public flows (flows controlled by a public auxiliary) can be included in a parent diagram. If you
include a flow rate, the flow will automatically be created. You may also create the flow manually,
and attach the flow rate to the valve manually. The flow itself is connected directly to the submodel,
- 144 -
A flow can either be connected directly to a) a submodel or to b) a public level that is included in the
parent diagram.
Note Observe that even if both the level and the flow rate are public, you are not allowed to
connect them in the parent diagram. This prevents implementation details from the submodel to
be exposed in the parent diagram.
a)
b)
c)
If a child variable refers to a variable outside the submodel, a link is optional as long as the child
variable is not included in the parent diagram. When the child variable is included, the link is
required, as in c above.
If a variable on the submodel's level refers to one of its children, a link is only required if the child
variable is included in the parent diagram. as illustrated below. Otherwise, a link between the
submodel and the referring variable is optional.
- 145 -
a)
b)
c)
If a variable refers to a child variable inside the submodel, a link is optional as long as the child
variable is not included in the parent diagram, as shown in a) and b) above. When the child variable
is included in the parent diagram, the link is required, as shown in c) above.
The same applies to child variables that refer to the child variables of other submodels. In this case, a
link is optional between the two submodels as long as none of the child variables are included. A link
from one submodel to an included child variable, however, will become inconsistent. To make a
consistent diagram, include both child variables and draw the appropriate link between them.
Create a Submodel
1. Click
Create Submodel on the Diagram toolbar.
2. Click in the active diagram where you want to place the submodel, or click and drag to create a
submodel of a different size.
3. Right-click the submodel and select
Open Diagrams to create a submodel within it. You can
also define it in the
Equations View.
The diagrams for the submodel are created when you open them the first time. They are available on
the submodel's shortcut menu and in the
Project Window.
Note! If you delete a submodel that has diagrams, you cannot undo the deletion! The deleted
variable, all its child variables, and all its diagrams will be lost.
Tip! You can create submodels from existing components in both the current project or in any
other simulation project you have created. Use the
Copy Component into Submodel
command to achieve this.
Tip! You can drag the submodel to the desired shape and size when creating it, or you can
resize it after it has been created.
If you double-click
Create Submodel, the tool becomes persistent, so that you can insert multiple
auxiliaries without having to click the tool each time. When you are finished, click Pointer or hit
Esc.
- 146 -
implementation of the original component, these changes must also be done in the submodel
manually.
When a component is copied as a submodel, all variables that have a defined transfer direction will be
automatically converted to public variables. Also, if you deselect the Keep Definition in Component
Copy option on the Advanced property page, the definition of the variable will not be copied. This
makes it easier to connect the interface variables of the submodel to the rest of the model. When you
draw a link to a submodel, a dialog box containing the public child variables of the submodel will
appear. If you select a child variable in the list and click OK, a link is created to the submodel, and
the selected public child variable will automatically refer to the variable at the starting end of the link.
When you copy components as submodels, you can copy components from the same project or from
external files.
To create a good submodel from a component
!
Define a transfer direction for variables that provide input or output from the component (although
not required, defining input variables as in and output variables as out will make your component
model easier to read);
Let the input variables contain only a single value, as this makes it a lot easier to connect the
submodel to the surrounding model. Deselecting the Keep Definition in Component Copy option
for these variables will make it even easier to connect the submodel.
Give the component an intuitive name so you can easily find it when you want to include it in your
models.
- 147 -
1. Right-click the submodel symbol and select Include Variable on the shortcut menu.
2. Click in the diagram where you want to include the child variable. If there is more than one public
variable in your submodel that is not included, a dialog box will appear. Select the variable you
wish to include and click OK.
The included variable will be connected to the submodel by a satellite line. A circle on the submodel
symbol indicates the owner symbol.
When a variable has a diagram book, it receives a small diagram indicator in the lower left corner.
Any variable in Studio can have its own diagram book.
To open the diagram book:
!
Open Diagrams.
If the variable doesn't already have a diagram book, a new will be created.
To open the diagram book (when it already exists):
!
Browse the
Project Window. Below the Shared Diagrams node, you will find the diagram
books of the various variables. Browse to the variable you wish to view, double-click the diagram
node, or right-click it and select
View on the shortcut menu.
- 148 -
a)
b)
- 149 -
c)
A flow controlled by variables can either be connected directly to a) a submodel or to b) a public
level that is included in the parent diagram. A flow controlled by child variables that are included in
the parent's diagram can be connected directly to the submodel. These flows cannot be connected to
the child level, even if it is included in the diagram.
When you attach a flow to a submodel symbol, a dialog box containing all the public levels of the
submodel appears. You use this dialog box to select which level you want to connect the flow to.
To connect a flow with external flow rates to a submodel
To create a flow as illustrated in figure a) above:
1. Create a flow and connect it to the submodel.
2. If the submodel doesn't contain any public levels, you will not be allowed to attach the flow to the
submodel symbol. Otherwise, if there is only one public level in the submodel, the flow is
automatically connected to this level. Finally, if the submodel contains more than one public
level, a dialog box appears. Select the level you wish to connect the flow to in the dialog box that
appears, and click OK to exit the dialog box and create the flow. If you click Cancel, the
operation is aborted (no flow is created).
To create a flow as illustrated in figure b) above:
1. Right-click the submodel and select Include Variable on the shortcut menu.
2. Click where you want to place the included level, and select the appropriate level in the dialog
box that appears (if you have more than one public variable in the submodel that hasn't been
included yet). Click OK to include the variable.
3. Create a flow and connect it to the included level.
To connect a flow with internal flow rates to a submodel
Note! Only flows controlled by public variables and that are unconnected in one end can be
included in the parent diagram.
To create a flow as illustrated in figure c) above:
1. Right-click the submodel, and select Include Variable on the shortcut menu.
2. Click where you want to place the included flow rate, and select the appropriate flow rate in the
dialog box that appears (if you have more than one public variable in the submodel that hasn't
been included yet). Click OK to include the flow rate. The flow will be automatically included in
the diagram provided it is unconnected in one end.
Note! If you wish to include only the flow rate and not the flow itself, you follow the procedure
above. When the flow is included, right-click it and select
Exclude Flow(s) on the shortcut
menu.
- 150 -
a)
b)
You can greatly simplify the flow structure of your model by using anonymous flows. The models in a)
and b) show the same model structure, but a) uses ordinary flows, while b) utilizes anonymous flows.
The valve will return on the flow if you right-click it and deselect the Anonymous Rate option. To
make the flow valid, you must also include the flow rate controlling the flow, and connect it to the
valve of the flow, otherwise the flow will be inconsistent.
- 151 -
You use the mouse to control a lot of the operations in Powersim Studio. You can copy, move, resize,
select and format objects in the diagram using the mouse. This is achieved by using ordinary dragand-drop (holding the left mouse button while dragging), and by using various keyboard accelerators
while dragging (holding down CTRL will create a copy, while no accelerators will perform a move
operation). In addition, if you drag-and-drop by using the right mouse button rather than the left, a
menu will appear where you drop the object, allowing you to select the operation to perform.
If you wish to cancel the drag-and-drop operation, hit Esc during the operation. The diagram will
scroll automatically if the target area is beyond the visible area of the diagram.
Transfer operations can be achieved in several ways. Move operations can be performed by drag and
drop, by keyboard shortcuts, or by accessing the property page for the symbol, and alter the
coordinates of the position. Cut and copy operations can be achieved by right-clicking an item or a
selection of items; by drag and drop; by accessing the Edit menu; or by using toolbar buttons. Linking
operations can be performed by accessing the controls property page, or by drag and drop.
Deleting Variable Symbols in Constructor Diagrams
When you are working with copying and deleting variable symbols in Constructor diagram, you
should be aware that a model variable can be represented by several variable symbols in different
Constructor diagrams. Likewise, a model variable can be present in the model itself without being
presented by any variable symbols in Constructor diagrams at all. The
Equations View always
shows all the variables in the model, while a
Constructor Diagram only shows a selection of the
variables in the model.
When working with variables in the
Equations View, the only operations that are required are the
- 152 -
Cut,
Copy, and
Delete.
In a Constructor diagram, however, three commands more are required to achieve all possible actions.
Include Variable will include a variable symbol for a model variable that is already present in the
model but not in the diagram. Exclude Variable will remove a variable symbol from the diagram
without deleting the variable itself from the model. And finally,
Delete Variable will delete all
variable symbols in all Constructor diagrams, and delete the model variable itself from the model.
The two commands Exclude Variable and Delete Variable are both available on the shortcut menu for
a variable symbol.
As a safety precaution, the
Delete command in a Constructor diagram works as a combination of
Exclude Variable and Delete Variable. The functionality of the Delete are shown below.
The functionality of the
Constructor diagrams:
Delete command in
1. If the variable symbol you are trying to delete are present in other diagrams as well, the variable
symbol will be excluded from the current diagram only. (Equivalent command: Exclude
Variable.)
2. If the variable symbol is only present in the current diagram, but is also represented by a snapshot
in the diagram as well, the variable symbol will be excluded and the snapshot be converted to an
original symbol instead. (Equivalent command: Exclude Variable.)
3. If the variable symbol is the only symbol representing the model variable in any diagram, the
variable symbol will be excluded from the diagram, and the model variable itself will be deleted
from the model. (Equivalent command: Delete Variable.)
Drag-and-Drop Operations
Powersim Studio supports a wide range of drag-and-drop operations:
Within a diagram
!
!
Dragging a variable into a Powersim control causes the control to show that variable's value during
the simulation.
Dragging with the right mouse button produces a shortcut menu which lets you select the resulting
operation.
Dragging with the Shift key makes it possible to position variables over objects (rather than
dropping them on the objects).
Hitting Esc cancels a drag-and-drop operation.
If the target area is beyond the visible area of the diagram, the diagram will scroll automatically.
Dragging into another diagram moves the object from the source diagram to the target diagram.
Dragging with the Ctrl key pressed includes (if the object is a variable) or copies (for all other
objects) the object in the target diagram.
Dragging a variable from the
Equations View (alternatively the
Details Window) onto a
diagram, includes the variable in the diagram.
Dragging an object from a diagram of one component to a diagram of another component, moves
- 153 -
Exclude Variable on
- 154 -
Using
Delete
Deleting a variable symbol using Delete causes the symbol to be removed from the diagram.
If the symbol is the last symbol representing the model variable in ANY Constructor Diagram,
the model variable itself will also be deleted from the model. To remove the last variable
symbol from your diagrams but still keep the variable in the model, right-click it and select
Exclude Variable on the shortcut menu.
1. Select the variable(s) that you want to delete from the diagram.
2. Select Delete on the Edit menu, or hit Delete on the keyboard.
If you deleted a level that was connected to a flow, a cloud will replace the level in the diagram.
Note that other variables that received information from the deleted variable through a link will now
have illegal definitions.
Using
Exclude Variable
Excluding a variable symbol using Exclude Variable causes the symbol to be removed from
the diagram. The model variable will not be deleted from the model.
1. Select the variable(s) that you want to exclude from the diagram.
2. Right-click the variable (or one of the variables), and select Exclude Variable on the shortcut
menu.
Using
Delete Variable
Deleting a variable using Delete Variable deletes the model variable itself in the model. All
variable symbols representing the model will automatically be removed from all diagrams.
1. Select the variable(s) that you want to delete from the model and diagram.
2. Right-click the variable (or one of the variables), and select Exclude Variable on the shortcut
menu.
- 155 -
The default name of a copy is 'Copy of <Original Name>'. Edit it as you like.
Tip! When copying between diagrams, hover over the sheet tab of the target diagram to change
active diagram.
2. Click
Copy in the toolbar or on the Edit menu, or use the shortcut Ctrl-C.
3. Go to the file where you want to use the picture, and paste it there (usually using a
- 156 -
Paste tool).
- 157 -
2. Select the type of objects you want to select in the Select Special dialog box. Click All to check
all options in the dialog box, and None to uncheck all options.
3. Click OK to select the specified objects, or Cancel to exit the dialog box without selecting any
objects.
Tip! To deselect an already selected object, click it while holding down the Shift key.
!
!
Move an Object
1. To move an object within or between diagrams, simply drag it to the desired position. Links and
other connectors will be automatically updated.
- 158 -
Note! Deleting a variable symbol in a diagram causes the symbol AND the underlying variable
to be removed from the model. In order to remove only the symbol from your diagram but keep
the variable in the model, right-click the symbol and select Exclude on the shortcut menu.
- 159 -
A node has adjustment handles that can be used to alter the shape of the connector on both sides of it.
Each segment of a line can also be individually adjusted. You have two choices: Straight and Curved.
If a segment is set to straight, it will override the settings of the adjacent node handles. This is shown
in the figure below.
A segment can be either straight or curved. If a segment is straight, it will override the adjustment
handles of the adjacent nodes.
You can also change the appearance for the entire line by using the line operations available on the
shortcut menu when you right-click a line. These line operations allow you to alter all nodes or
segments of a line at the same time. You can also change the line into one straight or curved segment
if you wish to.
Finally, a line can be elbowed, in which case all segments are straight, and all nodes are straight
angles, as shown below.
A line (the entire line) can have elbow shape. When a line is elbowed, all segments are straight, and
- 160 -
the nodes have no adjustment handles. When a node is moved, the segments next to it are also moved
correspondingly.
Types of Nodes
Nodes are used to shape lines in the diagram. A node affects the shape of the segments next to it,
allowing you to control the appearance of the line's segments freely. When you add a new node to a
line, it will always be an Automatic node, controlled automatically by Studio. You can however
change the type of the node by right-clicking it and selecting a new type on the shortcut menu.
There are four types of nodes: Automatic, Symmetrical, Smooth and Cusp. The table below
summarizes the differences between the types. The difference lies in the degree of freedom you have
when altering the control handles of the node.
Node
Illustration Description
Automatic
Studio takes care of the layout of the curve automatically. (If you
change the control handles, the node is automatically changed into a
Symmetrical node.)
Symmetrical
Smooth
The control handles are changeable. They will always form a straight
line, but they can have different lengths. The node ensures that the
adjacent segments are smooth but not symmetrical at the node.
Cusp
Types of Segments
Segments are the portion of a line that lies between two nodes. There are two types of segments:
Straight and Curved. If the segment is curved, the control handles of the nodes can be used to shape
the segment. If the segment is straight, however, the segment will be drawn as a straight line between
the nodes.
If you have made an elbowed line, all the segments of the line will all be straight. In addition, the
nodes will not only affect the position of the end (or start) of the segment. It will also affect the
starting (or ending) point of the segment, making sure that the segment is always horizontal (or
vertical). This is illustrated below.
Note! Only freeforms and flows can use the elbow style.
- 161 -
When a line is elbowed, moving a node will automatically adjust the starting and ending nodes of a
segment to ensure that the neighboring segments are always horizontal or vertical.
Note! When the Elbow option is selected for a line, the functionality for segments and nodes
are reduced. Segments can only be straight, and nodes must always have straight angles.
Add a Node
To add a new node to a line segment (of a flow, link, or freeform):
1. Right-click the segment where you want to create a new node, and select
shortcut menu.
Select the node, and alter its control points to shape the line the way you want.
Note! When you add a new node, it will always be an Automatic node. If you wish to change
the type of the node, right-click it and select a new type on the shortcut menu.
Smooth, and
Delete a Node
1. Right-click the node, and select
- 162 -
If the deleted node connected a straight and a curved segment, the resulting segment will become a
curved segment.
Tip! Hitting Del while drawing a freeform, link, or flow, will delete the last inserted node
(except the start node).
Straight and
Curved.
Select the line you wish to reshape. The nodes will appear on the line.
Select a node on the line. Control handles appear for the two segments joined by the node.
Click and drag the control handles until the segment joint has the desired shape.
Repeat the steps above for each node until the line has the desired shape.
By changing the node type you can get more flexible segment joints. To change the node type, rightclick the node and select the new node type on the shortcut menu.
- 163 -
Note! When the Elbow option is selected for a line, the functionality for segments and nodes
are reduced. Segments can only be straight, and nodes must always have straight angles.
When a line is elbowed, moving a node will automatically adjust the starting and ending nodes of a
segment to ensure that the neighboring segments are always horizontal or vertical.
You can have Studio automatically convert lines with several nodes and segments into a single curved
segment.
- 164 -
You can have Studio automatically convert lines with several nodes and segments into a straight line.
- 165 -
The Details Window can be docked on the left side of the diagram window, and will display a list
containing all the variables of the current level of the model.
The default position of the Details window is along the left side of the diagram window. If you wish,
you can also dock the window at the top of the diagram window, allowing more columns to be visible
at the same time.
Working with variables and definitions in the Details Window is identical to working with variables
and definition in the Equations View.
- 166 -
or
1. Right-click the row of diagram tabs at the bottom of the diagram window, and select
Window on the shortcut menu.
Details
The Details Window is shown (or hidden) in a column on the left-hand side of the variable window.
You can drag it to any desired width. You can also dock it on the top of the window by right-clicking
inside the view, and select Details at Top on the shortcut menu.
The Details Window appears on the left side of the Diagram Window by default, but you can also
place it at the top of the window, if you like.
Details Window can be displayed at the left or at the top of the diagram window.
1. Click
Toggle Details Window on the toolbar or on the View menu to display the Details
Window (if it is not already visible).
2. Right-click inside the view, and select Details at on the shortcut menu. Select either Left or Top
in the submenu.
Displaying the
Details Window on the top of the diagram window and using the Auto-synchronize
feature, makes the
Details Window extremely useful for constructing and debugging models, as
illustrated below.
- 167 -
When displaying the Details Window at the top of the diagram window and enabling the Autosynchronization feature, you have a terrific design and debugging environment for your models!
Details Window
1. Click
Toggle Details Window on the toolbar or on the View menu to display the Details
Window (if it is not already visible).
2. Right-click inside the view, and select Auto-synchronize Details with Diagrams on the shortcut
menu.
When you select a variable in the diagram, the same variable will be automatically selected in the
Details Window.
Tip! Hitting Alt-1 will automatically move focus to the Details Window.
Displaying the Details Window on the top of the diagram window and using the Auto-synchronize
feature, makes the Details Window extremely useful for constructing and debugging models, as
illustrated below.
- 168 -
When displaying the Details Window at the top of the diagram window and enabling the Autosynchronization feature, you have a terrific design and debugging environment for your models!
- 169 -
Auto reports can display either the current numeric value, or a time graph displaying the development
of the variable over time.
There are two types of auto reports:
!
Number auto report, which displays the current value of the variable. If the variable is an array, a
table will be displayed.
Time graph auto report, which displays the development of the variable's value over time as a
graph.
Each variable can only have one auto report associated with it. When the auto report is switched on
the first time, it gets a default position close to the variable, opposite from the variable name. You can
drag it to another position, if you wish to. You are also free to format it in any way you please. When
the auto report is deleted, position information and formatting is deleted with it.
or
1. Select the variable(s) that you want to show a number auto report for.
2. Select the arrow on
Show Auto Report, and select
Number Auto Report from the
dropdown list.
A number auto report will be displayed opposite the name symbol of the selected variable(s).
- 170 -
The number auto report displays the current value of the variable.
Tip! When you click
Show Auto Report, an auto report of the same type as the last inserted
auto report is inserted automatically.
A time graph auto report shows the value development of the variable over time.
Tip! When you click
Show Auto Report, an auto report of the same type as the last inserted
auto report is inserted automatically.
- 171 -
Delete Auto
- 172 -
Right-click the auto report, and select Delete on the shortcut menu.
Right-click the belonging variable symbol, and select
Delete Auto Report on the shortcut
menu.
Select the belonging variable symbol in the diagram, and click
Delete Auto Report on the
toolbar
- 173 -
Rulers
You can turn on (and off) rulers for each diagram. The setting will be saved for each diagram
individually. Rulers make it easier to align objects properly with each other, and they also make it
easier to add guides to your diagram.
Guides
Guides are straight lines that you can use to align objects on the diagram. You can insert both vertical
and horizontal guides. When used in combination with the regular grid, a guide will have precedence,
making the object snap to the guide rather than the grid. You use the Alt key to reverse the setting of
the Snap to Guide setting, but this works in conjunction with the Snap to Grid setting in the
following way:
With Alt key
Setting
Off
Off
Off
On
On
Off
Off
Off
On
On
Off
Off
Off
On
On
Tip! When the rulers are visible you can easily add guides by clicking inside the corresponding
ruler and drag a new guide onto the diagram area (click inside the horizontal ruler for a
horizontal guide, and inside the vertical ruler for a vertical guide). You can remove a guide
from the diagram by dragging it back onto the corresponding ruler again.
Select
Rulers on the View menu.
Right-click the diagram (outside symbols or objects), and select
Tip! When the rulers are visible, you can easily insert guides by clicking inside the ruler, and
drag a new guide onto the diagram.
Select
Grid on the View menu.
Right-click the diagram, and select
- 174 -
Select
Guides on the View menu.
Right-click the diagram, and select
Guides on the shortcut menu.
You can of course snap to guides even though they are not visible in the diagram.
You can temporarily reverse the setting of the Snap to normal grid option by holding down the Alt
key while working. The permanent setting will be restored when you release the Alt key.
Note! The Alt key will also temporarily affect the Snap to guide setting. The effect will vary
according to the permanent setting of the two options.
- 175 -
Click
Snap to Guides on the Layout toolbar or menu.
Right-click the diagram (outside objects or symbols) and select
Snap to Guides on the shortcut
menu.
Select (or deselect) the Snap to guides option on the Guide Settings property page to turn snapping
on (or off). The property page is available by right-clicking the diagram and selecting
Diagram
Settings on the shortcut menu.
You can temporarily reverse the setting of the Snap to Guides option by holding down the Alt key
while working. The permanent setting will be restored when you release the Alt key.
Note! The Alt key will also temporarily affect the Snap to Grid setting. The effect will vary
according to the permanent setting of the two options.
- 176 -
You can temporarily reverse the Snap to guides setting by holding down Alt while working. The
effect is, however, dependent on the setting of the Snap to normal grid option. The table below
summarizes the behavior of holding down the Alt key for the various combination of the two
options.
With Alt key
Setting
Off
Off
Off
On
On
Off
Off
Off
On
On
Off
Off
Off
On
On
Insert Guides
You may insert horizontal and vertical guides in the diagram window by drag and drop:
1. If rulers are not displayed, then display them by selecting
Rulers on the View menu, or by
right-clicking in the diagram and selecting
Rulers on the shortcut menu.
2. To insert a horizontal guide, click inside the horizontal ruler and drag a new guide onto the
diagram area.
3. To insert a vertical guide, click inside the vertical ruler and drag a new guide onto the diagram
area.
Inserting a vertical guide is achieved by clicking inside the vertical ruler and dragging a new guide to
the desired position in the diagram.
You may insert guides on the Guide Settings property page as well:
1. Right-click the diagram (outside symbols or objects), and select
Diagram Settings on the
shortcut menu.
2. Click Guide Settings.
3. Insert guides by clicking New in the appropriate list box (Vertical for vertical guides and
Horizontal for horizontal guides).
4. Enter the position of the guide. Valid units are Point (pt), Centimeter (cm), and Inches (in).
5. If you wish to lock the guide in position, click Lock. When a guide is locked, you cannot move
it by drag and drop in the diagram.
6. Repeat steps 3 to 5 to create as many guides as you need.
7. Click OK to save the changes, or click Apply to save the changes without closing the dialog box.
Move Guides
If the guide is not locked on the property page, you can move it by drag and drop:
- 177 -
You can also move the guide on the Grid Settings property page:
1. Right-click the diagram (outside symbols or objects), and select
Diagram Settings on the
shortcut menu.
2. Click Guide Settings.
3. Select the guide you wish to move.
4. Hit F2 and enter the new position of the guide.
5. Repeat steps 3 and 4 for all guides you wish to reposition.
6. Click OK to save the changes, or click Apply to save changes without closing the dialog box.
Delete Guides
To delete a guide from the diagram:
1. Move the mouse pointer over the guide you wish to delete. The cursor will change into one of
these cursors:
.
2. Drag the guide out of the diagram by drag and drop:
! If the guide is horizontal, drag it beyond the top edge of the diagram and drop it.
! If the guide is vertical, drag it beyond the left edge of the diagram and drop it.
You can also delete guides on the Guide Setting property page:
1. Right-click the diagram (outside any symbols or objects), and select
Diagram Settings on the
shortcut menu.
2. Click the Guide Settings tab.
3. To remove a vertical guide, select it in the Vertical list, and click Delete. Click
Delete All
to delete all the guides in the list.
4. To remove a horizontal guide, select it in the Horizontal list, and click Delete. Click
Delete
All to delete all the guides in the list.
Tip! You can turn off the display of guides and turn guide snapping off if you wish to disable
guides without deleting them from the project.
- 178 -
Properties on the
or
1. Double-click the object you wish to modify.
or
1. Select the object you wish to edit, and hit Alt-Enter on your keyboard.
Although all attributes of an object are shown, not all can necessarily be edited. Sometimes you have
to select an object (or an object's sub-object, like a name box) explicitly to gain access to the
characteristic you want to change.
Tip! Many of an objects' properties can also be set on the shortcut menu or by using toolbar
buttons. Right-click the object - or part of the object - to see what is available on the shortcut
menu.
- 179 -
Format Text
You can format the text of several objects or sub-objects in Studio. Most of the text formatting
options are available on the Format toolbar. Alternatively, you can use the Font property page in the
Properties dialog box.
You must first select the object(s) you wish to format.
!
!
!
!
!
!
!
!
!
!
!
To change font, select the font you want in the Font box.
To change font size, use the Font Size drop-down box.
To make the text bold, click Bold.
To make italics, click Italic.
To underline text, click Underline.
To select the color previously selected, click
Font Color.
To select a color, click the arrow in
Font Color, and select a new color.
To left align the text, click Align Left.
To center text, click Center.
To right align text, click Align Right.
To justify text, click Justify.
Tip! You can remove underline, bold, or italic formatting by clicking the button once again.
Click
Diagram Settings on the toolbar or on the Diagram menu.
Click the Fill tab.
Select the fill type and colors on the Fill property page.
Click OK to save the changes, or Apply to save the changes without exiting the dialog box.
Note! The background color of the diagram is ignored when you print your diagram.
- 180 -
2.
3.
4.
5.
Studio currently supports three picture formats: Windows Bitmap (*.bmp), Windows Metafile
(*.wmf), and Enhanced Metafile (*.emf).
!
!
!
!
!
Click Align Top Edges to align the top edges of the selected objects to the top edge of the
dominant one.
Click Align Bottom Edges to align to the bottom edge.
Click Align Left Edges to align to the left edge.
Click Align Right Edges to align to the right edge.
Click Align Horizontal Centers to align the objects centered horizontally.
Click Align Vertical Centers to align objects centered vertically.
- 181 -
Space Evenly
The objects will be spaced evenly across the boundaries of the selection.
Tip! The commands are available on both the Layout menu and toolbar.
- 182 -
!
!
!
Click
Click
Click
Make Same Width to make the objects the same width as the dominant object.
Make Same Height to make the objects the same height as the dominant object.
Make Same Size to make the objects the same size as the dominant object.
Position Objects
Objects and symbols can be positioned in different ways.
1. Select the object and drag it to its new position in the diagram.
Or:
1. Select the object(s) and click
Properties on the toolbar.
2. Enter the exact position of the symbol under the Symbol tab of the Property pages.
Note! Coordinates [0,0] designate the upper left corner of the diagram.
See also the various specialized commands for aligning, spacing and moving objects.
Resize an Object
1. Select one or more objects and click
Properties.
2. On the Symbol tab, specify a new width and height under Width and Height respectively.
Or:
1. Select the object you want to resize. Move the pointer over one of the handles that appear on the
edges of the object.
2. Drag the handle to achieve the desired size.
Tip! Reverse the default Snap to Grid setting by holding down the Alt key while resizing.
Press Ctrl to change the point from where the object is resized - from the center or from the
corner.
- 183 -
!
!
- 184 -
object(s).
Click
Shape Type to apply the same shape as was used the last time.
You can also use the Properties dialog box to change the fill color.
1. Select the object and click
Properties.
2. On the Property pages, click the Fill tab.
3. Select a color and click OK.
Tip! To format several objects at the same time, select them all before assigning the formatting.
- 185 -
About Bookmarks
Bookmarks are used to defined target locations for hyperlinks. When you insert a bookmark in your
diagram, you can choose whether it should have extent or not (see illustration below).
- 186 -
centered on the page when visited. If the bookmark has extent, you can also allow Studio to
automatically zoom the area within the bookmark when it is visited.
When used in combination with hyperlinks, bookmarks offer an excellent way of navigating in
simulation projects.
About Hyperlinks
Hyperlinks constitute a way of jumping between various locations in your simulation project.
Although hyperlinks can be used in all view modes - Design, User, and Presentation - they are more
effective for the latter two. When combined with bookmarks and frames with picture fills, you can
create image maps as simulator interfaces. It is only your own imagination that limits the potential of
such simulator interfaces.
You should be aware that when Studio is in Design Mode, you will not be able to use the hyperlink by
clicking it, as this will only select the hyperlink (and/or the text inside it). To open the hyperlink in
Design Mode, you must right-click the hyperlink object and select Open on the shortcut menu. To
gain full advantage of the hyperlink, you should switch to User or Presentation Mode.
Available Targets
Although bookmarks will in many cases be the target location for a hyperlink, it accepts a lot of other
locations as well. Using hyperlinks, you can jump to:
!
!
!
- 187 -
hyperlink from a shared diagram to a private diagram, you must use absolute links. Absolute
hyperlink targets make reference to a unique identifier within the simulation project itself. Hence, by
using absolute hyperlink targets, you can jump from any diagram within any component and
simulation, to any other diagram within the simulation project.
Creating absolute hyperlinks from a shared diagram to a private diagram within a simulation is not
recommended. If you later add more simulations, the link would appear in all simulations, but the
would inevitably lead to one particular private diagram in one of these simulations.
If you are creating a "global homepage" for a simulator that allows your simulation users to select a
given simulation or component, you must use absolute hyperlinks. In this case, we recommend that
you create a separate component for this homepage, to avoid cross-linking between various
simulations within the same component.
Add a Frame
To create a frame with the previously selected (or default) shape:
1. Click Frame.
2. Drag the frame to the desired size and position in your diagram.
To create a frame with a different shape:
1. Click the arrow in next to Frame, and select the shape you want.
2. Drag the frame to the desired size and position in your diagram.
The frame snaps to the grid if it is turned on. To temporarily reverse the grid setting, press Alt while
dragging.
Tip! When you have created a frame, you can change its shape by clicking
the Format toolbar, and select the new shape from the drop-down list.
Shape Type on
Shape Type on
Tip! You can also paste text directly from the Clipboard and onto your diagram. The pasted
text will be inserted in a new frame in the diagram using the default frame properties.
- 188 -
Right-click the frame you want to add a picture to, and select
Properties on the shortcut menu.
Select the Fill tab.
Select Picture under Type.
Click Select Picture.
There are three ways of selecting a picture in the Select Resource dialog box:
! If the picture has been used previously in the project, you can select it in the Resource list in the
dialog box.
! Click Browse to open an image file from a file location.
! Click Paste to paste an image from the Windows Clipboard.
6. If you insert the picture from a file or from the Clipboard, you can rename it in the Resource list.
7. Click OK to return to the Fill Property Page.
8. Click OK to save the changes, or Apply to save the changes without closing the dialog box.
Studio currently supports three picture formats: Windows Bitmap (*.bmp), Windows Metafile
(*.wmf), and Enhanced Metafile (*.emf).
Add a Bookmark
Bookmarks can be used as hyperlink targets when you create user interfaces for your simulation
model.
Tip! By giving the bookmark an intuitive name, you make it easier to identify it when you are
creating hyperlinks to it.
- 189 -
bookmark.
The bookmark snaps to the grid if it is turned on. To temporarily reverse the grid setting, press Alt
while dragging.
If the bookmark has extent, it will be drawn using a dotted line to show its area. This line will
disappear when the diagram is switched to User or Presentation Mode.
Zooming and centering a bookmark when it is visited
You can have Studio automatically center the bookmark when it is visited. If the bookmark has
extent, you can also make Studio automatically zoom the diagram to fit the bookmark within the
visible area of your screen when it is opened.
1. Double-click the bookmark you wish to alter, or right-click it and select
Properties on the
shortcut menu.
2. Select Center bookmark when visited to automatically center the bookmark.
3. Select Zoom bookmark when visited to automatically zoom the bookmark.
4. Click OK to save the changes, or click Apply to save the changes without closing the dialog box.
Add a Hyperlink
Hyperlinks are used to create user interfaces for your simulations. You can use hyperlinks in
combination with bookmarks and frames to create user interfaces that are intuitive and straightforward to use.
1.
2.
3.
4.
5.
Click
Hyperlink.
Drag the hyperlink object to the desired size and position in your diagram.
Type the text that should appear on the hyperlink (you can start typing immediately).
Right-click the hyperlink, and select Edit Hyperlink on the shortcut menu.
Select the link you wish to make under Link to. Options are Target this project, Web page, File,
and E-mail address.
6. Select the target of the hyperlink under Address. If you wish to make an absolute link to a target
in the current simulation project, deselect the Relative option, and select the target in the treeview
below.
7. Click OK to save your selections.
When you have inserted the hyperlink, it appears transparent and with no line. You can format it
visually in the same way as you can format a frame, except that you cannot change the shape of it.
You can select it by clicking the text or dragging out an area around it.
Note! Be careful when you are using absolute hyperlinks, so that you avoid cross-simulation
links. When creating user interfaces for simulations, it is recommended that you use only
relative links, since relative links will always provide jumps within the same simulation only.
The exception is when you are creating global homepages where the user is intended to select
between several available simulations (in which case it is a good idea to create these
homepages in separate components).
- 190 -
Click
Hyperlink.
Drag the hyperlink object to the desired size and position in your diagram.
Select the text and delete it.
Right-click the hyperlink, and select Edit Hyperlink on the shortcut menu.
Select the link you wish to make under Link to. Options are Target in this project, Web page, File,
and E-mail address.
6. Select the target of the hyperlink under Address. If you wish to make a absolute link to a target in
the current simulation project, deselect the Relative option, and select the target in the treeview
below.
7. Click OK to save your selections.
When you have deleted the text from the hyperlink, the surrounding area of the hyperlink will be
drawn using a dotted line instead of a transparent line. This is to make it easier for you to see where
the hyperlink is and the area it covers. When you switch the diagram to either User or Presentation
Mode, the dotted line will automatically disappear.
Note! Be careful when you are using absolute hyperlinks, so that you avoid cross-simulation
links. When creating user interfaces for simulations, it is recommended that you use only
relative links, since relative links will always provide jumps within the same simulation only.
The exception is when you are creating global homepages where the user is intended to select
between several available simulations (in which case it is a good idea to create these
homepages in separate components).
Open a Hyperlink
How to open (sometimes called visit or jump to) a hyperlink depends on the mode you are working in.
To open a hyperlink in Design Mode:
1. Right-click the link that you wish to open.
2. Select Open on the shortcut menu if you want to open the hyperlink in the current window, or
select Open in New Window if you want to open the hyperlink in the current window.
To open a hyperlink in User or Presentation Mode:
1. Simply click the hyperlink that you wish to open.
- 191 -
Fit to Picture.
Tip! You can paste a picture directly from the Windows Clipboard and onto your diagram. A
new frame with the picture as picture fill will be automatically created.
When selecting a transparent frame, you must click the border directly (or within a few pixels
distance to each side).
Note! If you select the Use as Background option on the shortcut menu of a frame, you can
force a filled frame to behave in the same way as a transparent frame.
- 192 -
Tip! You can add arrowheads or -tails to the freeform. Double-click the freeform, and specify
the arrows you like on the Arrowheads property page in the Properties dialog box.
Reshape a Freeform
Reshaping a freeform line is identical to reshaping a link. When you select the line, the nodes appear.
Use the nodes and their adjustment handles to reshape the freeform line.
The various segments that make up a freeform line are divided by nodes. Each node can be formatted.
Tip! You can change the line style, dash style, and line color of the freeform line.
- 193 -
11. Repeat steps 8 to 10 until you have defined all the necessary hyperlink spots on the image map.
12. Switch to User or Presentation Mode to test the image map.
Tip! You can also test the image map by right-clicking the hyperlinks and selecting Open on
the shortcut menu.
Click
Click
Click
Click
Delete a Hyperlink
To delete a hyperlink:
1. Right-click the hyperlink you wish to delete, and select
Tip! If the hyperlink is transparent and doesn't have a borderline, it might be difficult to select
it. If the hyperlink is not previously selected, right-clicking the text should select the hyperlink
and bring up the correct shortcut menu. If the hyperlink is already selected, it is better to rightclick the surrounding border instead.
- 194 -
Delete a Bookmark
To delete a bookmark:
1. Right-click the bookmark and select
or
1. Select the bookmark you wish to delete.
2. Hit Del on your keyboard to delete the bookmark.
Note! You should carefully check your project for broken hyperlinks when deleting bookmarks.
- 195 -
Zoom a Diagram
For a closer or more remote view of the diagram, zoom in on or out of it.
1. On the Layout toolbar, click
Zoom
2. Select zoom ratio from the drop-down list, or type in any zoom ratio between 7% and 400%.
Note! If you magnified the diagram, you may have to use the scroll bars in order to find the
part that you wanted to have a closer look at.
Zoom a Selection
For a closer or more remote view of a selected part of the diagram:
1. Click Zoom.
2. Drag an outline around the area you wish to zoom.
When you release the mouse button, the area you selected will be magnified to fit the view.
- 196 -
Zoom to Fit.
The entire diagram will be fitted within the current view, provided it is room for it there with at least a
magnification of 7%.
- 197 -
- 198 -
the speed of the simulation in relation to the selected timestep. You can also pause the simulation by
using the toolbar buttons.
There are several calendars available: Bank, Fiscal, and Gregorian. The main difference between them
is the number of days per year, and how the year is divided into weeks and months. Thus, calendar
selection will affect the number of timesteps for the simulation, since the start and stop times are
defined related to the selected calendar.
In addition to the simulation settings, the settings for the integration methods will also influence the
speed and precision of the simulation. The various integration methods available have different
characteristics and accuracy.
Simulation State represents the current situation of the simulation, and includes all values for all
variables in the component. Thus, the simulation state represents a "snapshot" of the simulation at
that specific time step.
Simulation History on the other hand, represents the history of the simulation, including all
values for all variables over the entire simulation run.
When you add a cue point to your simulation run, you actually save the simulation state of the
component in that time step. Later in the simulation run, you can recall the state at that time,
"rewinding" the simulation to an earlier time step. The value of all variables are restored to reflect the
situation at that time step, and you can continue your simulation using new strategies, should you
wish to.
The simulation history is kept for all variables by default. Keeping the history for all variables
requires Studio to store one value per time step per variable. If your simulation component contains a
high number of variables, this might result in a large dataset to store. In some situations it might
therefore be advisable to turn off the History for all Variables option in Simulation Settings, to save
RAM on your computer. If this option is turned off, the history will only be saved for variables that
are parameters to controls or that have auto reports. The consequence is that if you add an auto report
to a variable (or add the variable to a control) during the simulation, you will only see the simulation
history from that point on in the simulation. The next time you run the simulation, though, it will
behave identically to all other variables with auto reports or in controls.
When you save a simulation run, you save all the data in Studio. Thus, the selected history option will
be used when saving a simulation run. Likewise, if you have selected to save the simulation state with
the project (select the Save State option in Simulation Settings), both the final state and the history is
saved.
The Calendars
There are three different calendars available in Studio. These are
!
!
- 199 -
These calendars are different in regards to the number of days and weeks in each year. The following
table shows the various calendars.
Calendar
# of days
# of weeks
Gregorian 365, each 4th year (leap year) has 366 52 and 1 (or 2) days
Fiscal
364 days
52 weeks (exactly)
Bank
360
The Gregorian Calendar is the common calendar over most parts of the world. The Fiscal Calendar is
often used in the financial world, where each company makes up their status at the end of the fiscal
year. The Bank Calendar is also used in the financial world.
By default, only the Bank calendar is available for your simulation project. You can control the
available calendars in Project Settings, and you can select which calendar to use for your simulation
in Simulation Settings..
Note! The selection of available calendars will also affect the definition of some time units that
are dependent on the selected calendar, such as month, quarter and year.
- 200 -
that are equal to the size of the flow rate controlling them.
Unit consistency
Turning off the time unit for simulation time does not turn off the unit consistency checks performed
by Studio. However, entering units in this mode can sometimes return strange units when time is
involved in the equation. This is due to the fact that the simulation time unit is defined as unity, and
can therefore be omitted from the unit calculation. To preserve correct units throughout your model,
you should therefore avoid running in this mode if possible.
Expressions involving time values
When running simulations without time units, you are allowed to include time values (without units)
directly in your variable expressions. This can be illustrated in the following definition:
aux A = IF(TIME=2001, 1000, 2000).
In this variable definition, the assumed time interpretation interval is most probably '1 year'. If this is
the case, the value of the variable will step up from 1000 to 2000 at 1/1/2001. However, this variable
expression will be differently interpreted if the time interpretation interval is set to '1 week'. In this
case, the step will occur at 2001 weeks after 1/1/1, and most probably occur beyond the time horizon
of the model.
Although the variable expression above is valid when simulation time has no unit, using the DATE
function is recommended when creating expressions like the one above.
aux A = IF(TIME=DATE(2001), 1000, 2000)
Since the output from the DATE function is always compatible with simulation time, the expression
will always yield an unambiguous result. No matter what time interpretation interval, unit selection, or
calendar you have selected, the expression will be valid. As a result, the increase will always occur on
1/1/2001.
- 201 -
column shows the resulting unit for the variable A defined as:
aux A = 1<<m>>/TIMESTEP
// Defined in Global Units
unit m = __METER
All calendars
Time Unit Comment
UnitA
second
m/s
minute
m/min
hour
m/hr
day
week
m/wk
m/mo
90 days
m/qtr
360 days
m/yr
m/qtr
364 days
m/yr
- 202 -
- 203 -
- 204 -
- 205 -
- 206 -
you select '1 day', the value returned will denote the number of days from 1/1/1. Likewise, the time
interpretation interval will also decide the magnitude of flows, since a flow is defined as the flow rate
divided by the time step. As for the example above, a flow rate of 1 will, with '1 week' as the selected
interpretation interval, be of a magnitude of 1 per week. If '1 day' is selected, the flow rate will be of a
magnitude of 1 per day.
Tip! Setting the same value for both the interpretation value and the timestep will automatically
yield a flow of X per timestep from a flow rate of X.
Integration Methods
The simulation settings - start and stop times and timestep - affects the time horizon and resolution of
simulation results. The integration method affects the way the simulation results are calculated. The
integration method gets its default settings from the Simulation Settings for your component, but you
can further customize these to suit your needs.
The Euler integration method, which is the default integration method for a new component, will
perform one integration step per timestep. However, if your component requires it, you can specify a
higher order integration method. Powersim Studio supports four different methods of integration,
each having a different integration order:
!
!
!
!
Euler is the default method. It calculates the changes in the level variables once per timestep. This
means that in complex simulations, it needs a high number of integration steps to be accurate.
Increasing the number of integration steps (reducing the size of the timestep) can lead to two different
problems. First, it slows down the simulation process, and second, more calculations can cause more
round off errors. Worse, however, is that Euler can cause unwanted oscillations to occur in your
model.
When you encounter the problems described above, you should switch to a higher order integration
method. The second order Runge-Kutta method uses two flow calculations within the given
integration step. The reason why this yields a more accurate result - more accurate even than doubling
the number of integration steps when using Euler's method - is that the Runge-Kutta method uses a
weighted average of the two calculations: the flow during the second part of the integration step is
given more weight than the first. The higher order Runge-Kutta methods use even more sophisticated
calculation algorithms.
When you define the simulation settings for a model, you specify a time horizon and a timestep. The
integration method will perform one integration step per timestep. Thus, to increase the number of
integration steps performed during a simulation run, you must reduce the size of the timestep.
As a general rule you can decrease the number of integration steps at least as much as you increase
the order of integration. Hence, when going from Euler to the fourth-order Runge-Kutta, do not
hesitate to decrease the number of integration steps by at least a factor of four (by increasing the
timestep by a factor of four). This usually makes the simulation more accurate - the only problem is
that it tends to smooth out sudden changes. This happens because the higher order methods use the
value of the flow during the time step to calculate, while Euler's computes the next flow only once, at
the beginning of the time step.
- 207 -
About Integration
The change in a level's value is determined by integration of the flows going in and out of the level.
For example, in a model of a company's hiring policy, the level 'Workforce' has an inflow called
Change In Workforce. Change In Workforce equals Desired Workforce minus Workforce divided by
Time To Adjust Workforce (which is set to 2). The time unit is mo (month), so the gap between desired
and actual workforce is halved each month. For each time step, the area defined by the flow function
that is colored green in the illustration below, is added to Workforce.
Each time step the colored area is added to the value of 'Workforce'
The colored areas designate what is added to 'Workforce' each time step
The time step you set for the simulation run can greatly influence the integration. The graphs above
came about with a time step of 1 month. A smaller time step would mean that the calculation of the
flow would take place more often and thus increase the level of accuracy and detail, while a greater
time step would cause the opposite. For example, if Time To Adjust Workforce were equal to the time
step, the simulation results would be far less accurate:
Example of a simulation setup where the time step is too high to allow accurate integration
This presentation of how Powersim calculates the value of a level is based on the Euler integration
method. As mentioned, one way of enhancing simulation accuracy is to lower the time step. Another
way is to use one of the Runge-Kutta methods of integration.
- 208 -
- 209 -
2. Calculate a third order estimate of LT+dt by using a weighted average of F1, F2, and F3
LT+dt = LT + 2/9*F1 + 3/9*F2 + 4/9*F3
- 210 -
=
=
=
=
Dt*F(LT, T)
Dt*F(LT + 1/2 * F1, T + 1/2 * Dt)
Dt*F(LT + 1/2 * F2, T + 1/2 * Dt)
Dt*F(LT + F3, T + Dt)
2. Calculate a fourth order estimate of LT+Dt by using a weighted average of F1, F2, F3, and F4
LT+Dt = LT + 1/6*F1 + 2/6*F2 + 2/6*F3 + 1/6*F4
- 211 -
Reset a Simulation
To reset the simulation:
1. Click
Tip! You can start the simulation again without resetting it by simply clicking Play.
Tip! Cue points can be inserted both when the simulation is paused and when it is running.
Go to a Cue Point
Cue points allow you to "rewind" the simulation to a given point in the simulation run, and replay the
simulation from that point on. When you go to a cue point, all variables are reset to the value they had
at that point in the simulation. Cue points are saved with the simulation run.
Note! When you go to a previously inserted cue point, cue points between the activated cue
point and the simulation end will be lost. All variable history from the activated cue point and
to the end of the simulation is also lost! It might therefore be a good idea to save the simulation
run before "rewinding" to prevent loss of valuable information!
To go to a last cue point in the simulation:
1. Select
- 212 -
Note! Permanent variables are ordinary constants or levels with the Permanent option set on
the Definition property page.
Store in Runs: Simulation runs can be stored under the component's collection of simulation runs,
located under Runs under the component in the Project Window.
Save to disk: Simulation runs can be saved to disk (in *.sir-files). This is useful if you want to
share the simulation run with peers who have the (exact) same simulation project on their
computer.
The simulation state (the value of all variables at the current time step).
The history of variables used in controls and auto reports (or all variables, if the History for All
- 213 -
You can activate previous simulation runs in the model. When you do this, all information from the
current active run will be replaced by the information from the previous run.
Use Stored Simulation Runs as Reference Data
You can use previously stored simulation runs as reference data in the active simulation run. When
you create parameters in controls, you can create two different types of parameters: Active Run
Parameters and Reference Data Parameters. When you have specified a simulation run to be used
for reference data, reference data parameters will become visible in controls, displaying the values of
the corresponding variable in the selected run. This allows you to visually compare the results of the
current simulation run with a previous run. Reference data parameters are prefixed with an
'*' (asterisk) in controls and elsewhere.
The inventory of the current simulation run (Population) is compared to reference data from a
previous simulation run (*Population).
Simulation State (at the time step when the simulation run was saved).
Variable history (as specified in Simulation Settings).
Cue points.
Tip! You can save a run at any time in the simulation.
or
1. Open the Runs collection, available under the component in the Project Window.
2. Right-click somewhere in the white space, and select Add Active Run on the shortcut menu.
The run will be saved with a default name that you can change in the Runs view if you want to.
- 214 -
- 215 -
Double-click the Runs view under the component in the Project Window.
Right-click the run you wish to export, and select Export Run on the shortcut menu.
Enter a new name for the simulation run file, and select a location where you want to save it.
Click Save to save the simulation run. The file is saved as a *.sir-file.
Double-click the Runs view under the component in the Project Window.
Right-click in the empty area of the view, and select Import Run on the shortcut menu.
Locate the file on your hard disk, and click Open to load the simulation run.
If you want to activate the run, right-click it and select Activate Run.
Note! If your model has changed since you saved the simulation run, all the variables that have
the same dimension and data type will be restored. New variables or variables that have
changed will become NAN ('?').
- 216 -
Reference data makes it easy for you to compare your current simulation run to previously saved
simulation runs.
Tip! Only simulation runs that are marked as Public in the Runs collection will be visible when
the simulation project is viewed in Presentation Mode.
- 217 -
Note! If your model has changed since you saved the simulation run, reference data is only
available for variables that have not changed dimensions or data type since the reference data
was saved.
The animation illustrates how the report window can be used to present only a portion of the
simulation at a time. The report window has a length of one month, and when the first month is
completed, it slides by an interval of one day. The entire simulation lasts for two months.
Minor and Major Intervals
These intervals allow you to specify globally the major and minor time intervals that are being used in
your component. As an example, these intervals are used by the Time Graph Control to identify the
major and minor ticks on the time axis. You can specify them manually, or have Studio select them
automatically based on the simulation settings.
Studio uses the time intervals to major and minor tick marks on time axis, and to draw major and
- 218 -
Report Window
1.
2.
3.
4.
5.
The report window allows you to select a smaller portion of the total simulation to view.The length of
the report window specifies the portion of the simulation to view at a time, while the slide specifies
the interval by which the report window will scroll.
The animation illustrates how the Time Graph Control uses the report window to present portions of
the simulation data.
- 219 -
An example of a unit that can act as both a point and normal unit. On the left side, the unit denotes a
specific point on the temperature scale (such as 100@C, the boiling point of water). On the right side,
the unit represents an interval on the scale. This illustrates the difference between 80@C and 60@C
of 20C.
- 220 -
Atomic Units
A unit can be either derived from other units, or it can itself constitute the basis for other units to be
derived from. In the latter case, the unit is an atomic unit. You are free to create your own atomic
units as you please. Such atomic units can be 'cars', 'products', 'people', etc.
Global and Local Units
In most cases, units are created and defined globally in the simulation catalog, and are available for all
the model components. However, you can also define units that are local to the component only.
Local units must, however, be derived from global units - they cannot be atomic units. You define
global units in the
Global Units view, and local units in the
Local Units view. Both are
available from the
Project Window.
Preferred Time Unit
It is often convenient to control the time unit part of a unit calculated automatically. You can do this
by selecting a preferred time unit in the Project Settings dialog box. This preferred time unit will be
used as the default time unit for the entire project. This way, you can control whether an automatically
generated unit becomes km/s or km/hr, just to illustrate one commonly used unit of measurement.
Example:
50<<m>>/10<<s>> = 5<<m/s>>
Not all operations and functions accept point units as input parameters. This is due to the different
nature of point units as compared to normal units. To illustrate this, let us consider an example
including two dates. The difference between the two is the time interval between them, which is easy
- 221 -
to understand. However, the sum of two dates is worse, not to mention the multiple of the two. There
are therefore certain restrictions that apply when using point units in definition expressions.
Description
Example
Unit Name
m, person, stock
Short Name
m, psn, st
Plural Name
The plural name is used whenever Studio detects that m, persons, stocks
the quantity exceeds one.
Definition
Documentation A text field that you can use to document your unit.
Any text.
Any text.
Note
Unit Identifiers
The definition text of a unit can also contain several unique identifiers that enable Studio to recognize
the unit's behavior. These identifiers are used to identify atomic units (that is, units that are not
dependant on other units), local currency, the base units of the SI system, etc. The table below
explains these identifiers.
Identifier
Description
How to define it
Available under
Add Currency Unit
on the shortcut
menu inside the
Global Units view.
@(<scale>,@<offset>)
ATOMIC
__LOCALCURRENCY
- 222 -
__CURRENCY
("<string>" [=<Conversion
Expression>])
__SECOND
__METER
__KILOGRAM
__CANDELA
__AMPERE
__KELVIN
__MOLE
__RADIAN
__STERADIAN
Available under
Add Standard Unit
on the shortcut
menu inside the
Global Units view.
Pre-defined Units
When you create a simulation project in Powersim Studio, there are several units already defined in
Global Units. These units are listed in the table below. These System Units are maintained by Studio,
and cannot be altered. System Units have a green unit icon in the views.
Unit Definition
@(__SECOND; 0@__SECOND)
@(60s; 0@s)
@(60min; 0@min)
Hour.
@(24hr; 0@hr)
@(7da; 0@da)
s
min
hr
da
wk
mo
qtr
Notes
- 223 -
@__RADIAN
@
((3,14159265358979323846/180)
rad; 0@rad)
@
grad ((3,14159265358979323846/200)
rad; 0@rad)
yr
rad
deg
0.01
Notes
__METER
Meter. Based on the base unit for length from the SI system.
kg
__KILOGRAM
Kilogram. Based on the base unit for mass from the SI system.
__STERADIAN
__MOLE
Mole. Based on the base unit for amount of substance from the
SI system.
__CANDELA
__AMPERE
Ampere. Based on the base unit for electric current from the SI
system.
__KELVIN
km
1000m
cm
0.01m
(0.1m)^3
kgm/s^2
kgm^2/s^2 (= Nm)
Joule. The standard unit for energy, derived from SI base units.
kgm^2/s^3 (= J/s)
Watt. The standard unit for power, derived from SI base units.
sr
mol
cd
A
K
- 224 -
(__KELVIN; 273,15
__KELVIN)
(5/9C; -32*5/9C)
Definition
Notes
__LOCALCURRENCY
loc
EUR __CURRENCY("EUR")
BEF
DEM
GRD
ESP
FRF
IEP
ITL
__CURRENCY("ITL"=EUR/1936.27)
LUF
NLG
ATS
PTE
- 225 -
FIM
USD __CURRENCY("USD")
US Dollars (independent).
GBP __CURRENCY("GBP")
JPY
__CURRENCY("JPY")
NOK __CURRENCY("NOK")
__LOCALCURRENCY
loc
Tip! You can find the latest (daily) euro foreign exchange reference rates for most other
currencies at the
European Central Bank.
Definition
Notes
mm
0.001m
mile
1609.344m (=
1760yd)
yd
0.9144m
ft
0.3048m
in
ft/12
nm
1852m
gl
3.7853l
Hz
1/s
0.001kg
ton
1000kg
pound 0.45359237kg
knot
0.514444m/s
(=nm/hr)
mph
0.44704m/s (=
mile/hr)
Miles per hour. Unit for velocity, derived from m (meter) and s
(second).
- 226 -
- 227 -
Calendar
Unit
Gregorian Bank
s (second)
0@s+60s
Fiscal
0@s+60s
hr (hour)
da (day)
0@s+24hr
0@s+24hr
0@s+24hr
wk (week)
0@s+7dy
0@s+7dy
0@s+7dy
mo (month)
undefined
0@s+30dy
undefined
0@s+90dy
0@s+91dy
yr (year)
undefined
0@s+360dy 0@s+364dy
- 228 -
- 229 -
- 230 -
Properties on the
2.
3.
4.
5.
6.
shortcut menu.
Enter the long and plural names in Long name and Plural name respectively.
Select the Normal Unit option. The lower half of the page is activated.
Select the Derived option.
Replace the default text <scale> by the scale of the unit. (Example: To define km as a unit, enter
'1000m'.)
Click OK to finish the definition, or click Apply to apply the changes without closing the
property page.
Tip! You can also define the unit directly in the
Global Units or
Local Units views.
Simply select the cell in the column you wish to edit (click F2 if the cell isn't opened for editing
immediately), and enter the definition.
Tip! You can enter the appropriate unit (or unit expression) by selecting the unit in the list on
the right of the property page, and transfer it to the unit field by clicking the << button.
and when used, the variable definition expression can take the form
aux A = 85<<@C>>
- 231 -
Note! To be able to define a derived unit, all the units used to define it must already be defined
in your project.
- 232 -
Tip! The latter method can also be used when creating variable expressions. (Example: 100
<<m>>/ 10 <<s>>, which would produce the value 10 <<m/s>>.)
Note! If an auxiliary is defined by an expression, you are not allowed to specify the unit
yourself unless it is compatible with the computed unit.
- 233 -
Examples
The following expressions are valid:
aux A = 3<<m>>
aux B = 3<<m>>/6<<s>> (=0.5 <<m/s>>)
Instead of including literal expressions with units inside definitions of variables, we recommend you
to create constants for all such literal expressions. You can then use these constants in your variable
definitions, making your model easier to maintain.
const A
const B
aux Result
unit Result
=
=
=
=
3<<m>>
6<<s>>
A/B (yielding a unit of 'm/s')
<<m/s>>
The units of A and B are entered in the Unit box in the Definition property page. The unit of Result is
automatically calculated.
Note! To enter a point unit, always remember the preceding '@'. (Example: 20<<@C>>.)
m
km
cm
knot
= __METER
= 1000m
= 0.01m
= 1852m/hr // nautical miles per hour
= ATOMIC
=__CURRENCY("USD")
= __CURRENCY("GBP"=1.51USD)
= __CURRENCY("NKR"=0.11USD)
Using these units and the time units in Studio, we can create some examples of compatible units:
- 234 -
m/s
km/s
km/hr
2.
cm
km
3.
ppl/da (people per day) ppl/mo (people per month) ppl/qtr (people per quarter)
4.
Nkr
- 235 -
- 236 -
The three variable types as they are represented in a Constructor diagram. The flow rate is an
auxiliary that controls the flow out of a level. The flow is a continuous flow (the most common flow
type).
Editing variable definitions can be done in several ways. First, you can use the Definition Property
- 237 -
page. The Definition box of the Definition property page features advanced railway syntax checking
and color coding. Second, you can edit the definitions in the variable's definition node in the Details
Window and in the
Equations View. And third, you can use the variable name field in the
Constructor diagram to enter the definition directly. Simply start by typing an equal sign ('=') in the
same way that you normally do when entering cell formulas in spreadsheets.
- 238 -
example, while the two dimensions '1..10' and '11..20' have the same size (both containing 10
elements), their indices are not the same (the first is indexed from 1 to 10, while the second is indexed
from 11 to 20). When you manually set the dimension of a variable, you must observe that the
dimension is compatible with the variable's definition (you will be warned if this is not the case).
The Variable Type defines how the variable may be used in the model. There are three variable types
currently available in Studio: Level, Constant, and Auxiliary. The three variable types are described
in detail below. You are usually allowed to change the type of a variable after you have inserted it in
the model. However, certain restrictions apply when you do this. You cannot change the type of a
level if it has flows connected to it, since it is only levels that can have flows.
Variables can import their values from external sources through datasets. Similarly, they can export
their values. A variable can be imported in two ways. Either it can have an initial import, which
means that only the initial value of the variable is imported (the value at the start of the simulation), or
it can have a full import, which means that the variable gets its value for all time steps from the
external source. If the variable is exported, on the other hand, it is calculated in the normal way, and
the results are exported to the external source as specified in the dataset. You may also combine the
settings, allowing you to import and export values from the same variable in the same simulation.
Note! Imported values will override the values calculated by the variable's definition.
The defining expression, called the Definition is the most important part of the variable's properties.
Usually, most of the information described above can be automatically generated by the definition,
and you will experience this in your own work. The definition acts differently for the three variable
types, and it is therefore treated individually below. Applicable for all variable definitions, however,
is that the definition must follow the function and operator requirements, as set forward in the
functions' and operators' data sheets.
Levels and constants may also be defined as permanent variables (not applicable to auxiliaries). A
permanent variable keeps it value between simulation runs, as opposed to ordinary variables which
will always be initialized again when the simulation is reset. Permanent variables can therefore be
used to create levels that accumulate their value over several simulation runs, as opposed to ordinary
levels that will only accumulate their value over one simulation run. Permanent constants allow you to
create user interfaces where the values entered by the user "survive" when the simulations are reset.
Permanent variables will only be recalculated by their definitions on demand, when you click
Restore Permanent Variables.
Level
Levels are variables with memory, and their value are determined by the flows that flow in and out of
them. The value of a level at time t can always be found by the expression below, where dt is the time
step of the simulation run. As we can see by this expression, levels conserve the matter that flows in
and out of them.
Levelt+t = Levelt + inflowst - outflowst
For levels, the definition is used to calculate the initial value of the variable; the value at start-up. In
addition, a level contains a flow definition, that defines how the flows should be accumulated each
time step. The flows themselves are controlled by other variables (one per flow) that work as flow
rates.
There are three types of flows available in Studio; continuous, discrete, and logical. If one or more
flows that are connected to the level are continuous, the data type of the level must be either REAL or
COMPLEX for the flow to be defined. This is due to the nature of continuous flows, since a rate cannot
be defined in terms of integers and logical values. If the flow is discrete, the level can be INTEGER as
- 239 -
well. Obviously, for logical flows, both the flow rate and the level must be LOGICAL. The flows are
controlled by flow rates, and when creating level-and-flow structures, it is important that the
controlling flow rates and the levels match each others definitions (including units, data types, and
dimensions).
Note! The level itself can be of any of the available data types. It is actually the connected flows
that will be undefined if the data type of the level doesn't match the data type of the flow rate
that controls the flow.
When connecting a level to an external data source, you are allowed to export the entire time series
yielded by the variable. You are, however, only allowed to import the initial value, since allowing
import of later values would violate the basic principle of levels presented in the equation above.
Levels can also be defined as reservoirs (available on the Integration property page of the variable).
Reservoirs cannot be depleted below zero.
Auxiliary
Auxiliaries are "helper variables" that allow you to combine and reformulate information that exists in
your model. Auxiliaries are volatile in the sense that they have no memory and are calculated at least
once every time step. Their values are always calculated by their defining expressions. Auxiliaries are
usually defined entirely by other variables (used as parameters and operands in the defining
expression). Units, data type, and dimensions will be detected automatically, and you can in most
cases accept the automatic settings of these properties. If you decide to change them, you must ensure
that the new settings are compatible with the automatic settings given by the definition.
Tip! It is good advice to use constant variables instead of including literal constants in variable
definitions. By isolating such constants in their own variables you give yourself the opportunity
to fully utilize Studio's automatic unit detection, as well as visualize potential decision
parameters in your project.
When you create a simulation project, you define the integration order for the entire project. In
addition you can define individual integration order for selected auxiliaries. In addition to the default
option of using the project's settings, you can select between first and zero order integration. The
integration order setting for the variable is especially useful when the auxiliary is used as a flow rate.
Selecting first order integration creates a continuous flow that is unchanged over the entire time step.
Using zero order integration creates a discrete flow. If the auxiliary does not control a flow, the
integration order will only affect the calculation of the individual auxiliary, and thus only affect other
variables indirectly (by the fact that its value is not changed during the time step, as it would normally
be when using higher order integration methods).
Note! While discrete flows are similar to transactions where a certain amount is transferred at
the start of the time step, continuous flows are controlled by rates relative to time. Thus, while a
flow rate controlling a discrete flow has a compatible unit to the corresponding level, a flow
rate controlling a continuous flow must have a unit that is compatible with the level's unit
divided by time.
Auxiliaries allow you to only import the full time series, thus giving you the option of either
calculate all values for the simulation run using the variable's definition, or importing all values from
an external source. In addition, auxiliaries cannot be defined as permanent variables.
- 240 -
Constant
Constants are often used to identify and quantify the boundaries of the model, and to represent
decision parameters. They are, as the name implies, constant, and the definition only defines the
initial value (the definition is only calculated at the start of the simulation). You are allowed to assign
a new value to a constant through input controls, thereby changing the scenario of the model.
By creating permanent constants, you can create constants that not only keep their values over one
simulation run, but also keeps its value between simulation runs. Permanent constants thereby allow
you to create simulations that "remember" the input given by the user.
As mentioned above, it is often useful to create constant variables rather than including literal
constants in various variable definitions. This cleans up your model, and visualize parameters that
might be decision parameters in your system. It also enables you to gain full effect of Studio's
powerful unit detection capabilities. Also, should you have to change units at a later stage, you will
only have to do so for a handful of constants rather than going through all the variables of your
system to find them.
About Reservoirs
A reservoir is a level that cannot be depleted below zero. In other words, it does not permit a negative
initial value and a reservoir's outflow is leveled out when the reservoir's value reaches zero.
Note! A reservoir will never become negative, but rather become undefined (NAN) if an outflow
tries to empty it below zero. The outflow should therefore handle the situation when the
reservoir becomes zero specially.
When the reservoir approaches zero, the simulation engine divides the time step into smaller parts, to
ensure that the depletion is performed correctly. When the value of the reservoir reaches 0, the normal
- 241 -
=
=
=
=
With normal levels, such a depletion of a level is difficult to program. Usually the feedback would
lead to an uncontrollable oscillation in the level. With reservoirs, the simulation engine will divide the
time step into smaller parts, to ensure that the depletion is done correctly. When the value of the
reservoir reaches 0, the normal time step is resumed, and the simulation continues as normal.
Example 2
The second example model shows a simpler case than the model above. In this model, the reservoir is
depleted with a constant value until it becomes zero, in which case the flow out of the reservoir ends.
In addition, it also illustrates the difference between using a level and reservoir for modeling this
behavior.
- 242 -
If we, on the other hand, define Level as an ordinary level, the result will be quite different. In this
case, the level will drop below 0 before the flow rate can reduce the outflow. In this case, the final
value of the level will be too low. The behavior of the model (using a level rather than a reservoir) is
shown below.
Finally, if you leave the flow rate constant throughout the simulation, the reservoir will become
undefined as its value drops below zero. The behavior of the model (using a reservoir but not
including a feedback to the flow rate) is shown below.
The examples require that there are no previous definitions in the various boxes. If there are, please
delete them (or click Auto in front of them) before applying the changes from the example.
Note! Some of the definitions below are started by the string "def". This implies that the
variable can be of any variable type. Otherwise, "const" represents a constant, "aux"
represents an auxiliary, and "level" represents a level.
- 243 -
You can include the unit directly in the literal expressions (or literal parts of other expressions) like
this:
def Variable = 10<<m>>
Alternatively, you can use the Unit box to specify the unit:
def Variable = 10
unit Variable = m
If you define an array, you can enter the array using '{' and '}', as:
def Variable = {{1,2,3},{4,5,6}}
(auto) dim Variable = 1..2,1..3
In the latter case Studio will automatically calculate the dimension of the variable. In this case, it will
be 1..2,1..3. You can also specify the dimensions yourself, if you wish to. You can also specify
the dimensions explicitly. In addition, if all elements are equal, you don't have to enter all the
elements separately.
dim Variable = 4..5,8..10
def Variable = 4
result Variable = {{4,4,4},{4,4,4}}
If units are included in the expression, they must be included together with one or both of the
operands:
def Variable = 10<<m>>/5<<s>>
unit m = __METER // Added in Global Units
You can only explicitly set a unit for the variable that is compatible with the unit yielded from the
expression itself. In the above example, you can only set a unit that is compatible with m/s.
def Variable = 10<<m>>/5<<s>>
unit Variable = m/hr
- 244 -
If several operators are involved in the expression, the calculation order and operator precedence is
used to evaluate the expression. Thus, the expression
def Variable = 10!+5/3
Most of the operators accept arrays as operands, except where noted on the operator's reference sheet.
The default operators will perform the operation element by element. If you wish the operation to be
performed according to mathematical rules for arrays (such as matrix division, etc.), you can precede
the operator by '#' (hash). The difference between the division ('/') and array division ('#/') operators
are illustrated below.
def Variable_1 = {{1,2},{3,4}}
def Variable_2 = {{5,6},{7,8}}
def Variable_3 = Variable_1 / Variable_2
result Variable_3 = {{0.2,0.33},{0.43,0.5}}
def Variable_4 = Variable_1 #/ Variable_2
result Variable_4 = {{3,-2},{2,-1}}
The ABS function will also accept another function expression as its input parameter.
def Variable = ABS(2*SINWAVE(1,90<<da>>))
The expression above can also be modeled using three different variables, which is the preferred
method to do this. We would use two auxiliaries named Sine Wave and Positive Wave and a constant
named Period. The variable definitions are shown below.
Note! When referring to variable names with spaces, you must always enclose them in
apostrophes (').
const Period
aux 'Sine Wave'
= 90<<da>>
= SINWAVE(1,Period)
- 245 -
The output from this simple model is shown in the time graph below.
= {{32,14,23,52},{42,61,93,38},{49,10,20,31}}
= {ARRSUM(Array),ELEMCOUNT(Array),
ARRAVERAGE(Array),ARRSTDEVP(Array)}
result Summary = {465, 12, 38.75, 22.13}
Note! If Array in the above example is defined with a unit, the definition for Summary will
become invalid, since the unit of the four elements wouldn't be compatible.
You can also use the FOR and CONCAT functions to create arrays, illustrated by the two definition
expressions presented below.
def 'First Array'
result 'First Array'
def 'Second Array'
result 'Second Array'
=
=
=
=
FOR(i=1..3,j=1..2|i*j)
{{1,2},{2,4},{3,6}}
CONCAT({1,2},FOR(i=3..7|i*2),{30,40})
{1,2,6,8,10,12,14,30,40}
- 246 -
To illustrate, create four auxiliaries and name them Array, Single, Multiple, and All. The definitions
are presented below.
def Array
def Single
result Single
def Multiple
result Multiple
def All
result All
=
=
=
=
=
=
=
{{32,14,23,52},{42,61,93,38},{49,10,20,31}}
Array[2,3]
93
Array[1..2,3]
{23,93}
Array[*,3]
{23,93,20}
The second example above, resulting in the array Multiple, uses a numerical subrange (1..2) to
index the array. When indexing arrays, such numerical subranges can be open in one end (replacing
the start or end index with '?'). If they are open, Studio assumes that the ranges include the elements to
the end of the dimensions. The example below, which requires three variables Array, A, and B,
illustrates this.
def Array
def A
result A
def B
result B
=
=
=
=
=
{{32,14,23,52},{42,61,93,38},{49,10,20,31}}
Array[2..?,3..?]
{{93,38},{20,31}}
Array[*,?..2]
{{32,14},{42,61},{49,10}}
Sometimes it can be useful to use ordinary variables as the index of an array. In Studio this can be
achieved in two ways; by the LOOKUP and INDEX functions. The example below illustrates both
approaches. While the LOOKUP function takes the array and the indices as input parameters, the
INDEX function converts an (integer) variable into an index variable that can be used to index the
array directly. You need five variables: Array, A, B, C and D.
def Array
def A
type A
def B
type B
def C
result C
def D
result D
=
=
=
=
=
=
=
=
=
{{32,14,23,52},{42,61,93,38},{49,10,20,31}}
2
Integer
3
Integer
LOOKUP(Array,A,B)
93
Array[INDEX(A),INDEX(B)]
93
- 247 -
def B = {6,7,8,9,10}
def C = CONCAT(A,B[6..10:6..10])
result C = {1,2,3,4,5,6,7,8,9,10}
If you try to concatenate arrays with more than one dimension, you must observe that only one
dimension is different between the arrays. The following example illustrates this. You need four
auxiliaries A, B, C, and D.
def A = {{1,2},{3,4},{5,6}}
def B = {{7,8},{9,10},{11,12}}
def C = CONCAT(A,B[*,3..4:3..4])
result C = {{1,2,7,8},{3,4,9,10},{5,6,11,12}}
def D = CONCAT(A,B[4..6:4..6,*])
result D = {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}
To be able to add the value of the flow to the value of the level, their units must be compatible. Given
the expression above, the unit of the controlling flow rate must be compatible with the unit of the level
divided by time, as shown below. Likewise, the data type of the rate and the level must match, and
they can only be REAL or COMPLEX (if the level is REAL, the flow rate is allowed to be INTEGER).
unitRate = unitLevel/unitt
Note! Reservoirs (levels that cannot be depleted below zero) cannot have first order flows
- 248 -
connected to them.
Tip! You can create discrete flows by using zero order integration.
The flow equation of the level defines how the flow is added to the level each time step. Each flow
connected to the level is presented in the flow equation, with a sign (+ or -) denoting the direction
relative to the level. Inflows are added to ('+') and outflows are subtracted ('-') from the level. The
value of the level at a given time t is therefore defined by the expression:
Levelt+t = Levelt + inflowst - outflowst
= Levelt + dt*('In Rate 1't) + dt*('In Rate 2't) + ...
- dt*('Out Rate 1't) - dt*('Out Rate 2't) + ...
where In Rate 1, In Rate 2, represents the flow rates controlling the inflows of the level, while Out
Rate 1, Out Rate 2, represents the flow rates controlling the outflows of the level. Studio will
automatically detect flows that are connected to the level, and will suggest a flow equation based on
the definition of the flow rate and the level.
Using Functions in Flow Equations
When the flow involves flow rates and levels of different dimensions, you must use flow functions in
your flow equations to define how the flow should be added to (or subtracted from) the level. Flow
functions give you exact control of how the flow flows into the level on an element basis, and
provides functionality for creating advanced structures such as queues.
// continuous flow
// discrete flow
Since the flow is simply accumulated by the level, the unit of the flow and level must be compatible.
Given the expression below, the unit of the flow rate must be compatible with the unit of the level, as
shown below.
unitRate = unitLevel
Note! When changing a continuous flow into a discrete flow, you must make sure that the unit
of the controlling rate is changed accordingly!
- 249 -
Note! You cannot use discrete flows with reservoirs, due to the special integration methods
used for reservoirs.
Before the introduction of discrete flows in Studio, discrete flows had to be modelled using
continuous flows with flow rates defined using pulse functions. The problem with these constructions
was that the flow rate was dependent on the selected time step. Changing the time step therefore made
it necessary to redefine the affected variables. Another problem was that if the time step was not 1, the
values yielded by the flow rate was difficult to relate to the quantum actually being represented. A
third problem was caused by higher order integration methods, which would subdivide the time step
and thereby causing different values. To avoid this problem, the flow rate would have to be defined
using the EULER function. With discrete flows you can now create robust model structures that are
easily defined and understood, and that are independent of the time step.
Whereas continuous flows only accept REAL or COMPLEX levels, discrete flows also accepts INTEGER
levels.
The Parts Defining a Flow
The flow is defined by two parts. The first is the definition of the flow rate variable. The second is the
flow equation specified for the level(s) it is connected to.
You can use any variable as the flow rate variable, as long as the data type of the flow rate matches
the data type of the connected level, and the flow rate's unit matches the expression above. Further,
you can alter the behavior of the flow rate by selecting an individual integration order for the flow rate
variable. To create a discrete flow the flow rate must use a zero order integration setting (available
on the Integration tab in the variable's Properties). The difference between the two settings Zero
Order and Zero Order Immediate is shown in the expressions below, where L is the level and F the
controlling flow rate.
Lt+t = Lt + Ft
// Zero Order
Lt+t = Lt + Ft+t // Zero Order Immediate
The difference between the two methods is the time at which the flow rate F is calculated, and at what
time the flow is added to the level L. When Zero Order is selected, the integration is performed at the
end of the time step. When Zero Order Immediate is selected, the integration occurs at the beginning
of the time step. This means that the variable will only be evaluated upon entry of the time step and
stay constant for the remainder of the time step. The flow rate's value calculated in the current time
step is then immediately accumulated by the level, hence the name immediate.
Note! When using immediate discrete flows, the value of the flow rate will remain constant over
the time step.
Tip! The ASSIGN function available in previous versions of Powersim Constructor can easily be
modeled using discrete flows. Using a zero order flow creates the behavior of the ASSIGN
function, while using a zero order immediate flow allows you to create a structure that
immediately assigns a value to a level when the condition occurs.
The flow equation of the level defines how the flow is added to the level each time step. Each flow
that is connected to the level is presented in the flow equation, with a sign (+ or -) denoting the
direction relative to the level. Inflows are added to ('+') and outflows are subtracted from ('-') the
level. The value of the level at a given time t is therefore defined by the expression below.
Levelt+t = Levelt + inflowst - outflowst
// zero order
- 250 -
where each in- and outflow is given as described above. Studio will automatically detect flows that are
connected to the level, and will suggest a flow equation based on the definition of the flow rate and
the level.
As for continuous flows, you can use flow functions to create flows where the controlling flow rate
and the connected level are of different dimensions.
Ot
It
where O represents the total outflows and I the total inflows, as expressed below. ( = AND,
and = NOT.)
Ot = 'O 1't
It = 'I 1't
'O 2't
'I 2't
...
...
= OR,
// Outflows
// Inflows
For logical flows using zero order immediate integration, the flow equation can be expressed as:
Lt+dt = Lt
Ot+dt
It+dt
- 251 -
Outt
Statet
//Automatic
- 252 -
The flow definition lets the content of Rate flow directly into Level.
The model produces the following time series (for the five first time steps).
Time
Level
1/1/2001 0
1/2/2001 1
1/3/2001 2
1/4/2001 3
1/5/2001 4
The flow definition lets the content of each element in Rate flow directly into the corresponding
element in Level.
The model produces the following time series (for the five first time steps).
Time
Level
1/1/2001 {0,0,0}
1/2/2001 {1,2,3}
1/3/2001 {2,4,6}
1/4/2001 {3,6,9}
1/5/2001 {4,8,12}
- 253 -
The flow definition creates the sum of all array elements in Rate and lets it flow (joint) into Level.
The model produces the following time series (for the five first time steps).
Time
Level
1/1/2001 0
1/2/2001 6
1/3/2001 12
1/4/2001 18
1/5/2001 24
The flow definition creates the sum over the second dimension for each element in the first
dimension, thereby creating a flow that has the same dimension as the level. The contents of the flow
is added to the corresponding element in Level.
The model produces the following time series (for the five first time steps).
Time
Level
1/1/2001 {0,0}
1/2/2001 {3,7}
- 254 -
1/3/2001 {6,14}
1/4/2001 {9,21}
1/5/2001 {12,28}
The flow definition creates the sum over the second dimension for each element in the second
dimension (rather than the first, which is the case for DISTRIBUTE), thereby creating a flow that has
the same dimension as the level. The contents of the flow is added to the corresponding element in
Level.
The model produces the following time series (for the five first time steps).
Time
Level
1/1/2001 {0,0}
1/2/2001 {9,12}
1/3/2001 {18,24}
1/4/2001 {27,36}
1/5/2001 {36,48}
- 255 -
The flow definition creates a new dimension by dividing the contents of the array elements in Rate by
the number of elements in the missing dimension, thereby creating a flow that has the same dimension
as the level. The contents of the flow is added to the corresponding element in Level.
The model produces the following time series (for the five first time steps).
Time
Level
1/1/2001 {{3,3,3},{6,6,6}}
1/2/2001 {{6,6,6},{12,12,12}}
1/3/2001 {{9,9,9},{18,18,18}}
1/4/2001 {{12,12,12},{24,24,24}}
1/5/2001 {{15,15,15},{30,30,30}}
The flow definition creates a new dimension by dividing the contents of the array elements in Rate by
the number of elements in the missing dimension, thereby creating a flow that has the same dimension
as the level. In DISTRIBUTETOFRONT, the flow function creates a new dimension in front of the
existing dimensions (as opposed to DISTRIBUTE, which creates new dimensions behind the existing).
The contents of the flow is added to the corresponding element in Level.
The model produces the following time series (for the five first time steps).
Time
Level
1/1/2001 {{5,10,15},{5,10,15}}
1/2/2001 {{10,20,30},{10,20,30}}
1/3/2001 {{15,30,45},{15,30,45}}
1/4/2001 {{20,40,60},{20,40,60}}
1/5/2001 {{25,50,75},{25,50,75}}
- 256 -
different dimensions.
The flow definition first creates the sum of all the array elements in Rate, and then distributes them
evenly over all the array elements in Level.
The model produces the following time series (for the five first time steps).
Note! You have to enter the flow definition above, since Studio is unable to create this flow
definition automatically.
Time
Level
1/1/2001 {{0,0},{0,0},{0,0},{0,0}}
1/2/2001 {{10,10},{10,10},{10,10},{10,10}}
1/3/2001 {{20,20},{20,20},{20,20},{20,20}}
1/4/2001 {{30,30},{30,30},{30,30},{30,30}}
1/5/2001 {{40,40},{40,40},{40,40},{40,40}}
The flow definition adds a zero element in front of the existing elements in Rate to create a flow with
the same dimension as Level.
Time
Level
1/1/2001 {0,0,0,0}
1/2/2001 {0,1,2,3}
{0,2,4,6}
- 257 -
1/3/2001
1/4/2001 {0,3,6,9}
1/5/2001 {0,4,8,12}
The flow definition appends a zero element at the end of the existing elements in Rate to create a flow
with the same dimension as Level.
Time
Level
1/1/2001 {0,0,0,0}
1/2/2001 {1,2,3,0}
1/3/2001 {2,4,6,0}
1/4/2001 {3,6,9,0}
1/5/2001 {4,8,12,0}
The flow definition appends zero elements at the end of the existing elements in Rate in all
dimensions to create a flow with the same dimension as Level.
Time
Level
- 258 -
1/1/2001 {{0,0,0},{0,0,0},{0,0,0}}
1/2/2001 {{1,2,0},{3,4,0},{0,0,0}}
1/3/2001 {{2,4,0},{6,8,0},{0,0,0}}
1/4/2001 {{3,6,0},{8,12,0},{0,0,0}}
1/5/2001 {{4,8,0},{12,16,0},{0,0,0}}
The flow definition lets the element from Input flow into the corresponding element in Container.
The difference in the dimension, the elements 2..10, are replaced by 0. The flow rate 'In Transit'
empties the contents of elements 1..9 from Container. The difference in the dimension, the element
10..10, is replaced by 0 on the outflow. On the inflow, however, a preceding 0 is added to the
array. Thereby, the contents of elements 1..9 are shifted to the elements 2..10 by the flow
controlled by 'In Transit'. Finally, the last outflow, controlled by Output, empties element 10 from
Container. The missing elements in the dimension, elements 1..9, are replaced by 0.
The table below shows the results from the simulation for the first 11 simulation steps.
Note! Since the dimensions for Input is 1..1 and Output is 10..10, the variables are
considered arrays by Studio.
Time
Input
Container
'In Transit'
1/1/2001
1/2/2001
- 259 -
Output
1/3/2001
1/4/2001
1/5/2001
1/6/2001
1/7/2001
1/8/2001
1/9/2001
This feedback loop is valid since it incorporates a time delay using a flow into a level.
It is not allowed to create feedback loops, or circular references, between auxiliaries and constants,
however. If a structure of auxiliaries are mutually dependent on each other, Studio would not be able
to determine where to start when calculating the values of the variables. When Studio detects such
circular definitions, it will mark the links and auxiliaries in the diagram to make it easier for you to
identify them. The figure below illustrates an illegal circular loop in Studio.
This circular loop is invalid since it only includes auxiliaries. Such a structure would cause an infinite
loop in the simulation engine. To help you identify the circular references, the links and variables will
be marked by question (?) marks in the diagram.
In some cases, Studio will be unable to recognize circular references. This happens when one of the
variables involved in the loop has explicit definitions for Type, Unit, and Dimension. Given the
structure above, if one of the variables is defined explicitly with regards to either Type, Unit, or
Dimension (it is sufficient to uncheck the Auto check box in front of the boxes), the structure will
appear well-defined in the diagram. However, when you start the simulation, Studio will not be able
- 260 -
to evaluate any of the variables, and they will all return the value of NAN (Not a Number). This
situation is shown below.
If the type, unit, and dimension are explicitly defined for one of the variables in the loop, then Studio
will be unable to detect the circular references. However, the values of the variables will be
impossible to determine, and will therefore be NAN (Not a Number). This will appear as a ? (question
mark) in the variables' values (here presented using auto reports).
If you suspect that there might exist circular references in your model, you should go through the
variables that are not calculated correctly (with ? as their values), and set at least one of the properties
Type, Unit, or Dimension to Auto. This will uncover any circular references present in your model, as
explained above.
<>
[]
- 261 -
You should always try to use units that best reflect the value range of the variable.
Tip! You can still view the unformatted value of the variable by hovering the mouse pointer
over the variable until a tool tip appears. The value appearing in the tool tip is unformatted.
Tip! You can always override the automatically generated unit for a variable by specifying a
unit in the Unit box of the Definition property page. The only requirement is that the two units
are compatible.
Flow equations that are generated automatically by Studio will get an automatic comment added in
the Flows box of the Definition property page. Once you have edited the flow definition, the comment
will disappear, and you are not allowed to add your own.
Note! All characters that occur between two '//'s or between '//' and the end of the line will be
ignored when Studio compiles the equations. Make sure that your comments don't interfere with
the definition equations!
- 262 -
Tip! Other variables can be used as parameters in your definition. To view the value of
individual variables in the definition, simply point to it, and a tool tip containing the variable's
value will appear:
If you are defining a level, you can inspect the level's flow definitions by clicking Flows tab above the
Definition box.
3. Enter a new variable definition or edit the old one. You can edit the name of the variable in the
same operation (type Variable name=variable definition):
4. Press Enter or click elsewhere in the diagram to finish the edit operation. The definition text
now disappears and only the name is shown.
Tip! When editing definitions in the name box of the variable, you can use soft line breaks to
format the definition in the same way you would in the Definition box on the property pages. To
create line shifts, hit CTRL+ENTER.
- 263 -
In the
Details Window, right-click the variable, and select the new variable type on the shortcut
menu.
Right-click the variable in either the Constructor Diagram or the Details Window, and select
Properties on the popup menu. On the Definition property page, select the new variable type in
the Variable Type box.
Note! You cannot change a level into an auxiliary or a constant if it is connected to a flow!
Double-click the level that you wish to change, or select it and click
Properties.
Click the Flows tab on the Definition tab.
Select the flow definition you wish to edit.
Click once inside the flow definition to make it editable.
Enter the new flow definition, and end it by hitting Enter.
Click OK to save the changes, or click Apply to save the changes without closing the dialog box.
or
1. Open the
Details Window (or the Equations View).
2. Locate the level whose flow definition you wish to edit.
- 264 -
In the
Details Window, right-click the flow, and select Automatic on the shortcut menu.
On the level's definition property page, select Flows, and enter an empty string for the flow
definition you wish Studio to calculate.
When creating flow definitions, you can use the different flow functions available in Studio. You
must also observe that the unit of the flow rate that controls the flow has the right unit. For continuous
flows, the unit should be compatible with the unit of the level divided by a time unit. If, say, the level
has the unit 'm', then the flow rate should have a unit of 'm' divided by a time unit. In this example, the
flow rate could have the unit 'm/s' or similar. For discrete flows, the unit of the flow rate should be
compatible with the unit of the level. Given the example above, both units should be 'm'.
The example below shows how a definition including several FOR and IF functions can be made a lot
more readable by using indentation and comments.
FOR(i=..,j=.. |
IF(i<=ELEMCOUNT(R[*,1]),
IF(j<=ELEMCOUNT(R[1,*]),
LOOKUP(LOOKUP(R,j),i),
0<<unitR>>
), // End IF
0<<unitR>>
) // End IF
) // End FOR
- 265 -
- 266 -
- 267 -
Note! Normally you would enter the unit of measurement for constants and levels only and let
Studio detect the units for all computed variables that depend on these. When you wish to
explicitly assign the unit of measurement, it is important that the unit you select is compatible
with the unit computed from the variable's definition.
- 268 -
Pop-up: Point to a variable in the diagram. After a short delay, the value of the variable will popup similar to a tool tip. The label will disappear when you move the mouse pointer away from the
variable.
Auto report: Right-click the variable and select
Show Auto Report and select an auto report
type on the shortcut menu. An auto report will be added to the diagram. This will, at all times,
show the current value of the variable.
Powersim control: Insert a data presentation control, such as the table or time series control, and
define the variable as a parameter.
Definition Property Page: Double-click the variable in the diagram, and view the value in the
value field below the Definition box in the Definition property page.
Definition Property Page: You can view the value of a variable that is part of another variable's
definition simply by pointing to its name in the definition. The value will appear in a tool tip:
Equations view: You can view the value of any variable by expanding the variable in the
Equations View.
Details Window: The value of a variable appears next to its name.
- 269 -
- 270 -
Note! You can only access variables on level up or down in the hierarchy. Thus, a child
variable may only access sibling variables of their parents, or child variables of their siblings.
Variables that are made public are tagged with a green dot. These variables can be accessed from
outside the model, and they can themselves access variables at a higher level in the hierarchy.
The variables K and Y in the submodel M1 are public. Thus, the variable A can use M1.K in its
definition. Likewise, the variables Y is allowed to use the variable D in its definition.
The variable B refers to the variable L in its definition, but since L is not public, the reference is illegal
and B is undefined. The same is the case for X, which refers to C outside the model without being
public. This results in an invalid variable reference. To make the definitions of B and X valid, you
must make the variables L and X inside M1 public, as shown below.
- 271 -
By defining both L and X as public variables, all the definitions in the model becomes valid.
Child Variables inside Auxiliaries, Constants, and Levels
When using child variables inside auxiliaries, constants, or levels, the child variables can not be
accessed from outside the parent variable itself. However, these child variables can freely access any
variable above them in the hierarchy. The simple example below illustrates this.
The child variables of an auxiliary, constant, or level cannot be made public. They can access
variables on a higher level of the hierarchy, but cannot themselves be accessed by such variables.
As you can see in the figure, the child variables of K, G and X can be defined by the means of K's
sibling variables. However, the variable A, which is a sibling of K, cannot be defined by referring to
the child variables of K.
The Relationship between Public Variables and Connection
Studio allows you to create components that can later be copied directly into a model as a submodel.
By defining a Connection (Transfer Direction) for the variable, it will automatically become a public
variable in the resulting submodel. The figure below shows how a component named Due Payment
can be modeled. The variable Amount defines the amount to base the calculation on, and is defined
with a transfer direction of in. Likewise, the variable Due Payment is the output from the component,
and is defined with a transfer direction of Out.
A simple component implementing the payroll tax and similar amounts to be deducted with given
periods.
When the component is copied (by drag and drop, for example) into another model diagram, it will
become a submodel. The variables that have defined a transfer direction, will automatically become
public, as shown below. You can thereafter define them using any variable on the parent level.
- 272 -
When a component is copied to a model as a submodel, all variables that have a defined transfer
direction (in or out) will automatically be converted to public variables.
Hierarchical Syntax
The discussion below shows some very simple examples of how to refer to variables at different
levels of the model hierarchy. You should keep in mind that each submodel has its own "name space",
making it possible to use the same variable name in many different submodels. Thus, it is extremely
important that you follow the rules for referring to variables very strictly, otherwise you can easily
refer to a variable in the wrong submodel!
Note! You can only refer to variables one level above or below the variable you are defining!
Consider the example below, where the submodel M1 contains two child variables. The simple model
and its definitions are shown below.
= 10
= 2*A
- 273 -
Consider the model shown below. A new variable named F on the parent's level and a new child
variable named Y inside the submodel are added. Y is also made public on the shortcut menu (or on
the Advanced property page in the Properties dialog box).
A, X, and Y are child variables of M1, while F is a sibling of M1. Notice the green dot on Y that
indicates that the variable is made public.
To define Y like it's parent's sibling F times A, we define it using the Parent~ prefix, like this:
const F = 10
Y = A*Parent~F
aux
Again, consider the simple example below. A new auxiliary is added, named K.
A, X, and Y are child variables of M1, while F and K are siblings of M1. Y is Public.
We will define K as F*Y. However, since Y is a child of M1, we must use the syntax explained
above, like this:
aux K = F * M1.Y
- 274 -
M1.C
Unavailable M3.H
Parent~A
M2.F
Unavailable Parent~C F
K
Unavailable
Parent~M3.H Unavailable
Unavailable Unavailable
Inflows: The sum of all continuous flows into the level. Can be accessed through the
variable .inflows.
Outflows: The sum of all continuous flows out of the level. Can be accessed through the
variable .outflows.
Zero Order Inflows: The sum of all flows into the level controlled by zero order flow rates. Can
be accessed through the variable .zo_inflows.
Zero Order Outflows: The sum of all flows out of the level controlled by zero order flow rates.
Can be accessed through the variable .zo_outflows.
- 275 -
Zero Order Immediate Inflows: The sum of all flows into the level controlled by zero order
immediate flow rates. Can be accessed through the variable .zoi_inflows.
Zero Order Immediate Outflows: The sum of all flows out of the level controlled by zero order
immediate flow rates. Can be accessed through the variable .zoi_outflows.
Although child variables of a level cannot be public, the generated monitor flow child variables can
nevertheless be accessed from any sibling variable of their parent level.
To Enable Flow Monitoring
1. Right-click the level you wish to monitor flows for, and select
Properties on the shortcut
menu.
2. Click the Advanced tab.
3. Select the flow types you wish to monitor under Monitored Flows.
4. Click Apply to save the changes, or OK to save the changes and close the dialog box.
The conveyor submodel. The public variables are marked with a cross in the upper right corner.
When the submodel is used, a flow is connected directly to the submodel and into the Contents level.
By monitoring the inflows of the level and accessing the total value of the inflows, any number of
flows may be connected in the main model to the conveyor submodel. The value of the inflows can be
accessed through the Contents.inflows child variable.
The variable definitions of this submodel are presented below. Note that all the input is coming from
outside the submodel, including units and dimensions. By allowing the interface variables to import
these properties, the submodel can be kept generic and can be used anywhere a conveyor is needed.
const
//
const
//
//
aux
Initial = ...
This is the initial content of the conveyor.
'Delay Time' = ...
This is the time it takes it takes for the input
to travel through the conveyor
Output = DELAYPPL(Conveyor.inflows, 'Delay Time', Initial/'Delay Time')
- 276 -
To allow variables outside to be used in the definition of the Delay Time, Initial, and Contents
variables, all of them are defined as Public. Similarly, to be able to connect the flow controlled by
Output to a level outside the submodel, Output is also defined as Public.. As you can see in the
diagram above, this is indicated by a small cross in the upper right corner of the variable symbol.
Tip! When the two variables Initial and Time in Conveyor are made public, the modeler can
control these properties without having to open the submodels diagram.
The diagram below shows how you can use the submodel in the parent model. Connect the flow
controlled by Input to the submodel, and Studio will automatically connect it to the Conveyor level
(since it is the only public level available in the submodel). Links are drawn from the two variables
Time in Conveyor and Initial Amount in Conveyor and to the submodel. When the links are created, a
dialog box allows you to easily use them to define the public child variables Delay Time and Initial.
Finally, you can include the public child variable Output in the parent diagram, and connect the flow
that is automatically created to a any compatible level. The child relationship between the submodel
Conveyor and the public child variable Output is shown by a straight satellite line.
If you need to access the contents of the conveyor in your simulation, you can draw a link from the
submodel to the variable in question, and define it with a reference to Conveyor.Contents. Similarly, if
you need to create a parameter for it, you can create a parameter with Conveyor.Contents as the value
source.
Array Sort Module
The discussion about the VBFUNCTION in Powersim contains an algorithm for sorting an array,
processing it, and then sort it back to its original order. This model structure is very suitable for
submodel implementation. The model could look something like this:
- 277 -
The submodel used in a parent diagram. All the public auxiliaries are included in the diagram,
making it easy to see the variable connections between the main model and the submodel.
The Calculation submodel is another submodel that performs some actions on the sorted array from
the Array Sort submodel. In this diagram, the only variables belonging to the parent diagram are the
auxiliaries Array and Array 2, and the submodels Array Sort and Calculation. The other variables are
child variables that are included in the parent diagram.
An alternative diagram is shown below, where the child variables have been left out of the parent
diagram. In this diagram the variable to variable connections are missing, and the diagram only
indicates that information flows between the two submodels Calculation and Array Sort, and that the
Array variable provides input to the submodel, and that the Array 2 variable receives information
from Array Sort.
- 278 -
The submodel used in a parent diagram. None of the public auxiliaries are included in the diagram,
hiding the implementation of the submodels completely.
A Generic Account Submodel
Similar to the conveyor submodel above, we can easily create a submodel that represents an account.
By specifying the opening balance, interest rate, and the interest period, the submodel can be used as
an account level. The account will automatically calculate and add the interest to the account, and you
can add as many inflows and outflows that you wish to and from the submodel.
The submodel itself is shown below.
The Account submodel will calculate the running interest, and add the interest to the account at
regular intervals. The user can specify the Opening Balance, and the Period and Rate for interest
calculation.
The variable definitions are shown below.
const 'Opening Balance' = ...
// The opening balance of the account.
// Example: 1000<<USD>>
const 'Interest Rate' = ...
// The interest rate to be used.
// Example: 10<<%/yr>>
const 'Discount Period' = ...
// The period for when interest is added to
// the balance of the account.
level Balance = 'Opening Balance'
'Running Interest' = Balance*Rate
aux
level 'Accumulated Interest' = 0 * 'Opening Balance'
// This is defined as 0, but is multiplied with
// 'Opening Balance' to ensure that the correct
// currency is used for the variable.
'Due Interest' = IF( TIMECYCLE( STARTTIME, Period),
aux
'Accumulated Interest',
0 * 'Accumulated Interest')
- 279 -
//
//
//
//
When using the submodel in the parent diagram, you can connect any number of incoming flows to
the submodel, and they will all connect directly to Balance (provided their unit is compatible).
Likewise, any number of outgoing flows can be drawn from the submodel.
To define the three input parameters of the submodel, you can include them in the parent diagram, as
shown in the illustration below. By defining them by the appropriate values and units, the Account
submodel will be properly initialized.
Simply draw flows in and out of the submodel to connect the appropriate inputs and outputs to the
Account.
A Note on the Account Example
If you wish, you can define the three child variables Interest Rate, Discount Period, and Opening
Balance within the submodel directly, instead of including them in the parent diagram. You can also
create input variables on the parent's level, and then link these input variables directly to the
submodel, as shown in the conveyor example.
You may also enter the initial definition directly in the Balance level, if you define it internally in the
submodel. You can also create an input variable on the parent's level, and draw a link from this
variable and directly to the submodel, and define the initial value of the level that way. However, if
you include the Balance level in the parent diagram, the flows must flow to and from the included
level rather than to and from the submodel itself. This is illustrated below.
If a public level is included in the parent diagram, any flows that run to or from it must be connected
to the included child level rather than to the submodel itself.
- 280 -
Equations View
The
Equations View allows you to create your model without using any diagrams at all. You can
create, delete, and define variables.
The
Equations View always displays the entire structure of your model. It is unaffected by
operations in the diagrams that do not alter this structure, for instance excluding variables and creating
snapshots.
The columns of the
Equations View allows you to view and edit the most important properties of a
variable in a convenient way. If your model contains child variables, these can be shown below their
parents as a tree view in the Name column. You can also use the columns to group the variables to
make it easier to navigate in the list of variables. You can hide and display columns and sort them.
The
Equations View allows you to modify and/or view the following properties: Name,
Dimensions, Unit, Type, Definition, Value, Transfer Direction, Documentation, Note, Reservoir,
Modify Time, Create Time.
Tip! Working in the
- 281 -
The variable 'Interest' depends on two other variables: 'Balance' and 'Interest_Rate'.
The dependency of the variable 'Interest' on 'Balance' and 'Interest_Rate' in the illustration above
corresponds to information links going into 'Interest'.
Tip! If the variable name contains a space, such as Interest Rate, remember to enclose
the name in apostrophes ('), as in 'Interest Rate'.
Define a Variable
A variable that is undefined - either because it is newly created or for any other reason lacks a valid
definition - will be marked with a red circle in the Equations View.
1. Locate the variable in the list.
2. Select the Definition column.
3. If the field is not automatically opened for editing, hit F2. The field will be automatically opened
for editing if you select is using the mouse.
4. Enter the new variable definition, and hit Enter to save the changes.
Alternatively, you can click
dialog box.
Tip! You can include the unit of measurement in the definition if you wish to. You enter the unit
using the following syntax: value <<unit>>.
- 282 -
1.
2.
3.
4.
The variable is removed from the model itself, and will therefore disappear from all the diagrams it
previously was included in.
Note! If you delete a variable, you may render other variable's definitions invalid!
- 283 -
Note! If the variable you delete contains child variables, these child variables will also be
deleted.
- 284 -
Types of Ranges
There are three types of ranges in Studio: Enumerated ranges, and enumerated and numerical
subranges.
!
An enumerated range is a list of enumerations by which you refer to the various array elements.
An example is the named range 'Population Groups', defined as 'Born Females,
Young Females, Adult Females, Old Females, Born Males, Young
- 285 -
Males, Adult Males, Old Males'. When you use this range to define an array, you can
refer to the elements of the array using these enumerations rather than index numbers. This is a
highly useful way of making your model readable and easy to understand.
an enumerated subrange is a subset of an enumeration. When you define an enumerated
subrange, you must specify the lower and upper elements of an existing enumerated range. The
subrange will then contain the elements of the enumerated range between these borders. Given the
example above, we can create one subrange Females defined as 'Born Females'..'Old
Females', and one subrange Males defined as 'Born Males'..'Old Males'. The first
subrange will contain all elements containing females, while the other will contain all elements
containing males.
A numerical subrange is similar to an enumerated range, with the exception that the numerical
subrange is actually a subset of the range of all integers. To define it, you specify the lower and
upper integer to use as range elements. The numerical subrange defined as 1..5 will contain five
elements, indexed from 1 to 5.
Note! When renaming enumeration element names, be sure to use the Rename Elements
command available on the shortcut menu of the range. Changing the names of elements directly
in the Property Page or definition text will redefine rather than rename elements!
By another range;
As a numerical subrange;
As an enumerated subrange.
The index variable definition defines the range of the variable. The value of the index variable itself
will vary within the limits defined. If you use the FOR function, the value of the index variable will
step through the range from the lower to the upper limit automatically for each iteration.
Alternatively, you can use a Switch control to allow the user to select the value of the index variable
manually (see example below).
Since the value of the index variable can be either a numerical or an enumeration element, you must
use the NUMERICAL function when using the index variable within a definition (see example below)
The value of an index variable is independent of the simulation and of other simulations. This means
that even if you have two (or more) windows open of the same simulation, the value of the index
variable will be independent between the two windows. Say, if you have connected the index variable
to a switch control to select parameters to view in a time graph, for example, you can view different
parameters in different windows even if it is the same simulation.
- 286 -
Examples
The following examples uses the range Regions and the index variable Graph Selector, defined as
below. These are both defined in the Global Ranges view:
range Regions = North, East, South, West
index 'Graph Selector' = Regions
The top time graph displays the sales for all four regions simultaneously. The lower time graph shows
the sales for each region individually. The switch control allows you to switch between the various
regions easily. (Click the radio buttons to illustrate the functionality.)
Index variable used in FOR function
The index variable can also be utilized when the FOR function is used to define variables. In such a
case, the index variable is used in the same way as an internal index variable would normally be.
However, since a globally defined index variable can be either an enumerated or a numerical
subrange, you must use the NUMERICAL function if you want to use the value of the index variable in
the definition.
The simple example below shows how you can use a globally defined index variable within the FOR
function.
aux Auxiliary_1 = FOR('Graph Selector' | NUMERICAL('Graph Selector'))
= {1, 2, 3, 4}
- 287 -
- 288 -
integers. The ranges North, East, South, West and Infants, Young, Adults, Old
are examples of enumerated ranges.
The range elements are shown as nodes below the range they belong to in the Ranges View. This
makes it easy to edit their names, rearrange them, and add more range elements to the range.
To create an enumerated range:
1. Right-click inside the Ranges View, and select
Add Range on the shortcut menu. Enter a new
name for your new range.
2. Right-click the new range, and select Add Element on the shortcut menu. Enter a name for
your new element.
3. Repeat step 2 for all the elements you wish to add to the range.
You may also enter the range definition directly in the Definition Text box in the Properties dialog
box.
Deleting and sorting range elements
By right-clicking any range element in the list you can
!
!
Global Ranges or
1. Open the
Global Ranges (or
Local Ranges) view.
2. Locate the range containing the range elements you wish to rename, and expand it to display all
the range elements in the list.
3. Select the range element you wish to rename, and hit F2.
4. Enter the new name of the range element, and hit Enter.
Tip! If you wish to quickly rename several elements in one process, you can hit Arrow Down
rather than Enter when you have entered the first name. This will select the name of the next
range element ready for input.
- 289 -
- 290 -
Tip! After selecting the Dimensions box, the multi-functional list on the bottom of the property
page will show all the defined named ranges.
- 291 -
- 292 -
First: Record the variable's value at the start of the summary period.
Last: Record the variable's value at the end of the summary period.
Minimum: Record the variable's minimum value over the summary period.
Maximum: Record the variable's maximum value over the summary period.
Average: Record the variable's average value over the summary period.
Accumulated: Record the variable's accumulated value over the summary period. This is identical
to letting the variable control a flow into a level, and then report the level's value.
The figure below illustrates the difference between the various summary types when applied to a
variable showing a linear growth.
- 293 -
The graph shows a linear variable shown with various summary types and a summary period (major
interval) of one quarter.
Note! The First value of the next period equals the Last value of the current period. This can be
seen as the First value being the value at 4/1/2003 00:00, while the Last value is the value as
3/30/2003 24:00.
Note! When using the Accumulated summary type, the unit of the resulting parameter will not
be identical to the variable's unit (except if the integration order of the variable is Zero). It will
always be the variable's unit multiplied with time (if the variable's unit is ppl/da, the
accumulated parameter's unit will be ppl).
- 294 -
- 295 -
Case 1
Case 2
1/1/2003 $100
$300
2/1/2003 $100
$0
3/1/2003 $100
$0
Case 1
Case 2
1/1/2003 $100
$300
2/1/2003 $100
$0
3/1/2003 $100
$0
4/1/2003 $100
$300
- 296 -
- 297 -
The population example can easily be modeled using an array level rather than single levels. An
array will be represented by a double-framed variable symbol.
Dimensions and Ranges
An array's dimensions specifies the number of elements and the structure of these elements. An array
with the dimension 1..3 has three elements, structured as a vector. An array with the dimension
1..3;1..3 has two dimensions. Altogether, the array will have 9 elements. They are structured in a
3x3 matrix (table).
Global and Local Ranges offer the capability to predefine such array dimensions as named ranges.
When you later specify array variables, you can refer to the named ranges rather than the numerical
dimensions (actually numerical subranges) used above. You can define three types of ranges:
!
Enumeration Ranges: An enumeration range contains a set of (labeled) elements. Thus, we can
create the range Regions defined as North, East, South, West. And for the example
above, we could create the enumeration range 'Age Groups', defined as Young, Adult,
Old.
In the Population example, it would be a good idea to use the named range 'Age Groups' rather
than give the level the dimension 1..3. The reason for this is that you might later want to expand the
population model by new age groups. If you have entered numerical subranges directly into the
definitions, you will have to change these throughout the model. If you, on the other hand, used
named ranges, you could change the definition of the range itself, and the changes would be
immediately recognized throughout the model.
- 298 -
!
!
Maintainability: Changes to an array structure immediately takes effect for all elements of the
array.
Complexity: Models can sometimes become significantly smaller when using arrays.
Dimension changes: If you use ranges when creating your models, you can simply redefine the
range in one place, and the change is immediately reflected in all the array variables that uses the
same range.
- 299 -
The flow definition will automatically be inserted based on the dimension of the various variable and
dimension definitions.
The graph below shows the result of the model, when Input is defined as a sine wave.
Array Syntax
Creating Arrays
Arrays are created by listing the elements of the dimension inside '{'and '}' (braces). An array element
can be a literal, function expression, or an array itself. If an array element is an array, then all the
elements must have the same dimension. The syntax is
{Element1, Element2, ..., ElementN)
where <index-expression> identifies the elements in the array. The table below summarizes the legal
index expressions, and explains how they work. (A and B denote an integer.)
Index Description
A
An exact position within a dimension. You can include one integer per dimension.
Examples: Array[1], Array[1,1], Array[1,1,1], etc.).
- 300 -
A..B
Indexes a range in the array. The elements in the range (including A and B) are returned.
You can include one range per dimension. If the starting or ending point is replaced by
'?' (question mark), the range includes all elements from start or all elements to end,
respectively.
Examples: Array[1..2], Array[1..3,2..4], A[3..?], A[?..3],
etc.).
Indexes the entire dimension. All elements in the dimension are returned. You can include
one '*' per dimension. If the '*' is used at the end of the expression, you can omit it.
Examples: Array[1,*]=Array[1], Array[*,2..4], Array[*,*,2],
etc.).
Redimensioning Arrays
Arrays can be redimensioned to temporarily change the dimension. The index expression must be
constructed based on the new, temporary dimension. The syntax is
Array[<redimension-expression>:<index-expression>]
where <redimension-expression> identifies the new start end value for the dimension. <indexexpression> follows the syntax described above. The redimension expression can contain be both
numerical or enumeration subranges, as well as named ranges. The redimension expression can also
be open (ending or starting with '?' (question mark).
Examples:
A[1..4:2..?]
A[*,4..6:4]
A[*,?..6:2..4]
Create Arrays
There are two ways of turning a variable into an array. You can enter a variable definition and let
Studio automatically detect the dimension of the array, or you can explicitly set the dimension of the
array yourself. You should note, however, that if you explicitly set the dimension of the array, the
dimension must match the dimension of the variable definition.
Automatically Detect Dimensions
You can create arrays in several ways that will make Studio automatically detect the dimension of the
variable. The easiest way, which also illustrates how arrays are defined in the most basic way, is by
listing the array elements separated by list separators, and using '{' and '}' to enclose the dimension.
Thus, an array with one dimension containing four elements, can easily be defined using definition
below. Studio will automatically detect the dimension.
aux Variable = {1,2,3,4}
dim Variable = 1..4 // Automatically detected
Note! When a dimension is defined automatically, it will be defined with a starting point of 1. If
you define an array with the variable definition {26,6,99}, the dimension will be
- 301 -
The examples have shown how arrays can be built up using literals only. However, the same syntax
can very well be used even if the various elements are function expressions.
Assign Dimensions Explicitly
Sometimes the expression that defines each element is identical for all the elements in the array. In
this case you can enter a "scalar" definition, and specify the variable's dimension explicitly, as is
shown below. The dimension is entered in the Dimensions field for the variable.
aux Variable = 0
dim Variable = 1..2,1..2 // Manually defined
result Variable = {{0,0},{0,0}}
In some cases you might find that the automatically detected dimension is not correct for your use. If
you are performing operations related to other arrays with other dimensions, it can cause trouble. In
this case you can override the automatically detected dimension, as shown below. The example shows
how another variable can index the array we have created.
aux Variable_1 = {{7,10},{19,86}}
dim Variable_1 = 3..4,7..8
aux Variable_2 = FOR(i=3..4,j=7..8 | Variable_1[i,j]*2)
dim Variable_2 = 3..4,7..8
result Variable_2 = {{14,20},{38,172}}
Note! When you assign dimensions to an array, you must make sure that the dimensions match.
If the automatically detected dimension contains four elements, then the explicitly assigned
dimension must also contain four elements.
Regions
- 302 -
defined
as
All the dimensions in a dimension definition can be named ranges, as the following example suggests.
It uses the local range 'Age Groups' - defined as '.youth,.adult,.old' - in conjunction
with the Regions range above.
range Regions = north,south,east,west // Added to Global Ranges
// Added to Local Ranges
range 'Age Groups' = .youth,.adult,.old
aux Variable = 0
dim Variable = Regions, .'Age Groups' // Manually assigned
result Variable = {{0,0,0},{0,0,0},{0,0,0},{0,0,0}}
Note! When using names with spaces or other special characters, remember to enclose them in
apostrophes ('). Also, when referring to local ranges, remember the preceding '.' (punctuation
mark) for both range and range elements.
Given the definitions above, a change in the named ranges will automatically be recognized
throughout the model. The arrays will automatically be resized to the new dimensions.
where Element1, ..., are the various array elements. Each element may also be an array. It is
important that all the elements share the same dimensions.
Note! All elements listed within one set of braces must share the exact same dimensions. It is
not sufficient that they have the same number of elements in each dimension.
The definition
aux C = {A, B}
will produce an array with one more dimension than A and B have. A and B must also share the same
dimension. The table below shows a few examples for given A and B.
A
dim C
{3,2}
1..2
{3,2}
{6,10}
{{3,2},{6,10}}
1..2,1..2
{{1,2},
{3,4}}
{{5,6},
{7,8}}
{{{1,2},{3,4}},{{5,6},
{7,8}}}
1..2,1..2,1..2
- 303 -
the first part. Index variables can be used to compute values or to index other arrays. The second part
of the input parameters contains the element definitions. By using the IF function, you can specify
various definitions for various parts of your array.
Note! The resulting dimension for the variable is derived from the expression directly, and
inserted into the Dimension field of the property page. You cannot explicitly assign dimensions
to a variable defined by the FOR function.
The table shows a few examples on how the FOR function can be used to define arrays. In some of the
examples, the index variable i is used to define the array elements. It exists only internally in the FOR
function, and cannot be used outside the function (the expressions F(i=1..3 | 1)*i is not allowed). The
examples use the following range definitions that must be added to your simulation project to make
the examples work:
// Added to Global Ranges
range Regions = north,east,south,west
range 'Age Groups' = .infants, .youth, .adults, .old' // Added to Local Ranges
Note! When referring to local ranges or range elements, a '.' (punctuation mark) must be added
in front of the range or element name.
Expression
Result
Dimension
FOR(1..3 | 0)
{0,0,0}
1..3
FOR(i=4..8 | i)
{4,5,6,7,8}
4..8
FOR(i=Regions | i*2)
{2,4,6,8,10}
n..w
FOR(i=.'Age Groups' |
NUMERICAL(i)*100)
FOR(i=1..2,j=3..4 | i*j)
{{3,4},{6,8}
1..2,3..4
FOR(i=1..3,j=1..3 | IF
(i<=j,1,2))
{{1,1,1},{2,1,1},
{2,2,1}}
1..3,1..3
You can also use the index variable in the FOR function to index an array. The example below
illustrates how a combination of the FOR and IF functions is used to shift the elements of an array A,
defined as {1,2,3,4,5,6,7,8,9,10} (dimension automatically detected to '1..10').
The dimension of the index variable must match the dimension of the array it is used to index. If the
dimensions doesn't match, Studio will regard the variable expression as invalid. If you are sure that
your variable expression handles the index variable correctly, you can use the INDEX function to
index the variable. Thus, instead of using the expression A[i-1] (in which case the dimension of the
index variable will be '0..9', which is outside the dimension of A and therefore will cause an
invalid expression), you can use the expression A[INDEX(i-1)], as shown below.
aux A = {1,2,3,4,5,6,7,8,9,10}
dim A = 1..10
aux B = FOR(i=1..10 | IF(i>1, A[INDEX(i-1)], A[10]))
dim B = 1..10
result B = {10,1,2,3,4,5,6,7,8,9}
- 304 -
where Input1, Input2, must share all but one dimension. The last dimension must be either
open or sequential. The last dimension can, as an example, be '1..1' for Input1, '2..8' for
Input2, '9..11' for Input3, and so on.
Note! A dimension is open only when the array is created immediately, as in the expression
{1,2,3}.
The CONCAT function can be used in conjunction with both the FOR and IF functions, and is thereby
capable of creating the most advanced array expressions.
The example below shows how the CONCAT function is used to concatenate various array
expressions.
aux Variable_1 = CONCAT({1,2},{3,4,5,6},{7,8,9})
dim Variable_1 = 1..9 // Automatically detected
result Varilable_1 = {1,2,3,4,5,6,7,8,9}
aux Variable_2 = CONCAT(FOR(i=1..3, j=1..2 | i-j),
FOR(i=1..3, j=3..4 | i+j))
dim Variable_2 = 1..3,1..4
result Variable_2 = {{0,-1,4,5},{1,0,5,6},{2,1,6,7}}
Index Arrays
The elements of an array can be accessed by its index value. The index of an array element is relative
to the dimension definition and to the position of the element inside the array. This is illustrated in the
figure below.
The figure illustrates the relationship between the dimensions of an array and the index values of the
array elements.
The array can be indexed by the following syntax:
Array[<index-expression>]
where <index-expression> is the index dimension for the element(s) you wish to index. The
index expression can be an integer (to uniquely identify one array element), a numerical subrange (to
identify two or more array elements), or an '*' (asterisk) (to identify all elements in a dimension). The
dimension of an array that is indexed is reduced by the number of indices that is used.
- 305 -
When indexing arrays, the index expressions refers to the dimensions as they are defined for the
variable. The first index refers to the first dimension, the second to the second dimension, etc. Trailing
'*'s can be omitted, making the expressions A[1,*] and A[1] identical.
Examples
The illustration below demonstrates how a two-dimensional array can be indexed in various ways.
The array, for convenience named Array, is defined as:
aux Array = {{48,39,0,42,94},
{69,57,19,51,18},
{8,15,35,63,68},
{97,1,67,45,11}}
dim Array = 1..4,1..5 // Automatically detected
Array can be compared to a table, and is presented as such below. The index of the first dimension
is presented in the first column, while the index of the second dimension ('1..5') is presented in
the first row.
1
1 48 39
0 42 94
2 69 57 19 51 18
3
8 15 35 63 68
4 97
1 67 45 11
Definition:
Select an expression...
Result:
<--Result-->
Dimension:
<--Dimensions-->
Note! The two last examples shows how an array can be redimensioned in Studio.
Redimensioning affects the dimensions of the resulting array.
- 306 -
Note! The variable used as an index variable must be defined with INTEGER as its datatype.
Examples
The table shows a few examples on how to use the LOOKUP function. The dimensions are
automatically found by Studio when you click Apply. The expressions are based on the following
array:
aux A = {{4,1,5},{9,3,8},{2,6,7}}
The integers used as indices in the examples below can be replaced by integer variables.
aux
dim
aux
dim
aux
aux
B
B
C
C
D
E
=
=
=
=
=
=
LOOKUP(A,1) =
1..3
LOOKUP(A,3) =
1..3
LOOKUP(A,1,3)
LOOKUP(A,3,2)
{4,1,5}
{2,6,7}
= 5
= 6
- 307 -
range, and the change will propagate throughout your model. You only have to revisit the boundary
models that contain initialization values for the various elements.
The following examples illustrate how to use named ranges. The example requires the global range
Regions to be defined as north,east,south,west.
range Regions = north,east,south,west // Added to Global Ranges
aux Array = {4,1,2,9}
dim Array = Regions
aux 'Result 1' = Array[north] = 4
aux 'Result 2' = Array[east..south] = {1,2}
aux 'Result 3' = Array[south..?] = {2,9}
aux 'Result 4' = Array[Regions] = {4,1,2,9}
Redimension Arrays
Sometimes you might need to give an array new dimensions temporarily. In this case, you can use the
powerful redimensioning syntax in Studio. By adding the new dimension of the array before the index
expression, you can give the array new dimensions that will only be used within the current function
expression. The syntax is shown below.
Array[<redimension-expression>:<index-expression>]
where <redimension-expression> is the new dimension of the array. Be aware that the index
expression must be entered relative to the new dimension of the array. Needless to say, the
redimension expression must have the same number of elements as the dimension of the array you are
indexing. The redimension expression can be open in either end.
Tip! You can also redimension an array using the REDIM function, with the syntax REDIM
(<redim_expression> | Array).
The redimension feature is especially useful when used in conjunction with the CONCAT function.
Since you cannot concatenate arrays that have the same dimensions, you can redimension the arrays
to make it possible to concatenate them.
range Regions = north,east,south,west // Added to Global Ranges
aux 'Array A' = {34,18,62,40}
dim 'Array A' = Regions
aux 'Array B' = {42,13,67,20}
dim 'Array B' = 1..4
aux 'Result 1' = 'Array A'[1..?:2] = 18
aux 'Result 2' = 'Array A'[?..4:?..4] = {34,18,62,40}
aux 'Result 2b' = REDIM(1..4 | 'Array A') = {34,18,62,40}
aux 'Result 3' = CONCAT('Array A'[1..?:1..?],'Array B'[5..?:5..?]
= {34,18,62,40,42,13,67,20}
dim 'Result 3' = 1..8
The example below shows how to redimension and concatenate two arrays with two dimensions each.
In this case you must observe that only one of the dimensions differ from each other.
aux
dim
aux
dim
aux
A = {{1,2},{3,4}}
A = 1..2,1..2
B = {{5,6},{7,8}}
B = 1..2,1..2
'Result 1' = CONCAT(A,B[*,3..4:3..4])
= {{1,2,5,6},{3,4,7,8}}
- 308 -
- 309 -
The time series control used to display a time graph of inventory fluctuations over time in two
different inventories.
Using Summary Types in Controls
Summary types are available in the
Time Graph and
Time Table controls. The summary period
for each of these will default to the Major Interval specified under Simulation Settings. You can
change the summary period for each control individually later.
Using Field Codes in Controls
You can use field codes to automate the layout of controls. There are several field codes available,
including variable names and units, range names, and time labels. The field codes can be used to
insert text into control titles, axis titles, graph names, etc. When you are using field codes, the names
presented in controls will change if you change the name of the corresponding variable, saving you a
great deal of time when creating simulation presentations.
- 310 -
Move a Control
A control can be moved in two ways.
1. Select the control and drag it to its new position while holding down the mouse button.
Or
1. Double-click the control, or right-click it and select
Properties on the shortcut menu.
2. Select the Symbol tab in the property dialog box.
3. Change the values of the Horizontal and Vertical fields to the new position coordinates.
- 311 -
or Local Ranges.
You can index arrays using index variables in all controls. This allows you to control which
dimensions of the control's parameter is displayed by altering the value of the index variable in an
input control. The various combinations of indices and relevant index variables will show up in the
Parameter list box on the Parameter property page.
Example
Let's consider an example and see how the Powersim controls can be used to present the various
elements of an array in a time graph by using index variables.
Let's assume that you wish to present the sales of a factory. There are three different products, and
there are four different geographical areas. The sales figures are kept in an array, defined by the
global ranges Regions and Products.
Range Region = North, East, South, West // Defined in Global Ranges
// Defined in Global Ranges
Range Products = Bolts, Washers, Nuts
The variable Sales has the dimensions Region, Products, and we wish to display the results for each
geographical region separately. To achieve this, we create an index variable IV_Region, like this:
Index Variable IV_Region = Region // Defined in Global Ranges
You should insert a switch control and a time graph control in the diagram. Select IV_Region as the
parameter for the switch control. For the time graph, select the parameters Sales[IV_Region, Bolts],
Sales[IV_Region, Washers], and Sales[IV_Region, Nuts]. The controls will now look something like
this:
The switch control allows you to select which graphs to display in the time graph, by setting the value
of the index variable IV_Regions. (Click the radio buttons to see effects.)
Alternatively, you can display the time graphs as region per product group. To achieve this, create a
new index variable, like this:
Index Variable IV_Product = Products
By selecting IV_Products as the parameter for the switch control, and Sales[North, IV_Product],
Sales[East, IV_Product], Sales[South, IV_Product], and Sales[West, IV_Product] as the parameters
for the time graph, you can achieve this effect. This is shown below.
- 312 -
The switch control allows you to select which graphs to display in the time graph, by setting the value
of the index variable IV_Product. (Click the radio buttons to see effects.)
Finally, you can have one switch control setting the value for each of the index variables, and thereby
creating a time graph where you can view any combination of the two. To achieve this, you need to
select IV_Region as the parameter for one of the switch controls, IV_Product for the other, and finally
Sales[IV_Region, IV_Product] as the parameter for the time graph. The resulting control complex is
shown below.
The switch control allows you to select which graphs to display in the time graph, by setting the value
of the index variable IV_Product. (Click the radio buttons to see effects.)
Delete a Control
To delete a control:
1. Select the control you wish to delete.
2. Hit Del on the keyboard, or select Delete on the Edit menu.
- 313 -
: When the button is depressed, Studio is in Design mode, and you can edit the diagram freely.
When the button is not depressed, Studio is in User mode, and you can only interact with the
simulation.
Tip! When the simulation is in User mode, you can right-click a control to show or hide the
parameters. You can also hide graphs in the time graph or chart controls by right-clicking them
and select Hide on the shortcut menu.
- 314 -
- 315 -
Add Parameter to
add them to the parameter list on the right as active run parameters.
5. Click OK to save the changes, or Apply to save the changes without closing the dialog box.
Some variables have several dimensions. For these variables, all the possible parameters for a control
will be listed in a treeview in the Parameter property page. You can browse through this treeview to
find the parameters you want to add. Some controls accept only scalar parameters, while others accept
both scalars and vectors. The parameters that cannot be selected will be marked with a small red sign.
Note! For some controls - such as the table control - you might have to perform additional
formatting before the parameters are actually shown in the control.
A reference data parameter has a preceding '*' (asterisk) to distinguish it from active run parameters.
Reference data parameters enables you to compare results from various simulation runs in an
intuitive and simple way.
- 316 -
Simulation Control Parameters can be used to access the run count and time information of the current
simulation. The available control parameters are:
!
!
!
!
!
!
The two parameters Time and RunIndex are read-only, while you can use the other parameters to view
and change the simulation settings using controls.
To add a simulation control parameter to a control
1.
2.
3.
4.
5.
- 317 -
summary types available: First, Last, Maximum, Minimum, Average, and Accumulated.
To add a parameter with a summary type to the control:
1.
2.
3.
4.
5.
6.
7.
8.
When calculating the value of the parameter, a summary period will be used. By default, this
summary period equals the Major Interval defined in the Simulation Settings dialog box. However,
you can also control the summary period for each control individually by changing the Major Interval
of the time axis ( Time Graph) or the Report Interval ( Time Table).
- 318 -
If the parameter selected is an auxiliary, the control will always be read only, and the settings of the
options above will have no effect.
- 319 -
A slider bar used in read only mode to indicate the amount accumulated over time in a level.
Tip! By enabling the Permanent option for constants and levels used as input parameters in
controls, you can make Studio remember the value entered by the user even when the
simulation is reset.
- 320 -
Format Controls
The various controls available inside Powersim Studio are very different, but much of the formatting
capabilities are the same between them. Below is a list of topics that explain procedures that are
common to all Powersim controls. For more specialized information on how to use a specific control,
please refer to each individual control.
You can format individual objects within the control - such as time and value axis - by selecting them
and using toolbar buttons, or by right-clicking them and use the shortcut menus. You can also format
them in the Properties dialog box. This is available by clicking
Properties on the shortcut menu or
on the toolbar.
If you double-click the control, or select it and then click
Properties on the toolbar (or shortcut
menu), you can access all the properties of the control at once.
Axis Formatting
The table below explains the various options when formatting axis.
Major Tick Style
Cross
Outside
Displays the major ticks on the outside (away from the center of the control)
of the axis:
Inside
Displays the major ticks on the inside (toward the center of the control) of the
axis:
None
Outside
Displays the minor ticks on the outside (away from the center of the control)
of the axis:
Inside
Displays the minor ticks on the inside (toward the center of the control) of the
axis:
None
Axis Position
- 321 -
Auto
The axis cross as close as possible to the origin of the coordinate system.
Low
High
High
Low
With Axis
Auto
Automatically places the unit label based on the orientation and type of value
axis.
At Minimum
Displays the unit label at the minimum point of the value axis.
At Maximum
Displays the unit label at the maximum point of the value axis.
Along Axis
Displays the unit label along the value axis, at the middle of the axis.
With Tick
Labels
Displays the unit with the tick labels of the value axis.
When the parameters shown in the control have equal or compatible units, the unit of the topmost
- 322 -
parameter is chosen for the value axis. The unit name of the value axis is displayed above the value
axis.
Parameters with incompatible units
When the control contains several parameters with incompatible units, the unit of each parameter is
shown in the legend. The numerical values are plotted against the value axis.
When the parameters shown in the control have incompatible units, the parameters' units are
displayed in the control's legend.
Resize a Control
A control can be resized in different ways.
1. Select the control, and use the resize handles that appear on the outline of the control.
Or
1.
2.
3.
4.
Format an Axis
There are various axis types available in Studio: Value Axis, Element Axis, and Time Axis. While the
options discussed below are available for all of these axis types, each may have individual options not
discussed below. These will be discussed for each axis type individually.
To change major and minor tick styles:
1. Right-click the axis, and select Major Tick Marks (or Minor Tick Marks) on the shortcut
menu.
2. On the shortcut menu that appears, select the tick style.
To change the axis position:
1. Right-click the time axis, and select Axis Position on the shortcut menu.
2. On the shortcut menu that appears, select the axis position.
To change the tick label position:
1. Double-click the axis, and select the Time Axis tab (alternatively Value Axis or Element Axis).
- 323 -
Time graph control using a time axis with tick labels rotated to -45.
- 324 -
Toolbar buttons: Use the toolbar buttons on the Format toolbar to format the selected control or
object within the control.
Shortcut menu: Right-click the control or object within the control to access the shortcut menu.
Many formatting options are present on the menu.
Properties dialog box: Double-click the control or object within the control to access the
Properties dialog box of the control or object (alternatively, click
Properties). All the
properties of the object is available here. The Properties dialog box for the control contains all the
properties for all the objects within the control, as well as for the control itself.
You can also change the visibility of items. You can hide or show axis labels, title, legend, and so on.
Simply right-click the object it belongs to - such as the time axis - and select the object to show. To
alter the text, simply select the text and replace it with a text of your choice. You are of course free to
format the text using any font, font size, or font variation you wish.
- 325 -
Tip! When selecting a property from the list, hold down the SHIFT key down while selecting
another property from the list and all properties between the two selected will also be selected.
Use the CTRL key to add or remove a single property to or from the selection.
- 326 -
The core of the field code consists of an object and the property you wish to display. In addition, you
can use switches to control the appearance of the text. You can also add optional texts before the and
after the field code. If the field code itself is empty, these strings will not be displayed, either. The
available objects, properties and switches are shown in the table below.
Tip! You are allowed to use the short form Par instead of typing the complete word Parameter.
Studio will translate Par into Parameter on the fly.
Object
Parameter Name
Unit
Display only the part of the parameter's name that are different
from the other displayed parameter names. This switch is only
available in Legends and Parameter Titles.
Displays the part of the unit of the parameter that are different
from the other displayed parameters. This switch is only available
in Legends and Parameter Titles.
Range
Name
Time
Label
- 327 -
Available
Parameter.Name
Parameter.Unit
Time.Label
Title
Element
Axis.Label
Empty
Description
The title can be set up to
display the time label, or the
name or unit of the parameter
(s) shown in the control. In the
Chart control, it can also
display the name of the
parameters' range.
Parameter.Name
Parameter.Unit
Range.Name
Time.Label
Parameter.Name
Parameter.Unit
Parameter.Name
Parameter.Unit
Time.Label
{Time.Label}
Parameter.Name
Parameter.Unit
Time.Label
Range.Name
{Range.Name}
Parameter.Name
Parameter.Unit
Time.Label
{Parameter.Name}
Legend
Time
Axis.Label
Used
Default
in
- 328 -
Value
Axis.Label
Time.Title
Parameter.Name
Parameter.Unit
Time.Label
{Time.Label}
Parameter.Name
Parameters
Parameter.Unit
[<name>].Title
Parameter.Name
Parameter.Unit
Parameter.Name
Parameter.Unit
Time.Label
{Parameter.Name}
Gauge
Dial.Value
Axis.Label
Label
If the text contains only field codes, the For all languages option is not available, but is always
selected. The same string will always be used for all languages.
If the text contains only normal text and no field codes, the For all languages option is not
available, but is always deselected. The text will only exist in the selected language.
If the text contains a mixture of normal text and field codes, the For all languages option is
available. You can specify yourself whether the text should be used for all languages or only for
the selected language.
Note! If you are creating a language specific text, make sure you create texts for all the
languages that the model will be displayed in!
- 329 -
If you display an array in a time graph when using this field code, the resulting legend will display the
parts of the parameter names that are not equal, and it will not show the unit. An example is shown
below, for the array Sales. The dimension of the variable is Region = North, East, South, and West.
The default formatting of a time graph legend when displaying an array with four elements.
Tip! You are allowed to type only Par (the field code is not case-sensitive) for simplicity. Studio
will automatically convert this into Parameter for you.
If you are displaying parameters with the same unit, the unit itself is not included in the legend.
However, if the parameters have different units, the part containing the unit in the field code will be
visible. As you can see from the field code, it adds a space between the parameter name and the unit,
and encloses the unit in parenthesis. The control below displays two scalar variables Shipment and
Weight, where the two have different units.
When two parameters have different units and different names, all the information is shown in the
legend.
The default field codes for the parameter titles in the Time Table are equal to the default field code for
legends. To allow the title to automatically display the parameter name and unit (if the parameter
name and unit are unique), the following field code is used by default:
- 330 -
{Parameter.Name}{" ("!Parameter.Unit!")"}
The first example above, with the array Sales show in the Time Table, is shown below. (The display
itself is formatted, but the control uses the default field codes.)
When an array is displayed in a Time Table, the variable name and unit is displayed in the title of the
control, while the array element names are shown in the parameter titles.
The second example above, with two different parameters with separate units, are shown below. In
this case, since there are more than one parameter and unit name, they are shown in the columns
rather than in the title.
When two parameters have different units and names, the information is shown in the column
headers.
- 331 -
1.
2.
3.
4.
5.
Right-click the control (or the item containing the text) that you wish to change.
Click the Text tab.
Select the text you wish to alter under Properties.
Enter the new text under Text.
If the text contains a mixture of normal text and field codes, you can select to use the same text
for all languages by selecting the For all languages option.
6. Click Apply to save the changes, or OK to save the changes and close the dialog box.
- 332 -
!
!
The chart graph showing a bar graph that represents the market share, share of income and
development expenses for four different products.
Note! All the parameters of a chart control must be vectors (arrays with only one dimension).
The elements are drawn from left to right (the first element in position 1, the second element in
- 333 -
The four available chart types: Line (top left), Smooth Line (top right), Step (bottom left), and Bar
(bottom right).
The options are also available on the Chart Graph property page for each selected parameter. The
property page can be accessed by right-clicking the graph or the entire control, and selecting
Properties on the shortcut menu.
- 334 -
Double-click the control that you wish to change, or select it and click
Properties.
Select the Parameters tab in the Properties dialog box.
Select the parameter to hide in the list, and select the Visible option.
Click OK to save the changes, or Apply to save the changes without closing the dialog box.
Double-click the control that you wish to change, or select it and click
Properties.
Select the Parameters tab in the Properties dialog box.
Select the parameter to show in the list, and select the Visible option.
Click OK to save the changes, or Apply to save the changes without closing the dialog box.
If you switch to User Mode, you can also toggle parameters on and off by right-clicking inside the
control, and selecting (or deselecting) the parameter name.
- 335 -
Show Gridlines
1.
2.
3.
4.
Double-click the control that you wish to change, or select it and click
Properties.
Select the General tab in the Properties dialog box.
Under Gridlines, select the gridlines to display.
Click OK to save the changes, or Apply to save the changes without closing the dialog box.
Note! The intervals used for the value axis gridlines are specified on the Value Axis tab in the
Properties dialog box for the control. Vertically, the chart control will draw one gridline per
element.
You can also access the properties of the legend on the General tab when clicking
- 336 -
Properties.
Example
The model below shows the market share of four companies, where each variable is a scalar auxiliary.
To display the value of these four variables, we add an extra auxiliary - Market Share - and use the
four scalars as elements. The definitions are shown below. The only requirement is that the units of
the scalar variables are compatible.
aux
aux
aux
aux
aux
'Company A'
'Company B'
'Company C'
'Company D'
'Market Share'
=
=
=
=
=
<any definition>
<any definition>
<any definition>
<any definition>
{'Company A', 'Company B',
'Company C', 'Company D'}
- 337 -
simulation.
To prepare to use the chart control as an input object:
1. Insert a chart control in your diagram.
2. Drop the variable(s) on the control.
When you want to change the value of the parameter:
1. Point to the curve that you wish to change in the graph using the mouse pointer. The mouse
pointer changes to a small square with arrows in all directions to indicate that the graph accepts
user input. By sweeping along the element axis, you can provide new values for all the elements in
the array.
2. Drag the graph to its new shape, thereby providing input for all the elements in the array.
Tip! If you hold down Alt while you drag, you can lock the mouse pointer to the current data
point only, so that you
Tip! When the graph is used for input, it is useful to format it as either a step or bar graph,
since these graphs allow a wider input area.
- 338 -
A gauge shows the current value of a parameter. You can create sectors in the gauge dial by using
customized picture fills.
The various components of the gauge control can be customized allowing you to create a gauge that
fully satisfies your requirements. You control the size, shape, and color of the gauge disc; the margins
of the dial (the area between the boundary of the dial and the span of the value axis); the size, shape,
color, and position of the gauge needle; if the gauge hub should be visible; the color and fonts used by
the value axis; as well as the rotation of the gauge itself. If you need to create sectors in the gauge
dial, you can create your own picture fills that you can use for the gauge dial.
The control may also be used for data input. Simply drag the gauge needle to change the value of the
control's parameter.
The Gauge Control accepts index variables as parameters. The index variable can be used to control
which element of a parameter is displayed in, say, a time graph.
Notes
Dial style: Auto (or Pie Based)
Direction: 90
Dial span: 100
Display span: 90
Dial inner radius: 40%
- 339 -
- 340 -
- 341 -
The illustration shows the gauge dial when rotated to various angles (0, 90, 180, and 270).
Dial and Display span
The Dial span property allows you to specify the curvature of the gauge dial. Possible values are 1 to
360.
The Display span property allows you to specify the portion of the dial that will be used to display the
value of the parameter. Possible values are 1 to 360, although it cannot exceed the value of Dial span.
Tip! If the value for Display span is higher than the value for Dial span, Studio will
automatically make them equal.
The Dial span and Display span are shown on the illustration below.
Outer and Inner radius
The Outer and Inner radius are shown in the illustration below. The two properties allow you to
control the shape and appearance of the gauge dial. Possible values are 0% to 100%.
- 342 -
The gauge needle can have several shapes: a) arrowhead, b) diamond, c) line, d) spear, and
e) triangle.
Position
The Head property allows you to control the position of the head of the gauge needle. You can choose
between several predefined positions, or you can enter a custom value. The custom value is given as a
percentage of the entire gauge dial. The various options are the same as for the Tail property below,
and are listed in the table below.
The Tail property allows you to control the position of the tail of the gauge needle. You can choose
between several predefined positions, or you can enter a custom value. The custom value is given as a
percentage of the entire gauge dial. The various options are the same as for the Head property above,
and are listed in the table below.
Option
Description
Outside The end of the needle touches the outer limit of the value axis.
Axis
At Axis
The end of the needle touches the line of the value axis.
Inside
Axis
The end of the needle touches the inner limit of the value axis.
Outside The end of the needle touches the outer line of the gauge dial.
Dial
Inside
Dial
The end of the needle touches the inner line of the gauge dial.
At Dial
Center
The end of the needle is placed exactly at the center of the gauge dial (at the center of
the gauge hub, if it is visible).
The end of the needle is placed at a position corresponding to the percentage entered
in the Custom box. The number represents a percentage of the outer radius of the
- 343 -
gauge dial, 100% being equal to the option Outside Dial, and 0% equal to the option
At Dial Center above. You can enter any value, even negative numbers. A value
Custom
larger than 100% will cause the end of the needle to be placed outside the gauge dial,
while a negative value will place the end of the needle beyond the dial center.
Hide on the
- 344 -
Line Color, and select a color from the dropdown for the dial
Line Style, and select a color from the dropdown for the dial
Dash Style, and select a style from the dropdown for the dial
Tip! You may of course format the fill and line on the corresponding property pages also, by
right-clicking the gauge dial itself and selecting
Properties on the shortcut menu.
You can freely format the gauge dial as you wish to. Gauge dials can be a) pie shaped or b) chord
shaped.
- 345 -
Line Style, and select a color from the dropdown for the needle
Dash Style, and select a style from the dropdown for the needle
Tip! You may of course format the fill and line on the corresponding property pages also, by
right-clicking the gauge dial itself and selecting
Properties on the shortcut menu.
The gauge hub can be formatted independently of the gauge needle, and can be visible or hidden.
To format the size of the gauge hub:
1. Right-click the gauge, and select
Properties on the shortcut menu.
2. On the General property page, enter a new percentage size in the Size box under Hub. Note that
the percentage refers to the total size of the gauge control. Entering a value of 99% will make the
hub cover the entire gauge dial.
3. Click OK to save the changes, or Apply to save the changes without exiting the dialog box.
You can format the fill and line of the gauge hub using the toolbar:
1. Select the hub of the gauge that you wish to format.
2. Click the small arrow next to
Fill Color, and select a color for the hub fill.
3. Click the small arrow next to
Line Color, and select a color from the dropdown for the hub
line.
4. Click the small arrow next to Line Style, and select a color from the dropdown for the hub
line.
5. Click the small arrow next to Dash Style, and select a style from the dropdown for the hub
line.
Tip! You may of course format the fill and line on the corresponding property pages also, by
right-clicking the gauge hub itself and selecting
Properties on the shortcut menu.
or
1. Right-click the gauge control, and select
2. Select the General tab.
- 346 -
The illustration shows the gauge dial when rotated to various angles (0, 90, 180, and 270).
- 347 -
The shape of the bitmap must match the shape (not necessarily the size) of the gauge dial (inner
radius and dial span).
The sectors are (obviously) static on the bitmap, and are not influenced by changes in scaling of
the value axis (and/or parameter).
Colors used in bitmaps might be displayed differently on other people's computers (if the end user
has fewer colors than you have yourself).
2. Make sure that the value axis and scaling of the parameter are correct before continuing.
3. Make a screen shot of the gauge (by hitting Alt+Enter), and paste the screen shot into your
favorite image processor.
4. In the image processor, crop the screen shot until only the gauge dial is visible, and clean up the
image until you have only the gauge dial left in the image. To make it easier to create the sectors,
it is useful to leave the tick marks of the value axis.
5. In the image processor, create the desired colored sectors. Use the tick marks to ensure that the
sectors have the correct size and shape.
6. In the image processor, select the bitmap and copy it to the Windows clipboard.
7. Switch back to Powersim Studio, and double-click the dial to open the Property Pages. Select the
Fill property page, and select Picture under Type. Then click Select Picture to open the Select
Resource dialog box.
8. Click Paste, select Bitmap in the Paste As dialog box, and click OK. Enter a suitable name for the
bitmap in the Select Resource dialog box. Click OK to select the picture.
9. Click Apply to view the changes. The gauge should now look something like this:
- 348 -
The slider bar used to provide input to a constant auxiliary (left) and as a tool to measure the value of
an auxiliary (right).
As for the other controls, you are allowed to alter the appearance of the Slider control to a wider
extent.
The Slider Control accepts index variables as parameters. The index variable can be used to control
which element of a parameter is displayed in, say, a time graph.
Tip! If you define the parameter's corresponding variable as Permanent, the value(s) you have
entered for the variable during the simulation run will not be reset when you reset the
simulation.
- 349 -
The Switch Control makes it possible to create control panels for controlling input to your simulation.
Each control will set the value of a constant auxiliary based on the selection in the control. In this
figure, four Switch Controls are used, with a frame object providing the outer frame and the title of
the panel.
The Switch Control accepts index variables as parameters. The index variable can be used to control
which element of a parameter is displayed in, say, a time graph.
Tip! If you define the parameter's corresponding variable as Permanent, the value(s) you have
entered for the variable during the simulation run will not be reset when you reset the
simulation.
- 350 -
Create a Button
To create a button in a Constructor diagram:
1. Insert a Switch Control.
2. Add the parameter you wish to the control by drag-and-drop (or on the Parameters property
page).
3. Double-click the control, or select it and click
Properties.
4. Select the General tab in the Properties dialog box.
5. Select Push Button under Type to create a push button.
6. Under States, you can control the values that will be set by the button. If you select the Automatic
option, the control will find settings based on the type and value of the selected parameter. To
specify the values manually, you must deselect the Automatic option.
The value under Clear is the value when the button is not clicked.
The value under Set is the value when the button is clicked.
7. To enter a different label for the button, click the Text tab, and select Label under Properties.
8. Enter the new text or field code for the label under Text. The default field code will display the
parameter's name on the face of the button.
9. Click OK to save the changes, or Apply to save the changes without closing the dialog box.
Tip! To create a "sticky" button, select Check Button under Type, and then select the Push-like
option. The appearance of the buttons are identical, but you must click once to depress the
button, and once again to revert it.
Value: Clear
A push button changes the value of the parameter only when it is depressed.
(Click the image to demonstrate.)
Note! The push button will not use the texts entered for the Text property available under
States.
- 351 -
option, the control will find settings based on the type and value of the selected parameter. To
specify the values manually, you must deselect the Automatic option.
The value under Clear is the value when the button is not selected.
The value under Set is the value when the button is selected.
7. To enter a different label for the button, click the Text tab, and select Label under Properties.
8. Enter the new text or field code for the label under Text. The default field code will display the
parameter's name on the face of the button.
9. Click OK to save the changes, or Apply to save the changes without closing the dialog box.
You can create a "sticky" button by selecting the Push-like option. The difference between a check
button and a push-like check button is illustrated below.
- 352 -
Value: Val 1
A switch control will have as many radio buttons as the selected number of states. The value selected
corresponds to the selected radio button.
(Click the image to demonstrate.)
Value: Val 1
A switch control will have as many entries in the list as the selected number of states. The value
selected corresponds to the selected list entry.
(Click the image to demonstrate.)
- 353 -
Value: Val 1
A switch control will have as many entries in the list as the selected number of states. The value
selected corresponds to the selected list entry.
(Click the image to demonstrate.)
- 354 -
Specify the text for the entry under Text. If Auto is selected, the text will equal the value.
8. Click OK to save the changes, or Apply to save the changes without closing the dialog box.
The text that is displayed in the control will depend on the value of the connected parameter. This
allows you to control a text string that appears in the diagram by controlling the value of a variable.
- 355 -
As can be seen from the definition, the three input alternatives are concatenated into an array in the
variable Strategy. The array is indexed by the value of Switch.
Note! Switch must be defined as an INTEGER for the INDEX function to work.
A switch control is added to the diagram to control the value of Switch. The switch control is a threestate radio button, and the values are selected accordingly to the index value of the corresponding
input variable. Under Values you should therefore enter the contents of Table 1.
Value Text
Val 1
1 Wave
Val 2
2 Step
Val 3
3 Random
The animation shows one possible simulation run of the example described above.
Tip! The same techniques can be used for switches formatted as list or combo boxes.
- 356 -
A table control used to supervise a company's stock. The table displays the current simulation time,
along with the quantity in stock at this time.
Tip! To display the entire time series of the variable, you should use the
Control rather than the Table Control.
Time Table
- 357 -
To insert a column to the right of the selected cell in the table control:
1. Right-click anywhere inside the tabular area of the control, and select
shortcut menu.
- 358 -
Right-click the cell, and select Assign Parameter on the shortcut menu.
Select the variable whose name you wish to display in the dialog box.
Select the Name option under Type.
Click OK to display the variable name in the cell.
Tip! To show an empty cell, select Remove Assigned Parameter on the shortcut menu.
- 359 -
variable in a cell:
1.
2.
3.
4.
Right-click the cell, and select Assign Parameter on the shortcut menu.
Select the variable whose name you wish to display in the dialog box.
Select the Value option under Type.
Click OK to display the variable name in the cell.
Tip! To show an empty cell, select Remove Assigned Parameter on the shortcut menu.
Note! Deleting a column does not remove parameters from the control.
Note! Deleting a row does not remove the parameters displayed in it from the control.
- 360 -
can only input values to constant auxiliaries or to levels. If you change a level, the change will only
affect its initial value.
Tip! If you define the parameter's corresponding variable as Permanent, the value(s) you have
entered for the variable during the simulation run will not be reset when you reset the
simulation.
To prepare to use the table control as an input object:
1. Insert a table control in your diagram.
2. Drop the variable(s) on the cell(s) where you want to display its value.
When you want to change the value of the parameter:
1. Select the cell.
2. Type the new value, or hit F2 to enter the existing value.
3. Hit Enter to send the value to the target variable.
When typing input values, you can type the unit of the variable directly as text (or omit it, if you like).
For example, if you wish to enter 20 m/s as the new value, simply type '20 m/s' or '20' (without
quotation marks).
Tip! You can enter new values using any compatible unit of the target variable's unit. Using the
example above, you could very well enter '3600 m/hr', which would immediately be converted
to 1 m/s in the target variable.
- 361 -
The time graph control shows the time series for wind variations at two different locations.
The time graph uses the report window of the simulation when it displays data. Thus, if the report
window is shorter than the total simulation length, the time graph will scroll as the simulation
advances. The scroll interval is determined by the report window's slide value.
The time graph control supports parameters using index variables to index its dimensions, allowing
you to create user interfaces where you can select different parameter elements for display.
Tip! To show the behavior of a variable over time in a table, use the time table control.
- 362 -
Properties Explained
The default settings for major and minor intervals will follow the selections done in the Simulation
Settings for the simulation. You can override these for each Time Graph control individually, if you
want to. The major interval of the time axis will be used as the summary period for the summary
parameters selected for your control.
The time axis offers extensive control of the tick labels. You can specify short or long time formats,
whether to show static information, and more.
Tick Label Options
Property
Available
options
Automatic
In intervals
Between
intervals
Specify the placement of the first level tick labels relative to the tick
marks.
If you select In intervals, the tick label will be shown inside the
interval and denote the period. If the major interval of the time axis
is month, then the tick label may be shown as Jan, Feb, etc.
If you select Between intervals, the tick label will be shown directly
below the tick label and denote that point in time. With a major
interval of one month, the tick label may be shown as Jan 1, Feb 1,
etc.
Short
Medium
Long
Select the date and time format to use for the tick label. It is
recommended that you try the various options to see how they work
for various intervals and periods. As an example, Short will display
the month number (1), Medium will display the month with three
letters (Jan), while Long will display the entire month name
(January).
on/off
Select whether time information that is common for all tick labels
should be shown or not. If, say, the simulation runs for one full year,
selecting this option will display the year in the tick label, while
deselecting it will remove the year from the tick label.
on/off
Select whether the tick labels should be shown in one or two lines. If
you select this option, information that is common for some of the
tick labels will be shown below a range of tick labels. while
deselecting it will include the common information in all the tick
labels of the range.
Placement
Format
Show static
time
elements
Allow
second level
Description
- 363 -
Format
(second
level)
Short
Medium
Long
Select the data and time format to use for the second level tick
labels.
Examples
The three illustrations below show how the tick labels of the time axis can be changed by using the
options above. The settings for each are shown in the table.
Time Graph
Placement: In intervals
Format: Short
Show static time elements: On
Allow second level: On
Format (second level): Long
- 364 -
A Time Graph control displaying four parameters, where three are summarized and displayed as bar
graphs. The summary period equals the major interval of the time axis, which in this example is set to
one quarter.
- 365 -
Properties.
3. Sort the parameters in the list by selecting them and using the Up and Down buttons.
4. Click OK to save the changes, or Apply to save the changes without closing the dialog box.
The four available chart types: Line (top left), Smooth Line (top right), Step (bottom left), and Bar
(bottom right).
The options are also available on the Chart Graph property page for each selected parameter. The
property page can be accessed by right-clicking the graph or the entire control, and selecting
Properties on the shortcut menu.
Double-click the control that you wish to change, or select it and click
Properties.
Select the Parameters tab in the Properties dialog box.
Select the parameter to hide in the list, and select the Visible option.
Click OK to save the changes, or Apply to save the changes without closing the dialog box.
- 366 -
Double-click the control that you wish to change, or select it and click
Properties.
Select the Parameters tab in the Properties dialog box.
Select the parameter to show in the list, and select the Visible option.
Click OK to save the changes, or Apply to save the changes without closing the dialog box.
1. Right-click the graph of the parameter whose history you would like to show in the time graph
control, and select Show History on the shortcut menu. The history of the parameter will appear
in the history dialog box.
2. To export the history to a file or the clipboard, click Export.
3. Control the layout of the history in the Export History dialog box.
1. Select Include headers to include column (or row) headers.
2. Select Include times to include time information with the history.
3. Select Times down to control the orientation of the variable history. If selected, the values will
be separated by a line shift.
4. Control the decimal separator and column delimiter under Format.
1. Select the Decimal Separator. Options are '.' (point) and ',' (comma).
2. Select the Delimiter. Options are 'Tab', 'Space', ';' (semi-colon), and ',' (comma).
5. Select the destination for the export under Destination.
1. Select File to export the history to a text file. You will be prompted to specify a file name and a
location when you click OK.
2. Select Clipboard to export the history to the Windows Clipboard. When you click OK the
history is copied to the Clipboard, and you can paste it into the any Windows application.
6. When you are satisfied with your selections, click OK to export the data.
7. Click OK to close the history dialog box.
- 367 -
properties:
! Line: The outline of the graph area.
! Minor Horizontal Grid: The minor grid of the value axis.
! Major Horizontal Grid: The major grid of the value axis.
! Minor Vertical Grid: The minor grid of the time axis.
! Major Vertical Grid: The major grid of the time axis.
3. Select the Fill tab to format the interior fill of the graph area.
4. Click OK to save the changes, or Apply to save the changes without closing the dialog box.
Note! The intervals for the gridlines of the value axis are specified on the Value Axis property
page. The intervals for the gridlines of the time axis are specified on the Report property page
in the Simulation Settings dialog box.
Show Gridlines
1.
2.
3.
4.
Double-click the control that you wish to change, or select it and click
Properties.
Select the General tab in the Properties dialog box.
Under Gridlines, select the gridlines to display.
Click OK to save the changes, or Apply to save the changes without closing the dialog box.
Note! The intervals used for the time axis gridlines are specified on the Time Axis tab, while the
intervals used for the value axis gridlines are specified on the Value Axis tab in the Properties
dialog box for the control.
You can also access the properties of the legend on the General tab when clicking
Properties.
- 368 -
The animation illustrates how the report window can be used to present only a portion of the
simulation at a time. The report window has a length of one month, and when the first month is
completed, it slides by an interval of one day. The entire simulation lasts for two months.
To set up a report window for the simulation:
1. Select Simulation Settings on the Simulation menu.
2. Select the Report tab.
3. Under Reporting Window, select the appropriate length and slide of the reporting window. The
length denotes the size of the window, while the slide indicates when the window will scroll.
4. Click OK to save the changes.
The changes are immediately recognized by the time graph control.
- 369 -
The Time Table can be used to display the value of parameters over the simulation in various periods.
- 370 -
Note! The reason for displaying the period name rather than the time of the reporting time step,
is simply that the value displayed is valid for the entire period, and not only for the time step in
which it is displayed. The parameter may, as an example, display the average over the period,
and therefore the only time display that makes sense is the name of the period.
You can also control the format of the time display, and you can specify whether time elements that
are static over the
Times Options
Property
Format
Always
show
interval
names
Show static
time
elements
Available
options
Short
Medium
Long
Description
Select the date and time format to use for the tick label. It is
recommended that you try the various options to see how they work
for various intervals and periods. As an example, Short will display
the month number (1), Medium will display the month with three
letters (Jan), while Long will display the entire month name
(January).
on/off
on/off
Select whether time information that is common for all tick labels
should be shown or not. If, say, the simulation runs for one full year,
selecting this option will display the year in the times, while
deselecting it will remove the year.
- 371 -
4. Click OK to save the changes, or Apply to save the changes without closing the dialog box.
The report interval is specified using an integer and one of the predefined intervals in the box. The
Time Step, Minor Interval, and Major Interval refer to the settings specified in the Simulation Settings
dialog box, under the Report tab.
- 372 -
A risk assessment analysis will provide you with a probability distribution of how the variation in
assumptions will affect the value of effect variables.
Since the various Risk Assessment variables are only available internally in the task, all presentations
for the task must be created in private diagrams.
- 373 -
Sample methods
The Risk Assessment task uses sophisticated sampling methods to produce sample value sets for the
selected assumptions defined by probability distributions, before simulating the model. This is
required to approximate the probability distribution function of the selected effects.
Latin Hypercube is the recommended method, but you can also use the Monte Carlo method. While
the Monte Carlo method is a simple random sampling method, Latin Hypercube combines random
sampling with factorial design.
The Risk Assessment task now produces distributions of values for the effect variables.
Risk Assessment has been used for example to find what levels of production, staffing and capital
costs allow minimal inventories, and to show which investments maximize profits without hurting the
cash flow.
You can easily experiment with future scenarios and develop the best long-term strategy.
- 374 -
2.
3.
- 375 -
5.
6.
- 376 -
- 377 -
Assumptions are changeable variables beyond your control. Changeable variables are model
variables that the Risk Assessment task can alter during the execution of the simulation runs.External
factors that influence a model are assumptions if they are modeled as constants rather than computed
variables. It is quite common that there is uncertainty around the value of assumptions. Inflation rate
and interest rate are typical examples of assumptions. Assumptions can take place at any time in the
simulation.
Decisions are assumptions with fixed values, and are variables that you can directly influence. You
can, for example, decide upon the production volume of a new production line or the salary of a group
of employees. At the policy level, decisions are parameters to policy procedures. Decisions can take
place at the start or at a specified time of the simulation. (Decisions are a conceptual term in Studio,
and there is no distinction between decisions and assumptions in the software.) Note that the initial
value of a level can be controlled by the task, and it can therefore be selected as an assumption with a
fixed value.
Effects are computed variables for which you want to study the uncertainty distribution in the Risk
Assessment task. Computed variables are variables that the Risk Assessment task cannot alter during
the execution of a task. Levels that accumulate flows and auxiliaries that depend on other variables
belong to this category.
- 378 -
Triangular Distribution
For the triangular distribution, you are requested to enter minimum,
maximum and peak values.
Parameters: Minimum, Peak, Maximum.
Exponential Distribution
For the exponential distribution, you are requested to enter a location input
value, My (), which must be a positive value that shifts the curve along
the horizontal axis, and scale input value, Beta (), which determines the
shape of the curve. You can, for example, use this distribution when
describing lifetime probability for a device.
The general form of the exponential probability density function is:
Parameters: (Mu), (Beta)
- 379 -
4. Select the various properties, such as Mean, Standard Deviation, etc., in the treeview, and change
their values in the Value column of the treeview.
To define a probability distribution for an assumption in the Properties dialog box:
1. Right-click the assumption you wish to define in the
Risk Assessment Variables window, and
select
Properties on the shortcut menu.
2. Select the Assumption tab.
3. Enter the time at which the assumption should be applied in the Apply Time field. To apply the
assumption at the start of the simulation, enter the value Start or use the spin button to select it.
Alternatively, you can enter a time at which the assumption should be applied. You will be
warned if you try to enter a start time that is beyond the time interval of the simulation.
4. Select the probability distribution to use in the Distribution Type list. The available parameters in
the Distribution Parameters list will be automatically updated to correspond to the selected
distribution.
5. Change the available parameters for the distribution according to your preferences.
6. Click OK to save the changes, or click Apply to save the changes without closing the dialog box
- 380 -
- 381 -
Private Diagrams
The Risk Assessment variables will only be available inside the task itself, and you must therefore use
Private Diagrams to set up data presentations for these analyses. Private Diagrams are so-called
Interaction Diagrams, which can only be used for data input and output. You can use any presentation
objects at your disposal in Studio.
Note! Shared diagrams are Constructor diagrams, and they are identical in all simulation tasks
of a component. A Constructor diagram can contain any available symbol, such as variables,
flows, and controls. Private diagrams, on the other hand, are Interaction diagrams, and they
only exist within the simulation task where they were created. An Interaction diagram can only
contain presentation symbols, such as frames, hyperlinks, and controls.
High-Low charts
High-low charts display graphs showing bands of the lowest to the highest output values over time, as
affected by variation in assumption values. High-Low charts are created in Studio by using the
standard Time Graph control and using different line and fill colors for the different estimates.
The bands of the high-low chart is created by coloring the area between pairs of an effect's
estimates.Bands can be created by using these pairs: High/low, 5%/95%, 10%/90%, and 25%/75%.
The illustration below shows one such high-low chart where all of these pairs have been used. The red
line in the center is the effect's average value.
The High-Low chart shows the bands of the lowest to the highest output values over time. In this
graph, the yellow band shows 0-100%, the blue band shows 10-90%, the green band shows 25-75%,
while the red line shows the 50% Percentiles.
The table below shows line and fill colors of the various parameters to achieve the display above.
Parameter
Line color
Fill color
High
Orange
Yellow
90% Percentile
Blue
Cyan
75% Percentile
Dark green
Light green
50% Percentile
Red
25% Percentile
Dark green
Cyan
Low
Orange
None
- 382 -
High-Low tables
The High-Low tables shows the time series for the various effect estimates. It is achieved simply by
adding a time table to your diagram and selecting the desired estimates as parameters.
Histograms
The histogram displays the number of occurrences of different values for the given effect. The total
number of occurrences equals the number of samples specified in the method tab. Powersim Studio
doesn't feature a specialized histogram control. However, you can present your data in a histogram by
using a simple model structure and a Chart control. The model structure is presented below.
- 383 -
The level Histogram can now ben displayed in a chart control You control the display of the
histogram by several factors, such as:
!
!
!
The submodel has been defined with a Category Size of 5000USD and an Offset or 50000USD. The
range Histogram has eight elements, with the name '50-54', '55-59', etc.
- 384 -
The High-Low chart shows the bands of the lowest to the highest output values over time. In this
graph, the yellow band shows 0-100%, the blue band shows 10-90%, the green band shows 25-75%,
while the red line shows the 50% Percentiles.
The table below shows line and fill colors of the various parameters to achieve the display above.
Parameter
Line color
Fill color
High
Orange
Yellow
90% Percentile
Blue
Cyan
75% Percentile
Dark green
Light green
50% Percentile
Red
25% Percentile
Dark green
Cyan
Low
Orange
None
- 385 -
The time table shows the time series from a Risk Assessment analysis. It shows the Average, Highest
and lowest values, as well as the 25% and 75% percentiles.
Create a Histogram
The histogram displays the number of occurrences of different values for the given effect. The total
number of occurrences equals the number of samples specified in the method tab. Powersim Studio
doesn't feature a specialized histogram control. However, you can present your data in a histogram by
using a simple model structure and a Chart control.
We have included the Histogram submodel as a component in the ra_presentation.sip project of the
Learning Lab, so you can easily utilize it in your Risk Assessment projects. The few steps below
shows you how to use it.
To add a histogram to your simulation project:
1. Open the simulation project where you want to utilize the Histogram submodel.
2. Open the diagram where you want to insert the submodel.
3. Click the small arrow next to
Copy Component as Submodel and select Browse for File to
Copy from... on the submenu.
4. Click inside the diagram where you want to place the submodel.
5. Browse to the folder where you installed Powersim Studio, then go to the Samples\Bits\ folder.
Select ra_presentation.sip
6. Select Histogram in the Copy Component dialog box.
7. Drag a link from the variable you wish to create a histogram for and to the submodel.
8. Select the Histogram.Input variable in the Define Child Variable dialog and click OK.
9. You have to set two more variables inside the submodel; Category Size and Offset. You can either
set them directly in the Equations view by defining them, or you can insert two constants in your
diagram, drag links to the Histogram submodel, and connect them to the corresponding variables
inside Histogram. Both these variables need the same unit of measurement as the variable you
wish to chart.
10. Insert a Chart Control on your diagram. Add the variable Histogram.Histogram as a parameter for
the chart. Format it to suit your preferences.
11. If you need more categories in your histogram, you can increase the number of elements in the
Histogram range, which you will find in Global Ranges. The default value is 8.
- 386 -
Tip! You can also get category names in the histogram. By deleting the existing range named
Histogram and then creating a new enumeration range by the same name, the histogram will
get the range element names along the category axis.
The illustration below shows how the finished histogram may look.
The submodel has been defined with a Category Size of 5000USD and an Offset or 50000USD. The
range Histogram has eight elements, with the element names '50-54', '55-59', etc.
- 387 -
About Datasets
Datasets allow you to transfer data between a simulation and a "value store," such as SEM-BPS,
Microsoft Excel spreadsheets, or internally in Studio. A dataset supports bidirectional transfer,
making it easy to export the time series of a model variable to the value store, while at the same time
receiving time series to another model variable.
A dataset contains variables, in much the same way as a component (or model, if you like) does.
Variables in the model and the dataset have defined transfer directions, and variables can be
interconnected if their transfer directions correspond to each other a model variable with a transfer
direction of out can connect to a dataset variable with a transfer direction of in). To be able to connect
to each other, the variables must also have compatible type, dimension, and unit definitions.
Architecture
The dataset definition contains the definition of the variables, history for the variables (if available),
and information about how these histories are being transferred to external data sources (except the
Studio dataset, which stores its histories internally in Studio). Most datasets will keep the last saved
data in its cache, allowing you to run the simulation even if a connection to the external data source is
not available.
The connection between the dataset and the simulation is made in the
Co-models View. When a
connection is made, an instance of the dataset is created. This instance keeps a copy of the history for
each variable, provided one exists. The transfer setting of the connection controls when new data in
the dataset instance is saved back to the main dataset. In Automatic mode, new data is saved
immediately, while in Manual mode, you control when the data is written back to the main dataset
- 388 -
yourself.
When the connection between the simulation and the dataset is made, you can connect the model
variables to the dataset variables. This connection can be made automatically, if you wish, or you can
define them manually by drag and drop. The transfer direction of the dataset and model variables
must match each other in order for a connection to be established.
Note! You can only create dataset connections at the start of the simulation, since the value of
model variables may change significantly as you start to import data from the dataset (rather
than calculating the imported model variables internally).
During a simulation, a time series is generated for the model variable. This time series is transferred
continuously to the connected dataset variable in the co-models view. If the dataset is set to
Automatic transfer, the co-models dataset variable will transfer its time series to the main dataset at
the end of the simulation. If the dataset is set to Manual transfer, you decide yourself when the
transfer from the co-models dataset to the main dataset is made. You can only save data at the end of
the simulation, however.
Dataset Overview
The relationship between simulations and datasets. The connection between the simulation and the
dataset is set up in the Co-models view. This is also where the connections are established on a
variable to variable level.
- 389 -
!
!
First: Record the variable's value at the start of the summary period.
Last: Record the variable's value at the end of the summary period.
Minimum: Record the variable's minimum value over the summary period. This summary type is
only available for dataset variables that have the transfer direction in in the dataset.
Maximum: Record the variable's maximum value over the summary period. This summary type is
only available for dataset variables that have the transfer direction in in the dataset.
Average: Record the variable's average value over the summary period.
Accumulated: Record the variable's accumulated value over the summary period. This is identical
to letting the variable control a flow into a level, and then report the level's value.
- 390 -
- 391 -
For manual transfers, you control the data transfer between the data connection and the data store
yourself. Data can only be loaded at the start of the simulation, and data can only be saved at the end
of the simulation. However, in this transfer mode you don't have to load or save data for every
simulation, but choose yourself when you want to transfer data to and from the data store.
Variable transfers
Data transfer on the variable level occurs continuously throughout the simulation. If the dataset
contains data with a lower resolution than the simulation requires, data will be interpolated for the
intermediate data points.
The data transfer on this level is performed between the simulation and the dataset connection, and
doesn't involve the external data store at all, during the simulation.
Valid transfer directions for different variable types
All transfer directions are not compatible with all model variable types. The table below shows the
different transfer directions that are allowed for each variable type.
Simulation Dataset Comments
Level
The history for the level is exported from the simulation and to the dataset.
out
in-out
in
An initial value is imported to the level from the dataset, while the rest of
out-in the history for the level is exported from the simulation and to the dataset.
Auxiliary
The history for the level is exported from the simulation and to the dataset.
out
in
in
out
The entire time series is imported to the auxiliary from the dataset.
Constant
out
in
in
out
in-out
The history for the constant is exported from the simulation and to the
dataset. This is useful when you want to record the user inputs made
during a simulation.
The entire time series for the constant is imported to the auxiliary from the
dataset.
The initial value of the constant is imported from the time series for the
out-in constant, while the rest of the time series for the constant is exported from
the constant to the dataset.
Create a Dataset
You can add and delete datasets from your project in the Project Window.
1. If the Project Window is not open, open it by clicking
Project Window on the View menu.
2. Right-click
Project in the Project Window, and select Add Dataset on the shortcut menu.
Select the dataset you wish to add on the submenu.
- 392 -
Co-models view.
1. If the simulation is not at start time (initial time), reset it by clicking Reset Simulation in the
toolbar, or by hitting Ctrl-R.
2. If the
Co-models view is not open, expand the nodes in the Project Window until the
Comodels node for the current simulation is visible.
3. Open the
Co-models view by double-clicking the node, or right-clicking it and select
View
on the shortcut menu.
4. Right-click anywhere inside the Co-models view, and select Create Dataset Connection. Select
the dataset you wish to connect on the submenu.
The dataset you selected will appear below the
When a dataset connection has been made in the Co-models view, the connection will appear below
the main model in the list.
Main
Tip! Before performing the drag-and-drop operations, we recommend that you arrange the
views you need to use using the Window menu. This makes it easy to drag from the source and
- 393 -
- 394 -
You can define the dataset variable in the different columns in the Dataset view. You can also access
most of the properties in the Properties dialog box.
To define a dataset variable:
1. Right-click the variable you wish to define, and select
Properties on the shortcut menu.
2. Select the datatype of the variable under Type. Options are Complex, Real, Integer, and Boolean.
The datatype of the dataset variable must match the datatype of the model variable it is going to
connect to.
3. Specify or select the Unit for the variable under Unit. Options are any unit that id'.s defined in the
project's Global Units. The unit of the dataset variable must match the unit of the model variable it
is going to connect to.
4. Specify or select the dimension of the variable under Dimension. The dimension of the dataset
variable must match the dimension of the model variable it is going to connect to.
5. You can document the variable in the Documentation and Note fields available in the dialog box.
6. Click Apply to save the changes, or OK to save the changes and close the dialog box.
7. To define a transfer direction for the dataset variable, you right-click it and select Transfer
Direction on the shortcut menu. Options are None, In, Out and Out-In.
8. To define the summary type to be used for the dataset variable, you right-click it and select
Summary Type on the shortcut menu. Options are First, Last, Minimum, Maximum, Average,
and Accumulated (some options may be excluded if they are not compatible with the selected
transfer direction).
Note! You can set all dataset variables to have the same dimension by right-clicking the
Dataset node and selecting Common Dimensions on the shortcut menu. In this case you
must specify the dimension in the Dimension entry for the Dataset node.
Note! Unlike model variables, dataset variables are only treated as continuous variables. You
should therefore take care when exporting or importing model variables using either Zero
Order or Zero Order Immediate integration settings. These will be exported to and from the
dataset as ordinary continuous variables.
- 395 -
connected), and there exists model variable counterparts (with the same variable name) for all the
dataset variables.
Auto-connect single variables
1. Right-click the dataset variable you wish to auto-connect, and select Auto-connect Variable on
the shortcut menu.
The dataset variable will be connected to the corresponding model variable (with the same variable
name). You are only allowed to auto-connect variables that have corresponding properties and the
same name.
Connect single variables manually
1. Right-click the dataset variable you wish to connect, and select Connect Variable on the shortcut
menu.
2. Select the model variable you wish to connect to on the submenu.
The list that appears contains only model variables that can be connected to the dataset variable in
question. When the operation is performed, a connection is established between the two variables.
This operation allows variables with different names to be connected to each other.
Connect single variables by drag and drop
You can establish variable connections by drag and drop as well. In this case, you can also drag
variables from both the Equations View and Constructor diagrams, as well as from the Co-models
view itself.
1. Select the model variable you wish to connect to the dataset variable.
2. Drag the model variable and drop it onto the dataset variable you wish to connect it to.
The model variable will be connected to the dataset variable. If the transfer directions (or other parts
of the definitions) doesn't match, you will not be allowed to drop the model variable onto the dataset
variable. Also, if only one of the variables have a defined transfer direction, the transfer direction of
the other variable will be changed to the corresponding direction. Finally, if none of the variables
have a defined transfer direction, the model variable will be exported to the dataset.
Tip! If you use the right mouse button when dragging and dropping, a shortcut menu appears
when you have dropped the variable, allowing you to select the action yourself. If you use the
left mouse button when dragging and dropping, the default action will be executed.
- 396 -
All transfer directions are not compatible with all model variable types. The table below shows the
different transfer directions that are allowed for each variable type.
Variable Type Allowed transfer directions
Level
Out; In-Out
Auxiliary
In; Out
Constant
- 397 -
3. Hit F2, and enter the dimension definition you want to use for all the dataset variables.
4. Hit Enter to save the definition.
When the Common Dimensions option is enabled, all the dataset variables will use the dimension
definition entered on the dataset node. This makes it easy to change the dimensions of all the dataset
variables in one operation.
!
!
First: Record the variable's value at the start of the summary period.
Last: Record the variable's value at the end of the summary period.
Minimum: Record the variable's minimum value over the summary period. This summary type is
only available for dataset variables that have the transfer direction in in the dataset.
Maximum: Record the variable's maximum value over the summary period. This summary type is
only available for dataset variables that have the transfer direction in in the dataset.
Average: Record the variable's average value over the summary period.
Accumulated: Record the variable's accumulated value over the summary period. This is identical
to letting the variable control a flow into a level, and then report the level's value.
- 398 -
Co-models view.
1. Right-click the dataset or model variable you wish to disconnect, and select Disconnect on the
shortcut menu.
The connection between the two variables will be lost, but no changes will be done to the model
and/or dataset variables.
The dataset will be removed from the list. Any connection to external data stores will be shut down.
Rename a Dataset
To rename a dataset:
1. Locate the dataset in the
Project window, by expanding the Datasets entry
2. Select the dataset you want to rename and hit F2 to rename it. Alternatively, click the entry twice
(not too fast).
3. Enter the new name for the dataset, and hit Enter .
- 399 -
The dataset variable will disappear from the dataset. If it was already connected to a model variable,
the connection will obviously be lost.
Delete a Dataset
You can add and delete datasets from your project in the Project Window.
Note! The operation below cannot be undone!
1. If the Project Window is not open, open it by clicking
Project Window on the View menu.
2. Right-click the dataset you wish to delete, and select Delete on the shortcut menu.
The dataset you will disappear in the Project Window.
- 400 -
1. Select
External Data on the Simulation menu, and select
Load... on the submenu.
2. Select the dataset(s) you wish to load in the Load External Data dialog box. Datasets that have
changed since the last time you saved will be marked with an asterisk (*).
3. Click OK to save data to the external data store.
Some datasets allow you to change settings for the external data store, such as version or package
information in the
SEM Dataset. You can access these settings by clicking for the relevant
dataset
You can also load the history for the dataset connection itself in the
Co-models view.
1. Right-click the dataset you wish to load, and select Load Data on the shortcut menu.
Save a Dataset
If the transfer mode for a dataset is set to Automatic, the transfer between the external data store and
the dataset connection will be performed automatically when needed.
If the transfer mode for the dataset is set to Manual, on the other hand, you must control the data
transfer yourself. This is done inside the simulation, by selecting
External Data on the
Co-models view
Simulation menu, or by using the shortcut menu on the dataset connection in the
itself.
Note! If the dataset receives data from the simulation (contains connected dataset variables
with a transfer direction set to in), you can only save data at the end of the simulation!
1. Select
External Data on the Simulation menu, and select
Save... on the submenu.
2. Select the dataset(s) you wish to save in the Save External Data dialog box. Datasets that have
changed since the last time you saved will be marked with an asterisk (*).
3. Click OK to save data to the external data store.
Some datasets allow you to change settings for the external data store, such as version or package
information in the
SEM Dataset. You can access these settings by clicking for the relevant
dataset
You can also save the history for the dataset connection itself in the
Co-models view.
1. Right-click the dataset you wish to load, and select Save Data on the shortcut menu.
- 401 -
4. Right-click the Dataset connection node, and select Transfer on the shortcut menu. Select
Manual on the submenu.
Note! If you want to be able to save the edited history you must also select the Allow Writeback option.
- 402 -
- 403 -
The
Studio dataset contains dataset variables that you can connect to model variables in the
simulation. The dataset variables are defined in the
Studio Dataset view, which is available in the
Project Window.
The connection between the dataset and the simulation is managed in the
Co-models view.
- 404 -
A small arrow on the outline of the variable symbol indicates that the variable can be connected to a
dataset. The model variable can have three different transfer directions: states: out, in, and in-out.
- 405 -
be auto-connected, but you are also allowed to connect variables with different names as long as the
data type, unit, dimensions, and transfer direction is compatible.
Date formats and calendars in Studio and Microsoft Excel
The date formats in Studio and Microsoft Excel are different. Also, the range of available times is far
higher in Studio, where you can virtually run a simulation from the start of the history, while Excel
dates are more or less limited to the last century and on. However, when the dataset receives date
information from Microsoft Excel, it will automatically convert the dates to simulation times in
Studio. You don't have to think about this at all, simply enter the dates as you would normally do in
Microsoft Excel, using the built-in date formats available.
While Powersim Studio supports three different calendars, Microsoft Excel only support the
Gregorian calendar. Simulations run with the Gregorian calendar will be fully compatible with Excel,
and the dates are exactly the same between the two. If your simulation is using the Bank or the Fiscal
calendar however, you will notice that the dates and times exported to Excel are translated into the
Gregorian calendar automatically. If the period selected for the dataset is less than a full month, this
translation will become visible as the calendars must be stretched a little to be compatible.
As an example, as the Bank calendar January has 30 days, the Gregorian calendar January has 31
days. The dates in the Bank calendar are therefore stretched by 31/30 days, which will add exactly 2
seconds to the minute. The table below summarizes how the times correspond to eachother.
Powersim
Studio
Bank
Calendar
Microsoft
Excel
Gregorian
Calendar
Comment
1/1/2003
1/1/2003
1/15/2003
1/15/2003
11:12:00
Since January has 30 days in the Bank calendar and 31 days in the
Gregorian calendar, 1/30 day must be added to each (Gregorian)
day in order for the calendars to be compatible.
2/1/2003
2/1/2003
2/15/2003
2/14/2003
01:36:00
Since January has 30 days in the Bank Calendar and 28 days in the
Gregorian calendar, 1/28 day must be deducted from each
(Gregorian) day in order for the calendars to be compatible.
3/1/2003
3/1/2003
3/15/2003
3/15/2003
11:12:00
Since January has 30 days in the Bank calendar and 31 days in the
Gregorian calendar, 1/30 day must be added to each (Gregorian)
day in order for the calendars to be compatible.
4/1/2003
4/1/2003
4/15/2003
4/15/2003
Since April has 30 days in both the Bank calendar and the
Gregorian calendar, all the dates in April are equal between the
two calendars.
The translation follows the same principles when the simulation uses the Fiscal calendar. However,
since the January, April, July, and October have 31 days and the rest of the months have 30 days, the
strecthing factor is different from the ones used by the Bank to Gregorian calendar conversion.
The best solution is to simply run your simulation using the Gregorian calendar, if you need to
transfer data with a period less than a full month. Alternatively, you must manually adjust the times in
your Excel sheet with the appropriate calendar conversion factor.
- 406 -
Tip! If you need to create the times for such calendar conversions, simply set up a Spreadsheet
dataset with the correct sampling times and calendar combinations that exports a time series to
Excel. You can then simply copy the times from the exported time series, and use those times for
your input data.
Double-click the
Spreadsheet Dataset entry in the
Project Window.
Right-click the Dataset node, and select
Properties on the shortcut menu.
Click the Layout tab.
Select the Transfer at regular intervals option.
Use the boxes below the option to specify the sampling interval of the dataset.
Click Apply to save the changes, or OK to save the changes and close the dialog box.
Available time units for the sampling interval are Timestep, year, quarter, month, week, day, hour,
minute, and second. The preceding number denotes the length of the interval. Example: 2xMonth
indicates that the sampling interval is two months, thereby producing one value each second month.
This sampling period is also used for the summary types of the dataset variables.
- 407 -
use. Click Browse to select the workbook file from a location on your computer.
4. Click Apply to save the changes, or OK to save the changes and close the dialog box.
When you connect the dataset to a simulation, the dataset will launch Microsoft Excel with the
specified file name. If the file doesn't already exist on your computer, Excel will automatically create
it.
Tip! If the file doesn't already exist on the computer, you can specify a template to use for the
new file under Template on the General property page.
Tip! You can use the {RUNINDEX} code to allow the names in Sheet, Cell, or Workbook to
automatically change for new simulation runs. (Requires you to set the Run Count in
Simulation Settings for the project.)
Times
<Time> <Value>
<Value>
...
<Time> <Value>
<Value>
...
...
...
...
...
...
...
...
...
The illustration shows the difference between the two possible orientations of the output table.
Format Variable Header
Under Variable Names, you select the content of the variable header cell. The header cell can contain
the name only; the name and subscript; the name, subscript and unit; or the name and unit. You can
also hide the header completely. The table below shows the possible header layout for the variable My
Var, with the unit m, and dimension 1..2,1..2.
My Var My Var[1,1] My Var[1,1] (m) My Var (m)
a)
b)
c)
d)
The various variable header formats: a) Name, b) Name, Subscript, c) Name, Subscript, Unit, and d)
Name, Unit.
- 408 -
You can also select to put the subscript and/or the unit in separate cells, which will be placed below
the variable header. The table below shows the layout for the example above, with both subscripts and
units in separate cells.
My Var
(m)
[1,1]
[1,2]
[2,1]
[2,2]
Variable 1
Variable 2
...
<Time> <Value>
<Value>
...
<Value>
<Value>
...
<Time> <Value>
<Value>
...
<Value>
<Value>
...
...
...
...
...
...
...
...
You can turn the time column on and off using the "Times in separate cells" option.
- 409 -
new simulation runs. (Requires you to set the Run Count in Simulation Settings for the project.)
First, the first sampling time in the spreadsheet should coincide with the start time of the
simulation. The reason for this is that the dataset will return NAN (Not a Number) for any
simulation times that lie beyond the time series in the spreadsheet. Thus, the dataset will not
contain an initial value for the variable.
Second, the last sampling time in the spreadsheet should coincide with the stop time of the
simulation, for the same reason as mentioned above.
Third, the layout of the spreadsheet must be equal to the layout that you have specified on the
Layout tab of the Spreadsheet Dataset. You must take into account all the rows (or columns) that
the dataset will use for variable headers, units, and subscripts.
Tip! When creating a spreadsheet with sampling times, it is a good idea to create a bidirectional dataset first, with sampling times at regular intervals. When you synchronize the
spreadsheet, Studio will format the spreadsheet using the layout specifications you have
selected in the Layout tab. Then you can use this file as a template when formatting the
spreadsheet to include sampling times.
- 410 -
Variable 1
1
1
...
...
N
...
...
M
...
Variable X
...
N
...
1
1
...
...
N
...
M
1
...
1 <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x>
1 ... <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x>
Q <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x>
... ... <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x>
1 <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x>
P ... <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x>
Q <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x> <x>
The table above shows the output produces by the dataset when the Common Dimensions for All
Variables option is selected. The example shows an example with X variables, all having the
dimensions '1..M,1..N,1..P,1..Q'.
The layout above is achieved by transferring Immediate Behavior. In addition, two dimensions is
selected to appear next to the name. If one dimension next to name was selected, three dimensions
would appear in the three leftmost columns. If three dimensions next to name was selected, three
dimensions would appear in the three columns below the name, while only one would appear in the
left column.
When you transfer Behavior over Time, all dimensions are presented in rows below the variable
names.
- 411 -
When changing the definition of the dataset, you will often change the layout of the resulting
spreadsheet. To update these changes in the spreadsheet:
1. Righ-click the dataset connection in the
Spreadsheet on the shortcut menu.
Note! When you synchronize the spreadsheet, you might loose data. It is a good precaution to
always work on a copy of the workbook file to prevent loss of important data.
You can also show the spreadsheet and select the cells in the spreadsheet by using the Select
Spreadsheet and Select Cells commands available on the shortcut menu of the dataset connection.
These utilities makes it easy to see the area in the workbook that will be updated by the dataset
connection.
- 412 -
The selected range will now make sure that the data that is added to the cells in the range are valid
with regards to the entered validation criteria.
Use Names for Cells, Sheets, or File that Change with Run Number
If you have specified the run count in Simulation Settings for the project, you can make the
spreadsheet dataset automatically change cell, sheet, or file reference to reflect the run number. This is
useful if you want to save the results from various simulation runs.
Note! The run number is reset when the simulation is reset. When the simulation has reached
the end, you should start a new simulation by clicking Start simulation directly rather than
resetting the simulation first.
To make names change with run number:
1. Right-click the Dataset node in the
Spreadsheet Dataset view, and select
Properties on
the shortcut menu.
2. Click the General tab (if necessary).
3. Select the name you wish to update automatically with the run number - Sheet, Cell or Workbook.
4. Enter the name followed by the code '{RUNINDEX}'.
5. Click Apply to save the changes, or OK to save the changes and close the dialog box.
Example
You can save the results from the various simulation runs in various sheets in the workbook. The
sheets should all start with Simulation, and end with the run number. To achieve this, you enter the
following text in the Sheet box:
Simulation{RUNINDEX}
Each time you click Start Simulation, new simulation results will be stored on separate sheets
named Simulation1, Simulation2, etc. This continues until the run count specified in Simulation
Settings is reached. At this point the run number is reset.
- 413 -
- 414 -
value, and afterwards record the output from the variable as a time series.
To set up a transfer of behavior over time:
1. Right-click the Dataset node in the
Spreadsheet Dataset view, and select
Properties on
the shortcut menu.
2. Click the Layout tab.
3. Select Behavior over Time under Category.
4. Click Apply to save the changes, or OK to save the changes and close the dialog box.
When you have selected to transfer behavior over time, you must also provide the dataset with
information on the sampling times for the behavior. Be careful to select a sampling time that captures
the interesting behavior, but still doesn't generate to many output points. If the connection is Bidirectional or From Spreadsheet, you can also provide the sampling times directly from the
spreadsheet.
- 415 -
When transferring only from the spreadsheet to the model variable, you have to specify the sampling
times in the spreadsheet. The dataset will read the times from the first column of the spreadsheet, and
automatically convert them into times that are compatible with the simulation time. When entering
times in the spreadsheet, you should use one of Microsoft Excel's date formats.
To set up a transfer from a spreadsheet to a model variable:
1. Right-click the Dataset node in the
Spreadsheet Dataset view, and select
Properties on
the shortcut menu.
2. Click the Layout tab.
3. Select Transfer from Spreadsheet under Transfer direction..
4. Click Apply to save the changes, or OK to save the changes and close the dialog box.
When you have selected this option, a dataset variable can only have one transfer direction: out. The
corresponding transfer direction for the model variable is in.
- 416 -
- 417 -
dataset).
2. In the first column (if Variable Names Across is selected under Orientation) or the first row (if
Variable Names Down under Orientation is selected) of the spreadsheet, enter the times at which
you wish to import data. You can use the time formats available in Microsoft Excel. The dataset
will automatically convert these times to their equivalent in Powersim Studio.
Note! Be sure to select the correct sheet when entering the times (you must obviously use the
same sheet as specified under Sheet on the General tab of the dataset.
- 418 -
- 419 -
- 420 -
the dataset definition, it is locked and cannot be changed for each dataset connection individually.
Note! If the package is defined in the dataset definition, characteristics that define dimension
ranges, units, and currencies may be restricted in the planning package. Otherwise these
characteristics must be restricted in the planning level.
All the characteristics included in the planning level must be included in the planning layout.
Characteristics that are going to be used as version ranges must be assigned to the header table of
the layout.
Characteristics that are assigned to the header table of the layout must be restricted to a single
value on the level (although you can also assign such characteristics to the leading columns, if you
wish to), unless they are characteristics that are going to be used as version ranges.
Locked time characteristics (restricted to a single value) must be assigned to the header area.
Time interval and unrestricted time characteristics must be assigned to the lead columns.
Characteristics that are going to be used as dimension ranges must be assigned to the lead
columns.
The key figures that are going to be available to the dataset must be assigned to the value columns
of the layout.
A SEM layout cannot contain more than 10.000 rows of data (this is a restriction of the layouts in
SEM).
It is recommended that the number of decimals to use for the values in the layout should be set to
undefined. (Otherwise, you must make sure that decimal count for each dataset variable in the
SEM Dataset corresponds to the decimal count set in SEM-BPS.)
Assigning single-valued characteristics and characteristics used as version ranges in the header area,
characteristics defining dimension ranges and times to lead columns, and key figures to value
columns will thus make the layout Studio compliant.
Language in SEM datasets
When you establish a connection between SEM-BPS and Studio, the
SEM dataset will use the
currently selected language when defining the necessary variables, ranges, and units. You may change
all these names later, if you wish to. This will not affect the connection to SEM-BPS. As you will see,
all SEM dataset variables will have a technical name that corresponds to the technical name in SEM,
ensuring that connections are established correctly. This technical name is defined in a special
technical language space within Powersim Studio. This technical language has a prefix of _07FF_.
You should normally not have to worry about this when you establish or work with SEM Dataset
connections.
Connection status for the SEM dataset
When a connection is established between Powersim Studio and SAP SEM-BPS, an icon will appear
in the system tray of the Windows Task Bar. The three icons will illustrate the current connection
- 421 -
status, whether it's logged off, logged on but not transferring data, or data transfer is active. The icons
are shown below.
When the icon is visible in the system tray, you can right-click it and control the connection status of
the
SEM Dataset on the shortcut menu. You may also define a time-out interval, allowing Studio
to automatically log off the SAP system when the specified time has elapsed.
Connection Details
The various key figures and characteristics available in SEM-BPS are interpreted into various
properties within Studio and the SEM Dataset. The various mappings are discussed below. You can
view the different characteristics available in the SEM-BPS system on the Characteristics property
page for the
SEM Dataset.
Key figures
Key figures in SEM-BPS are transferred to the dataset as dataset variables, which in turn can be
connected to model variables when a dataset connection is made. The key figures in SEM-BPS must
be marked as InLevel, and they must be included in the planning level. Different layouts in the SEMBPS structure can use different selections of key figures (or all, should you wish so). Only the key
figures that are present in the selected layout of the
SEM Dataset definition will be available in
Studio.
When you synchronize your
SEM Dataset to SEM-BPS, a dataset variable will be created for each
key figure available in the selected layout. The technical name of the dataset variable will be identical
to the technical name of the key figure. This allows you to change the display name of the dataset
variable to anything you like, should you wish to. The transfer direction you specify for the dataset
variable will control the direction of data transfer to and from SEM-BPS. If the direction is set to in,
data will be transferred from Studio to SEM-BPS; if it set to out, data will be transferred from SEMBPS to Studio; and if it is set to out-in, the initial value will be transferred from SEM-BPS to Studio,
while the rest of the time series will be transferred from Studio to SEM-BPS.
After creating a dataset connection between a
SEM Dataset and a simulation in the simulation's
Co-models view, you can connect the dataset variables to their model variable counterparts. Model
variables that have a defined transfer direction are called interface variables, and these will be
available under the Main node. Once you have created a dataset connection, the dataset variables
will be available under the
SEM Dataset node. Connecting the model interface variables to the
corresponding dataset variable can be achieved by a simple drag-and-drop operation.
When connecting a model variable to a dataset variable, the variables must have compatible units,
dimensions, data types, but opposite transfer directions.
- 422 -
Time-related characteristics
When you create the planning level of the planning architecture, you must include time characteristics
that control the recording times of the dataset. There are quite a few valid combinations of time
characteristics and restrictions of these that can be used with the
SEM Dataset. For a complete
listing of allowed combinations of time characteristics, please read Mapping Time Characteristics to
Simulation Time.
There are two different types of time characteristics in SEM-BPS: calendar and fiscal time
characteristics. If your SEM-BPS system utilizes fiscal time characteristics, the conversion will be
defined using one of the fiscal translation schemes available in the
SEM Dataset. Calendar time
characteristics will be mapped to the calendar of the simulation directly.
The time characteristics available in the planning level are used by the
ways, and these three interpretations are shown below.
Time Interval Characteristic: There must always be at least one time characteristic available,
and one of these must be a time interval characteristic. This characteristic is used to determine the
sampling interval of the dataset. A time interval characteristic is restricted to a continuous time
interval in the planning level or the planning package.
Locked Time Characteristic: In systems with two time characteristics, one of them can be
interpreted as a locked time characteristic. A locked characteristic must be restricted to a single
value in the planning level. Note that the fiscal time characteristic 0FISCVARNT will always be
treated as a locked time characteristic.
Unrestricted Time Characteristic: In systems with two (or more) time characteristics, one of
them may be left unrestricted. Such chacteristics are used to determine the resolution of the
dataset. If an unrestricted time characteristic is present, the time interval characteristic above will
be used to determine the major interval, while the unrestricted time interval is used to determine
the minor interval of the reporting time.
Units and currencies
Units and currencies must be restricted to single value in the planning level, or in the planning
package if the package is specified in the dataset definition, in order to be transferred to the simulation
properly. Although units and currencies are treated separately in SEM-BPS, they are treated equally in
Studio. Both are imported as global units and when the dataset is defined or a dataset connection is
established, they will both appear in Global Units.
Note! When connecting a dataset variable to a model variable, you must make sure that they
have compatible units.
Version and
Dimension Ranges
Characteristics describing ranges define the dimensions of the key figures in the SEM-BPS system,
and denotes the structure of the storage. One key figure can contain several versions or elements,
defined by the available range characteristics. These range characteristics may be used in two
different ways in the simulation project. If such a range characteristic is assigned to the header area of
the planning layout that the SEM Dataset connects to, it will be used as a Version Range in Powersim
Studio.
Version dimensions affects the data source of the simulation, as they will control where in the SEMBPS system data are transferred to and from. The version of a simulation is selected for each dataset
- 423 -
connection individually, or you can select them when saving and loading the simulation data.
Characteristics that are used as version ranges can only be restricted in the planning package.
Tip! If you restrict the version range to a single value in the planning package, it will be
selected automatically when you establish a dataset connection.
If a characteristic in SAP SEM-BPS is assigned to the lead columns of the planning layout, it will be
used as a dimension range in Powersim Studio. The dimension range will be used to define the
dimensions of the dataset variable, and the resulting dataset variable will be an array. Characteristics
that are used as dimension ranges must be restricted in the planning level, or it may be restricted in the
planning package, provided the planning package is a part of the connection details that are saved
with the dataset definition.
Ranges that are used to define the dimension of variables are copied to
Global Ranges for the
simulation project. The dimension range will affect the dimension of the simulation model, the dataset
variables, and their connected interface variables. To be able to connect dataset and interface
variables, their dimensions must be identical.
Note! When you restrict a characteristics in the SAP SEM-BPS system to a range, you must
ensure that it is restricted to a continuous subrange of the available values for the
characteristic. This is similar to defining subranges in Studio, where you can define subranges
from a range by selecting the first and the last range element, and the resulting subrange will
contain all the elements between the start and end element.
- 424 -
0CALWEEKDAY1 that are left unrestricted in the planning architecture, and combined with
corresponding time interval characteristics as listed in the tables below.
Mapping fiscal time characteristics
When you include fiscal time characteristics in the planning level, you must always include the
0FISCVARNT characteristic as well, and it must be restricted to a single-value in either the planning
level or the planning package. Furthermore, it must be assigned to the header area of the planning
layout. The 0FISCVARNT time characteristic determines which fiscal calendar reporting scheme is
used.
The
SEM Dataset may use two different methods of translating the fiscal time characteristics to the
simulation calendar. When you have synchronized the dataset with SEM-BPS, please ensure that the
default fiscal time translation used is correct for your application. You find this on the Time
Translation property page in the
SEM Dataset view.
The table below summarizes the allowed combinations of fiscal time characteristics.
Locked Time
Characteristic
Time Interval
Characteristic
Unrestricted Time
Characteristic
0FISCVARNT
0FISCYEAR
0FISCVARNT
0FISCPER
0FISCPER3
0FISCVARNT
0FISCYEAR
0FISCPER3
Time Interval
Characteristic
Unrestricted Time
Characteristic
0CALDAY
0CALWEEK
0CALMONTH
0CALQUARTER
0CALYEAR
0CALYEAR
0CALMONTH2
0CALYEAR
0CALMONTH2
0CALYEAR
0CALQUART1
0CALYEAR
0CALQUART1
0CALYEAR
0HALFYEAR1
0CALYEAR
0HALFYEAR1
0CALWEEK
0WEEKDAY1
0CALWEEK
0WEEKDAY1
- 425 -
- 426 -
001.2003, the simulation time 1 August 2002 will be mapped to 002.2003, and so on.
Note! When you select this translation method, Studio will analyze the time characteristic and
suggest parameters for you. In most cases, these default values will be appropriate for most
purposes. You should review them and only change them once you're certain they must be
changed.
If you select to translate the fiscal time characteristic by fiscal periods, you specify the starting time of
the first period and the ending time of the last period in the data source. You must then mark all the
special periods for the data source manually. It is a requirement that the entire time scope of the
dataset is known in the dataset definition if you are going to use this translation method. Thus, if the
time characteristics are restricted in the planning package, the planning package must be specified in
the dataset definition.
Independently of the translation method selected, you can always change the parameters of the
selected translation method on the Time Translation property page, for the SEM Dataset definition.
To open this property page, right-click the Dataset node in the
SEM Dataset view, and select
Properties on the shortcut menu.
Times in the Co-models View
When you have created a dataset connection, the times are mapped, and you can view the reporting
times of the dataset connection on the Times property page, available when you right-click the dataset
connection and select
Properties on the shortcut menu.
- 427 -
the first dimension, the second as the second dimension, and so on.
Note! When you restrict a characteristics to a range in the SAP SEM-BPS system, you must
ensure that it is restricted to a continuous subrange of the available values for the
characteristic. This is similar to defining subranges in Studio, where you can define subranges
from a range by selecting the first and the last range element, and the resulting subrange will
contain all the elements between the start and end element.
Alternatively, you can use the ranges as version ranges, in which case the range will affect the data
source of the simulation rather than the dimension of the model variable. If a dimension is used as a
version, you must explicitly select what version to simulate on. You do this in the Connection
property page of the dataset connection in the
Co-models view under the simulation, or in the
External Data Details dialog box.
Units
When the dataset is synchronized with SEM, the unit definitions that are available in SEM-BPS and
that are not already present in the simulation project, will be automatically created in
Global Units.
All used units are imported as global units, and will be available for all the components in the project.
Note! All imported units will be defined as ATOMIC in Global Units, even if an imported unit
may be an SI unit. Studio has no means of detecting whether this is the case or not. If so, it is
recommended that you add the unit before making the connection to SEM-BPS.
The
SEM Dataset requires that all units used in the simulation must be restricted to a single value.
In addition to the units included as characteristics in the planning level, a single variable can also have
a unit definition attached to it. These units will also be added to the system as global units.
The Units property page of the SEM Dataset allows you to inspect the unit definitions that are present
in the planning level. The information available includes the units name, technical name, definition,
description, and whether or not it is a currency unit. The property page is available by right-clicking
the Dataset node in the
SEM Dataset view, and selecting
Properties on the shortcut menu.
- 428 -
Operation
Connection
Required
Yes
Synchronizing dataset
Yes
Yes
Yes
Changing versions
Yes
Yes
No
No
Running simulation
No
Note! When you run a simulation, all the dataset variables with the transfer direction set to in
will be reset when you reset the simulation.
SEM Dataset Offline: You are not logged on to the SAP SEM-BPS system, and no data is
currently transferred (obviously).
SEM Dataset Online: You are logged in to the SAP SEM-BPS system, but no data is currently
being transferred.
SEM Dataset Active: You are logged in to the SAP SEM-BPS system, and data is being
transferred.
When the icon is visible in the system tray, you can right-click it and control the connection status of
the
SEM Dataset on the shortcut menu. You may also define a time-out interval, allowing Studio
to automatically log off the SAP system when the specified time has elapsed.
- 429 -
- 430 -
currencies, must be restricted to a single value either in the planning level or in the planning package.
Planning Level Checklist
Include the key figures you wish to make available to the SEM Dataset(s).
Include the time characteristics you wish to use.
Include the characterstics you wish to use as ranges in the simulation project.
Include other required characteristics, such as units and currencies. These
characteristics must be restricted to a single value either in the planning level or in the
planning package.
You may restrict the characteristics that are to be used as dimension ranges in the
simulation model. Only restrictions containing a continuous subset of elements are
allowed.
Characteristics that are to be used as version ranges in the simulation model must be
defined as Selected in Package.
Superior characteristics must be restricted to a single-value.
You may restrict the characteristics used as dimensions and versions that are not already
restricted in the planning level. Only restrictions containing a continuous subset of
elements are allowed.
Other characteristics, such as units and currencies, that are not already restricted in the
planning level, must be restricted to a single-value in the planning package.
You may restrict time characteristics in the planning package, provided they match the
requirements for time characteristics mapping to simulation time.
- 431 -
Header Area
Locked time characteristics (restricted to a single value)
Unit and currency characteristics (restricted to a single value)
Superior characteristics (restricted to a single value)
- 432 -
SEM Dataset.
1. Create a new
SEM Dataset in the
Project Window. When you have created the dataset, open
its view by double-clicking it.
2. Right-click the Dataset node, and select
SEM Connection on the shortcut menu.
3. In the SEM Connection dialog box, specify the planning area, planning level, and planning layout
you wish to connect to. The planning package may also be specified on the dataset definition. If
your simulation must access different packages, however, you should set the package on each
dataset connection individually instead. You are also allowed to set the package to use when
loading and saving data from the simulation (unless it is locked in the dataset connection or
defined directly in the dataset definition). Click OK to accept the connection details.
4. The
SEM Dataset will load the available characteristics and key figures from SEM-BPS.
Studio will automatically generate dataset variables for the key figures, global ranges for
dimension range characteristics, and global units for unit and currency characteristics. You can
inspect the available characteristics in the Characteristics property page of the
SEM Dataset.
5. If the planning level you are connecting to contains a fiscal time characteristic, a translation
method is automatically set up for the dataset. In most cases, the automatic interpretation of the
fiscal calendar schemes will be good, but please ensure that the translation settings are correct
before running a simulation. The settings are available in the Time Translation property page for
the
SEM Dataset.
6. You can control the order in which dimension ranges will appear in the dataset variable definitions
by sorting the order of the available ranges in the Characteristics property page of the
SEM
Dataset.
7. You can now verify that the dimension ranges have been created in
Global Ranges and units
have been created in
Global Units.
8. To connect the dataset to the simulation, you must open the
Co-models view of the respective
simulation.
9. Right-click inside the Co-models view, and select Create Dataset Connection on the shortcut
menu. Select the newly created SEM Dataset on the submenu to create a dataset connection.
10. Make sure that the interface variables of your simulation have corresponding unit, dimension, and
transfer directions, and connect them to the dataset connection.
11. If the dataset connection needs package and version information, right-click the dataset
connection, and select
Properties on the shortcut menu.
12. On the Connection property page, you can set the package to work on by entering the technical
name of the package in the Package text box. You can also click Change and specify the
package in the SEM Connection dialog box.
13. You can also select an element for each version range in the dataset. Select the row containing the
- 433 -
14.
15.
16.
17.
version range, and click on the element field to open a drop down list where you can select
between the available versions.
You can lock both the package and the version by selecting the Lock options for each. If the
package and/or version is locked, it cannot be changed when you access the
Load External
Data or
Save External Data dialog boxes. Click Apply (or OK) to apply the changes.
Once the complete connection details (including package and versions) are set, you can load data
to the dataset connection. Right-click the dataset connection and select Load Data on the shortcut
menu, or select
External Data on the Simulation Menu, and select
Load (this
command will only be available if you have connected variables to the dataset connection).
You can now run the simulation.
You can save simulation data back to SEM-BPS at any time you wish (you can run as many
simulation runs as you wish without saving data). Right-click the dataset connection and select
Save Data on the shortcut menu, or select
External Data on the Simulation Menu, and
select
Save (this command will only be available if there are unsaved information in the
dataset).
SEM Dataset.
The SEM Dataset will be updated with the latest changes from the SEM-BPS system. You can create
new dataset variables for key figures, and characteristics will be updated.
- 434 -
data will be automatically loaded from SEM when you first create the dataset connection. Otherwise,
if a package isn't selected or a version is required for the data to load, you control when data are
loaded and saved between Studio and SEM manually by using the commands available under
External Data.
To load (or save) data for a
SEM Dataset,
If the package is specified in the dataset definition, it cannot be changed in the dataset connection or
when loading or saving external data.
If the package is specified in the dataset connection, it is available for selection when loading or
saving external data, provided it has not been locked in the dataset connection.
To set a package for a dataset connection:
1. Right-click the Connection of SEM Dataset in the
Co-models view, and select
Properties on the shortcut menu.
2. Specify the package to use for the dataset connection in the Details property page.
3. Click Apply to save the changes, or OK to save the changes and close the dialog box.
To lock the package for a dataset connection:
1. Right-click the Connection of SEM Dataset in the
Co-models view, and select
Properties on the shortcut menu.
2. Select the Lock option under the package name in the Details Property page.
3. Click Apply to save the changes, or OK to save the changes and close the dialog box.
- 435 -
The version is available for selection when loading or saving external data, provided it has not been
locked in the dataset connection.
To set (and lock) a version for a dataset connection:
1. Right-click the Connection of SEM Dataset in the
Co-models view, and select
Properties on the shortcut menu.
2. Select the version you wish to use in the Version column for the various available version ranges.
3. To lock the selected version element, select the corresponding lock option in the list.
4. Repeat the last two steps for all the version ranges (otherwise you will not be able to save or load
data).
5. Click Apply to save the changes, or OK to save the changes and close the dialog box.
- 436 -
External Data
Thus, to allow the user to specify the package when loading or saving data to and from SEM, leave
the package field empty in the dataset definition, specify the default package in the dataset
connection, and leave the field unlocked.
Specifying the version
The version that the
SEM Dataset uses when writing or reading data to or from SEM can be
specified in two different ways.
Thus, to allow the user to specify the version when loading or saving data to and from SEM, specify
the default version in the dataset connection, and leave the field unlocked.
- 437 -
A Simulator Browser
The Presentation Mode can best be described as a "simulation browser", where the user is allowed to
browse and play through your simulation in a way specified by you. The Presentation Mode itself is a
single-document interface (SDI) where the Project Window, Details Window, and all other
simulation-oriented development aids have been removed. There is only one toolbar available; the
- 438 -
Presentation Toolbar. The toolbar contains browser-buttons like the ones we know from web
browsers, which allow you to navigate in the simulator. The picture below shows how a simple
simulator interface might look when viewed in Presentation Mode.
By using controls, frames, freeforms, hyperlinks and bookmarks, you can create an attractive user
interface on top of your simulation. Studio also allows you to customize both the icon and caption
used for the Presentation Mode, should you wish to.
Tip! You can utilize the strong capabilities available in the Hyperlink and Bookmark objects to
further increase the functionality of your simulation interface. In addition to provide interdiagram jumping, the Hyperlink object may also be used to launch external files, visit web
pages, send e-mail messages, etc.
- 439 -
Authoring can be opened using the Executive edition. Using the Enterprise edition and then
distributing the simulator using the Executive edition, is a convenient way of sharing your simulator
with others.
The Executive version will always start up in dedicated Presentation Mode, as described above.
User Interface: Use hyperlinks, bookmarks, and controls to create user interfaces for your
simulator. A carefully designed user interface makes it easy for the user to browse the simulation
using the browser capabilities available in Presentation Mode. Using index variables to index
parameters in controls is an elegant way of simplifying the user interface.
Use Reference Runs: Reference runs that can be displayed alongside the current simulation
results enable your users to quickly see the effects of changes compared to the known scenarios.
Remember to make all reference runs that are going to be visible in Presentation Mode public.
Reference runs can also be loaded from files (*.sir) that are previously saved in Studio (not in
Presentation Mode).
Create Flexible Models: Make sure that your controls can cope with the results produced by the
simulation. Restricting the input range and making sure the controls can automatically scale
themselves will avoid the user to create scenarios where the data exceeds the scaling of value axis
and table cells.
Utilize Multiple Simulations: Powersim Studio allows you to create several simulations for each
component. Each simulation can contain its own simulation settings, enabling the various
simulations to display different scenarios and time horizons. By using private diagrams, you can
also create customized user interfaces for each simulation. This allows you to create simulators
that are tailored to different user groups and decision scenarios but still have only one model
source. By creating a simulator home page you can easily create links that jump to various
diagrams within different simulations. Make sure, however, that you do not implement hyperlinks
that makes the user jump inadvertently from one simulation to another!
- 440 -
Use Game Files: Games files (*.sig) allows you to save a simulation game. When you doubleclick the file, it will open the simulator in Studio's Presentation Mode, and load the state of the
simulation at the time it was saved. A game file contains a "snapshot" of the simulator (and all its
simulations) at the time when the game was saved. The user may save in the middle of the
simulation, and opening the file again to start at that particular time and state. Game files can also
be used to share interesting simulation runs between several users.
Implement Dedicated Simulator Help: You can create your own help system that will open
when the user clicks
Help in the toolbar. Create the help system in HTML files in the same
folder as your simulation project (like a miniature web site), and name the starting page by the
same file name as your simulation project (except the file extension, obviously). When the user
clicks
Help, the "help web" will be automatically opened in the default HTML browser selected
for the system.
Add a Simulator Title and Icon: You can add a customized title for your simulation under
Project Settings on the Project menu. You can also specify an icon to replace the default
Powersim Studio icon in the titlebar. An icon must be saved as an icon file (*.ico) on your system.
Remember to include it with your simulator when you distribute it!
Distribute your Simulator in Studio Executive: If you create your simulator in an Enterprise
version of Studio, you can distribute the simulator using Powersim Studio Executive. This is a
specialized simulation player provided by Powersim. The simulation will always be opened in
Presentation Mode when running this version.
- 441 -
If the simulation project is protected against edit access, you must enter the correct password to
unlock the project.
Note! The
Presentation Mode button is only available if you started Powersim Studio in
Design Mode. If you launch a simulator by double-clicking a file which starts directly in
Presentation Mode, the button will not be available to the user.
- 442 -
navigation means for your users to take advantage of. By using hyperlinks and bookmarks, you build
a structure of your simulator in much the same way as implementing web pages. When the user has
visited one bookmark, the Presentation Mode's browser buttons
Back and
Forward will be
activated, allowing your users to navigate back and forward through their browser history. This works
exactly as you would expect in web browsers.
You can use frames with text and pictures to explain and illustrate your simulation to your users.
You can add a html-file with the same name as your project in the same folder.
Example: If your project is named MyProject.sip, you should place a file named MyProject.htm in
the same folder. Note that this file can be the homepage of your documentation set, and link to
other pages as you find necessary. The html file will be opened in the default browser when the
user clicks
Help.
You can use the Hyperlink object in Studio to link your simulation project to html files (or other
files containing the documentation) on the computer or on the web.
- 443 -
3. Click OK.
Forward
The Back and Forward buttons let you navigate through your browsing history in the same way as
similar buttons in a web browser. By clicking the small arrow next to Back, a list of the most
recently visited windows will be displayed.
- 444 -
Home
Brings you back to the default window of the simulator (as specified in the Presentation Mode Setup
property page).
Reset, Play, Play Stepwise
Identical to the buttons on the Simulation toolbar, these commands let you reset the simulation, play
and stop it, and play stepwise.
Reference Data
Allows you to select reference data to be presented in controls.
Presentation Mode
Switch off Presentation Mode and return to Design Mode of the simulation project. If the project is
protected, you must enter the correct password to unlock the project.
Zoom
Allows you to zoom the current view in or out.
Advanced Commands
The button opens a submenu where you can work with cue points, restore permanent variables,
autoscale, and work with external data.
Help
Launches the project documentation, if one exists. Otherwise, a generic help for Presentation Mode
will be launched.
- 445 -
(a) The variable is named 'Inventory' in English (United States). (b) Since there is no name for the
variable in German (Germany), the English name is used with a prefix of '_ENU_' when the language
is changed to German (Germany). (c) By editing the name again, a German name for the variable is
added to the simulation project.
Tip! You can hide the language prefix from the diagrams if you wish to, by deselecting
language prefix on the View menu.
When you load a simulation project, Studio will automatically select a language for your project.
Language Groups and Common Namespaces
All the languages of the same "family" belong to the same language group, such as English (United
States), English (United Kingdom), and English (Jamaica). All the languages belonging to the same
language group share the same namespace in Studio. This means that within one language group, the
same name can only be used to identify one unique variable. Thus, if a string is already used in one
language of a language group, it cannot be used in any of the other languages of that language group,
unless you are using it as the name for the same variable. However, a variable can obviously have two
different names in two different languages of the same language group.
The table below shows a simple example, where four variables are named in two different languages.
The first row of the table displays the original model (created in English (United Kingdom)), and the
- 446 -
next two rows displays two different suggestions of names in English (United States). The ones that
are not accepted by Studio are written in red text.
Language
English
(United
Kingdom)
First
Second
Variable Variable
Name
Name
Third
Variable
Name
Fourth
Variable
Name
Comment
Sales
Behaviour Chips
Crisps
Sales
Behavior
'French Fries'
Chips
Sales
Behavior
'French Fries'
Salg
Adferd
English
(United
States)
English
(United
States)
Norwegian
(Bokml)
- 447 -
5. If all the languages in the project share the same primary language ID (for example English), the
language with the lowest sublanguage ID will be selected.
6. If all else fails, one of the existing languages will be selected.
The table below provides a few examples on how this automatic language selection works.
System Language Languages in Project Selected Language
English(US)
English(US)
English(UK)
English(US)
English(US)
Greek
Greek
English(US)
English(UK)
English(Australia)
German(Germany)
English(UK)
English(US)
German(Common)
German(Germany)
German(Germany)
German(Austria)
German(Luxembourg)
English(US)
German(Germany)
Greek
Norwegian(Bokmal)
Finnish
; (semicolon)
Decimal
. (punctuation)
Thousand , (comma)
- 448 -
- 449 -
prefixes will be displayed. This is very useful when you are translating your model, but it can be
annoying and tedious in some cases. You therefore have the ability in Studio to turn off the language
prefix.
Note! The language prefix will not be hidden in definitions (variable, unit, or range).
!
Select Language Prefix on the View menu to display language prefixes. A check mark will
appear in front of the option to indicate that the option is turned on. (The option is selected by
default.)
Deselect Language Prefix on the View menu to hide language prefixes. A check mark will
disappear to indicate that the option is turned off.
Note! The selection above only affects the prefix of strings viewed in diagrams. Language
prefixes will still be shown in variable definitions and in the Details Window and Equations
View. The selected language still influences decimal separators, list separators, currency
symbols, and other settings found in Regional Settings on your computer.
Translate a Project
The built-in language support in Powersim Studio makes it easy for you to translate your simulation
project to other languages. Below is a suggested procedure for translating your project.
Tip! It is recommended that you do all the development of your model in your own language to
avoid confusion, since decimal and list separators also follow the selected language.
1. Create a new window by selecting
New Window on the Window menu.
2. Arrange the windows in a practical way, either manually or by using the commands on the
Window menu.
3. Select the window where you will perform the translation, and select the new language for the
view by selecting Language on the View menu, click Select and then select the language you
wish to translate to. The texts will now appear with a prefix (if Language Prefix is not turned off)
to indicate that they do not exist on the currently selected language (provided that the project has
not been translated yet).
4. Translate the visible strings in the diagram by renaming them in their new language (select them
and start typing).
5. Hidden strings, such as documentation and notes for variables and units, must be translated in the
Properties dialog box (or in the
Equations View of
Details Window, if you prefer). To open
the Properties dialog box, double-click the objects, or right-click them, and select Properties on
the shortcut menu.
6. The various fields will be empty if a text doesn't exist in the selected language. Therefore, select
the object in the window showing the original language. If you want to, you can copy the text.
Switch to the new language window by selecting the identical object here, and write the translated
text.
7. Click Apply before selecting the original language again, or your changes will get lost.
8. Repeat the above steps for all objects in the diagram.
9. Controls, like the Time Graph and Table Controls, can be translated directly. Just enter the
translated texts in the same way as for the original controls.
10. To translate global and local units, open two windows each as described above, and translate them
in the Properties dialog box.
11. To translate global and local ranges, open two windows each as described above. The range
- 450 -
names can be translated directly in the view, while the range elements are translated in the
Rename Elements dialog box, available on the shortcut menu of the range itself.
Note! If you use the Language box available on the toolbar or on the Project menu, you will
change the language for the entire simulation project, and not only for the current view.
- 451 -
aux
aux
aux
aux
A
B
C
D
=
=
=
=
undefined
undefined
A + B
C / 10
// A is left undefined
// B is left undefined
Given the definitions above, we immediately conclude that both variables C and D are defined
properly, but they are both still undefined since variables A and B are undefined. Therefore, these two
variables are problematic variables for both C and D. By selecting C or D as the variable in the Go To
Variable dialog box and selecting the Problematic Variable(s) for Selected Variable option, Studio
- 452 -
C and D are still undefined, and searching for problematic variables will disclose B as the source of
the problem. Defining B rules out the problem, as displayed below.
aux A = 10<<m>>
aux B = 4<<m>>
- 453 -
3. Select the variable for which you wish to find the corresponding problematic variables, in Enter
Variable Name (or type the name manually). To display only undefined variables in the list, select
the Undefined option under Enter Variable Name.
4. Select the scope of the search under Look In (and under Scope, if you search in Diagrams).
5. Click Next to find the variable.
6. To find the next problematic variable for the selected variable, simply click F3 or click
Go to
Next Variable on the toolbar.
Tip! Hit Ctrl-G to open the Go To Variable dialog box, F3 to find the next variable, and
Go to Next Variable and
Shift-F3 to find the previous variable. You can also click
Go to Previous Variable on the toolbar.
Go to
Tip! Hit Ctrl-G to open the Go To Variable dialog box, F3 to find the next variable, and
Shift-F3 to find the previous variable.
- 454 -
Go To a Variable
1. Click
Go To Variable.
2. Select the name of the variable you wish to go to under Enter Variable Name combo box. You
can use the three available options under Filter to filter the variable selection available in the
combo box. If you select Undefined, only undefined variables will populate the list, and if you
select Problematic, you will only find problematic variables in the list.
3. You can search for the selected variable itself, for other variables that are defined by the selected
variable, or the variable's problematic variables under Go to what.. Select the option that best suits
your needs. You have three alternatives:
! Select Variable named to go to the variable itself;
! Select Variables defined by to go to variables that are defined by the selected variable;
! Select Problematic variables of to go to variables that cause problems for the definition of the
selected variable.
4. Select the scope of the search. You can search in diagrams, equations, or both. If you wish to
search in diagrams, you must also select whether you wish to search only the active diagram, the
selected diagrams, or if you would like to run the search in all the available diagrams.
5. Click Next (or Previous) to find a variable that matches your search.
6. Click
Go To Next Variable or hit F3 to find the next variable that matches your search.
7. Click
Go To Previous Variable or hit Shift-F3 to find the previous variable that matches
your search.
The located variable is highlighted.
Click
Go To Next Variable to search for the next variable that matches your search.
Hit F3 to search for the next variable that matches your search.
Click
Go To Previous Variable to search for the previous variable that matches your search.
Hit Shift-F3 to search for the previous variable that matches your search.
- 455 -
- 456 -
actions based on the input from the user. Using the return values you can allow the user to select
between several options and implement them by inserting actions below the return values, as
illustrated below.
The return values, in this case OnOK and OnCancel can be used to program various actions
depending on the user input.
Note! The return values will correspond to the type of message box you have selected. For a
Yes/No message box, the return values will be OnYes and OnNo, and so forth.
If you change the button combination for the message box, you might get different return values. If
the return values still exists for the altered message box, it will be used without any changes. If the
return value no longer exists and has actions, it will be marked by to indicate that the message box
will not return that value. This way the actions that were assigned to the return value are not lost if
you change the type of message box. The return value will of course never be executed, and you
should copy or move the actions to the appropriate return value where they belong.
The table below describes the properties of the Message Box Action.
Type
The button configuration of the message box you want to display. You can select
Description between the standard button configurations available in Windows. These are listed
below.
Abort, Retry, Ignore
OK
Options
OK, Cancel
Retry, Cancel
Yes, No
Yes, No, Cancel
Icon
The type of message box you want to display. You can select between the standard
Description message box types available in Windows. These are listed below together with the
icon that they feature.
<No Icon>
Error:
Options
Information:
Question:
Warning:
- 457 -
Title
Description The title of the message box.
Message Text
Description
The message (body) text of the message box. The message box will automatically
adjust to the size of the message text.
Set Parameter
The Set Parameter event allows you to change the value of a parameter in your model depending on a
whether a condition is met or not. The action is pretty straight-forward to use. Simply select the
variable you want to change, and enter the value you wish to change it to.
Tip! If you use the Set Parameter action in combination with the Message Box action, you can
control the value of a variable depending on the user input, as mentioned above (under
Message Box).
The table below describes the properties of the Set Parameter Action.
Parameter
Description The parameter you wish to change when the action is executed.
Value
Description The value you wish to assign to the parameter.
Hyperlink
The hyperlink allows you to jump to a bookmark, window, or another URL when the action is
executed. Defining the hyperlink action is more or less identical with defining the hyperlink diagram
object. You simply select the target of the hyperlink, and that's it.
Tip! You can use the hyperlink action to launch files, send e-mail, visit web pages, or go to a
different part of the simulation project.
The table below describes the properties of the Hyperlink Action.
Destination
Description The destination that will be activated when the action is executed.
Event Properties
When you create an event, you must also connect it to a variable containing the condition deciding
when the event is triggered. You can also specify how the simulation should behave when the event is
triggered. You can also disable the event. This is useful, as it allows you to prevent the event from
happening without having to delete the entire event or alternatively redefine it.
The table below describes the various properties of the event. You can access these properties in the
Event property page, available on the shortcut menu when right-clicking the event in the Events View.
- 458 -
Property
Description
Condition
Variable
The variable that the event "listens" to. This variable must be a LOGICAL
variable.
Trigger on
TRUE
The event will be triggered when the value of the selected variable becomes
TRUE. Note that the event will not be triggered again until the variable
becomes TRUE again, after being FALSE (or NAN). It will not be triggered
every time step, if the value of the variable doesn't change.
The event will be triggered when the value of the selected variable becomes
NAN. Note that the event will not be triggered again until the variable
Trigger on NAN
becomes NAN again, after being TRUE or FALSE. It will not be triggered
every time step, if the value of the variable doesn't change.
Simulation Control
Pause When
Condition
Becomes TRUE
The simulation will be paused when the condition becomes TRUE. You can
continue the simulation immediately.
This option disables the event, and gives you the opportunity to "turn off" an
event without deleting it.
Prevent Play
Message
The Prevent Play Message will appear if the user attempts to play the
simulation while the Condition is TRUE.
Add an Event
You can add an event to your simulation in the
Events View:
1. In the
Project Window, double-click
Events to open the
Events View.
2. Right-click inside the view, and select Add Event on the shortcut menu.
You then proceed to define the event on the property page, and add actions to it.
Define an Event
When you have added an event to the Events View, you can define it:
1. Right-click the event, and select
Properties on the shortcut menu.
2. In the Variable box, select the variable containing the condition that you want to connect the
- 459 -
3.
4.
5.
6.
event to.
Select whether the event should be triggered when the selected variable becomes TRUE or NAN.
Select the way that the event should handle the simulation. You can have the event stop the
simulation, prevent the simulation from playing as long as the condition is met, prevent the
simulation from playing while any actions are being executed, and have the simulation run again
once the event is finished. Note that you can combine the various simulation options.
If you choose to let the event prevent the simulation from playing while the condition is TRUE,
you should also enter a message that will be presented to the user if she tries to run the simulation
again. Enter this message under Prevent Play Message.
You can disable the event if you don't want it to be triggered when the condition is met. This
option is ideal when you want to stop the event from occuring but avoid deleting it from the
project.
Move Up.
Move Down.
- 460 -
Move Up.
Move Down.
Delete an Action
To delete an action:
1. Select the action you wish to delete in the Events view.
2. Right-click it and select Delete on the shortcut menu, or hit Del on your keyboard.
Delete an Event
To delete an event:
1. Select the event you wish to delete in the Events view.
2. Right-click it and select Delete on the shortcut menu, or hit Del on your keyboard.
Tip! It is possible to disable an event in the property page. This allows you to to keep unused
events in your project without triggering them every time the condition is met.
- 461 -
Description
mainmodel
A component in the simulation project. The variables are listed below the
component they belong to.
level
A level variable.
aux
An auxiliary variable.
model
A submodel variable.
A unit. If the unit appears inside a mainmodel entry, it is a local unit. If the unit
- 462 -
unit (or
autounit)
appears inside a level or aux entry, it represents the unit of the variable. If the
unit is automatically detected by Studio, the entry is named autounit.
range
type (or
autotype)
The data type of a variable. If the data type is automatically detected by Studio,
the entry is named autotype.
dim (or
autodim)
inflow
outflow
def
init
doc
note
- 463 -
tabs.
2. Click
Print on the File menu.
3. Select Diagram under Print What, and then select Selected Diagram(s).
4. Click OK to start printing and close the dialog box.
Tip! You can print diagrams and equations at the same time by selecting both.
Tip! If you click
previous settings.
Print on the Standard menu, you will print directly to the printer using the
Print Equations
1. Select
Print on the File menu.
2. Select Equations under Print What.
3. Click OK to start printing and close the dialog box.
You can print several copies by entering a number under Number of copies.
Tip! You can print diagrams and equations at the same time by selecting both.
Tip! If you click
previous settings.
Print on the Standard menu, you will print directly to the printer using the
- 464 -
On the File menu, click Page Setup, and then click the Page tab.
Under Scaling, click the Adjust to radio button.
Select or enter the percentage of normal size that you want your page to be.
Click OK to save the page setup.
On the File menu, click Page Setup, and then click the Page tab.
Under Scaling, click the Fit to radio button.
Enter the number of pages width and height of the printed diagrams.
Click OK to save the page setup.
- 465 -
www.powersim.com
Powersim Software AS
E-mail
powersim@powersim.no
Web
www.powersim.com