Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Running and Saving music Simulations

Simulation Mode: Manual vs. Auto-Run

music can be run in two modes: Auto Run or Manual. To switch between modes, go to the 'Settings' tabs and set Auto Run Models to on (green) or off (red). In Auto Run mode, music will automatically re-run the simulation, any time a change is made to the Catchment (for example, a new Node is added, or the properties of a Source Node or Treatment Node are changed). This allows you to see the results of your changes instantly, but it can be very time-consuming, particularly for complex simulations over long durations.

 

In manual mode (Auto Run turned off), you simply press the Run Catchment Models Button ( or press F5) to run the simulation, when required.

music starts automatically in manual mode (Auto Run turned off). Whether you wish to leave Auto Run turned off depends on the complexity, timestep and duration of simulation you are running, your computer’s speed, and your need to see the results of changes ‘on the fly’.

 

The following table summarises the advantages and disadvantages of running music in Auto Run or Manual mode.

 

 

Manual (Auto Run OFF)

Automatic (Auto Run ON)

Advantages

Faster operation, particularly for Catchments with many nodes, small timesteps, or long durations
Smooth and efficient construction of model
Immediate simulation of nodes creation or modification ‘on the fly’
Automatic updating of output screens (graphs, statistics tables, etc) when a node is modified
Detection of ‘mistakes’ more likely (results immediately shown)
Allows informal ‘what if?’ playing

Disadvantages

Results of modifications to the catchment file (such as modifying the specifications of a treatment node) are not immediately visible
Output display (graphs and statistics tables) will disappear if modifications to the catchment are made (since results of the previous simulation no longer apply)
Mistakes made in specifying node parameters may be more difficult to identify
Operation will be slower and less efficient, particularly for complex models with many nodes, small timesteps, and a long duration

 

Tip Box

In most cases (except for very simple simulations), it is recommended that you construct your simulation with Auto Run turned OFF, and manually run the simulation when required.

 

Running music from the Command Line

Normally music will be run via the main Graphical User Interface. However, music can also be run in command line mode. This will allow you to run music in batch mode or use music with other third party software (such as optimisation software).

 

To use the command line version of music, the following syntax must be used at the command prompt:

 

"music executable" "music project file" "music configuration file" -light -silent

 

 

Where:

music executable is the full path to the music.exe. For example: "C:\Program Files (x86)\eWater\MUSIC 5 SL\MUSIC.exe"
music project file is the full path of the SQZ or MSF/CSV file that you would like to run in music. For example: "C:\MUSIC_Temp\Test_Project.msf"
music configuration file is the full path of the configuration file that is used to define what output will be extracted from music and where they outputs will be written to (further information on the configuration file is provided below). For example: "C:\MUSIC_Temp\ConfigFile.mcf"

 

Note that you must use the "-light" command parameter otherwise the GUI version of music will open.

 

The "-silent" command parameter is optional. If this parameter is not included, any errors that are encountered during model execution will be displayed via a message box (this will stop model execution). If the "-silent" parameter is included, the message boxes will be suppressed and any errors will be written to a log file and model execution will continue.

 

The command line version of music allows the following outputs to be extracted for any node and written to a text file:

Time series (TS);
Mean Annual Loads (MAL);
Treatment Train Effectiveness (TTE);
Node Water Balance (NWB);
Statistics (Stats);
Life Cycle Costs (LCC);

 

The outputs that are to be extracted and where the outputs will be written to are defined in a music configuration file (*.mcf). The following provides a sample MCF file including a summary of all available commands (this text can be copied and pasted to serve as a template for your own MCF file). This particular MCF file is setup to export treatment train effectiveness for a "Wetland" node, TN outflow concentration time series for a node called "Pond #1" and life cycle costs for a bioretention node:

 

! ========================================================================================        

! Comments are prefixed by a "!" symbol        

! Comments can be inserted anywhere throughout the file        

! Blank lines can also be used throughout the file to improve readability

! ========================================================================================        

 Version = 100

! ========================================================================================        

 Delimiter = #44

! Any text character or ASCII code character can be used to define delimiter that is used in text output files.

! If no delimiter is specified, a comma will be used.

! Commonly used delimiters include (in ASCII code format) : Tab = #9, Space = #32, Comma = #44

 

! ========================================================================================        

! Command Summary        

! ----------------------------------------------------------------------------------------        

!  Available Commands

! ----------------------------------------------------------------------------------------

!  Time series output = Export_TS ( Node ID : integer or string , OutputType: string, Filename : string)

!     {Node ID can be the node ID reported in MSF file or a unique node name}        

!     {Refer to "Available Output Types" below for output type keywords.}

!     {FileName can be absolute path or relative to the configuration file directory. Any non-defined directories will be created.}

!     {Warning: Any existing files will be over-written.}

!  Mean Annual Loads Output = Export_MAL ( Node ID : integer or string , Filename : string)        

!  Treatment Train Effectiveness Output = Export_TTE ( Node ID : integer or string , Filename : string)        

!  Node Water Balance Output  = Export_NWB ( Node ID : integer or string , Filename : string)        

!  Statistics Output  = Export_Stats ( Node ID : integer or string , Constituent: string , Filename : string)

!     {Refer to "Available Constituents" below for constituent keywords}

!  Life Cycle Cost Output = Export_LCC ( Node ID : integer or string ," Cost Estimator :  String ;

!                                       Include Maintenance In Final Year : Boolean ; Include Establishment Cost : Boolean ;

!                                       Establishment Cost Factor : Float ; Establishment Cost Start Year :  Integer :

!                                       Establishment Period : Integer ; Renewal Period : Integer ", Filename : string)

!    {Refer to "Available Cost Estimators" below for cost estimator keywords}

!

! ----------------------------------------------------------------------------------------

!  Available Output/Constituent Types

! ----------------------------------------------------------------------------------------

!  Available Output Types = Inflow; InflowTSSConc; InflowTPConc; InflowTNConc; InflowTSSLoad; InflowTPLoad;

!                                       InflowTNLoad; InflowGPLoad; OutFlow; OutFlowTSSConc; OutFlowTPConc; OutFlowTNConc;

!                                OutFlowTSSLoad; OutFlowTPLoad; OutFlowTNLoad; OutFlowGPLoad

!  Multiple Output Types can be used by seperating with semi-colons. For example: "Inflow; Outflow; InflowTSSConc"

!

!  Available Constituents = Flow; TSSconc; TSSlog; TPconc ; TPlog; TNconc; TNlog; TSSload; TPload; TNload; GP

!  Multiple Constituents can be used by separating with semi-colons. For example: "Flow; TSSConc; GP"

!

! Available Cost Estimators  = Expected, Lower, Upper

!

! ========================================================================================        

! Commands        

! ========================================================================================        

 Export_TTE(Wetland,"Wetland_TTE.txt")

 Export_TS (Pond #1 , OutFlowTNConc, "C:\MUSIC\Wetland_TTE.txt")

 Export_LCC(Bioretention,"Expected;True;True;0.5;1;2;10","TempOutput/Bioretention.LCC")

 

! NOTE: any error during execution will be written to *.log file.

! Please refer to this to ensure successful application of music command line

! ========================================================================================        

 

As indicated above, comments can be inserted in the MCF file by prefixing it with a "!" symbol. Blank lines can also be inserted in the MCF file to improve readability.

 

In the event of an unsuccessful command line simulation, a *.log file will be created and a brief description of the cause for the simulation failure will be written to this file.

 

Also note that if music split flows is activated in a music model, some outputs may not be available for all nodes.

 

Saving music Files

Whenever you run a simulation, music will prompt you to save the file; it is a good idea to do so, to reduce the risk of losing the model in the event of a system hang.

 

music has two primary file types:

  • music data files (.sqz): saves model setup (and its attached meteorological template), but not simulation results - file size generally < 500kb.
  • music data files with results (.sqr):  saves the full model setup and all simulation results - file size may be very large, depending on model complexity, timestep and period of meteorological template.
  •  

    It is generally advisable to save as .sqz files (to save disk space), but the model will need to be re-run upon opening (this takes no longer, and often less time, than opening the full file with all simulation results!!).

     

    However, in some instances, you may wish to save the simulation with all attached results, so that the exact simulation is preserved when you next open (particularly where you are using stochastic simulation of pollutant time-series, when results from subsequent simulations may vary slightly).

     

    music can import and/or open files created by earlier versions of music, BUT if you want to open them again using an earlier version of music, you must use "Save As" to save them with a different name (leaving the original file unchanged).

     

    Tip Box

    Use the "Save As" function to save old music Version 3 or earlier files with a different name, so that the original files can be opened again in music Version 3 or earlier, if required.

    • No labels