# Files Generated by Sim Script

This section discusses how the Sim Script saves files to disk. Typically a Sim Script is created in a sub folder as a child script of a Fit Script or Gen Script.

Here we assume that the Sim Script was created by a Fit Script parent. Similar to the Fit Script described in Files Generated by Fit Script.

When a Sim Script is run, folders will be created on disk (within the same folder as the script) as follows:-

    _temp
    dense
    observed_data

Here ‘_temp’ is a folder used by PoPy to write temporary python functions and ‘dense’ contains the final plots.

‘observed_data’ is a solution folder that only contains original input data from the Sim Script, for example, as specified in the ‘input_data_file’ field:-

    FILE_PATHS:
        input_data_file: ..\gen\synthetic_data.csv

Here, the ‘observed_data’ folder contains a copy of the ‘synthetic_data.csv’ generated by the Gen Script. The other folders generated by the Sim Script are named after the solutions loaded in by the ‘solutions’ section of the Sim Script section, for example:-

    FILE_PATHS:
        solutions:
            initial: ..\fit\sol00\solution.pyml
            final: ..\fit\solN\solution.pyml

Therefore solution folders ‘initial’ and ‘final’ will be created and will contain simulated PK data using the original solution folders from the fit output above.

The Sim Script generates `s[X]` state values and noiseless `p[X]` predictions at regular, dense time intervals (1.0 hours). These files are also saved as comma separated value .csv files (one per individual) in:-

    initial/
        pred_1.csv
        ...
        pred_50.csv
        sx_1.csv
        ...
        sx_50.csv

And similarly in the ‘final’ solution folder. Here the Sim Script is effectively re-creating the original initial `f[X]` solution and final `f[X]` solution, but sampling more time points, to generate smoother PK curves.

The sim script also outputs a Grph Script that plots the ‘initial’, ‘final’ and ‘observed_data’ solutions on one graph, with one plot per individual in the ‘dense’ folder:-

    dense/
        DV_CENTRAL,DV_CENTRAL,DV_CENTRAL_wrt_TIME_spag_graphs/
            000000.svg
            ...
            000049.svg