-
Notifications
You must be signed in to change notification settings - Fork 13
Generating the Input Files
This page describes the steps taken to generate input files for the model of pulse wave propagation, in order to use the model to simulate pulse waves. Having established in the literature review the normal ranges for each of the input parameters, the next step was to provide these as inputs to the computational model. This was performed by creating a set of text input files for each virtual subject, specifying the input parameters to be used to simulate that subject's pulse waves.
You will need the following in order to generate the input files:
- The file containing the arterial network geometry: pwdb_116_artery_model.txt (provided in the article's supplementary material).
- The Matlab ® script for calculating the input parameters for each of the virtual subjects in the database: calculate_pwdb_input_parameters.m
- The Matlab ® script for generating an aortic flow wave for given parameters (such as heart rate and stroke volume): AorticFlowWave.m
- The Matlab ® script for generating the input files: create_pwdb_input_files.m
- The Matlab ® script for generating input files for a particular simulation: create_input_files_for_a_simulation.m
- An installation of Matlab ®
If you do not have a Matlab ® installation, then you can still access the arterial network geometry data, which is in tab-delimited format.
The process of generating the input files consists of two tasks. Firstly, the input parameters for each virtual subject are calculated. Secondly, these input files for each virtual subject are created using these input parameters.
Take the following steps to calculate the input parameters:
- Open the calculate_pwdb_input_parameters.m script in Matlab ®.
- This script contains several functions. Navigate to the setup_up function, and adjust up.savefolder to the path of the directory where you would like the input parameters file to be saved.
- Adjust the database configuration, specified by up.db_config in the setup_up function, to your needs. the options are:
- pwdb: Generates the Pulse Wave Database, containing 4,374 virtual subjects, and representative of a sample of healthy adults.
- independent_variations: Generates a database of 258 virtual subjects, in which cardiovascular parameters were varied independently at each age, rather than in combination with each other. This is similar to the Preliminary Pulse Wave Database.
- initial_simulations: Generates a set of 21 virtual subjects, each aged 25 years, in which 10 input parameters were each varied independently by ± 1 SD from their mean values.
- baseline_subject: a single virtual subject: the baseline 25-year old subject.
- baseline_subjects_at_each_age: 6 virtual subjects, the baseline subjects at each age: 25, 35, 45, 55, 65 and 75 years old.
- Run the script using the following command:
[parameters] = calculate_pwdb_input_parameters;
- This will produce a variable in the Matlab ® Workspace named parameters. This contains the input parameters required to generate Nektar1D input files for each of the virtual subjects.
Take the following steps to generate the input files:
- Open the create_pwdb_input_files.m script in Matlab ®.
- This script contains several functions. Navigate to the setup_up function, and adjust up.paths.savefolder to the path of the directory where the input parameters file (named inputs.mat) was saved by calculate_pwdb_input_parameters.
- Also in setup_up, change the paths of the folders where temporary files are to be stored whilst running the simulations. These are designed to allow the Nektar1D simulations to be run on a separate computer (i.e. a virtual computer) from that running Matlab. If the simulations are to be run on the same computer as Matlab then simply make up.paths.Matlab_computer_shared_folder the same as up.paths.Nektar_computer_shared_folder.
- Also in setup_up, change the number of launch files (specified by up.no_launch_files) to reflect the number of cores to be used to run the simulations. If in doubt, set this to 1.
- Run the script using the following command:
create_pwdb_input_files
This will produce: (i) a set of input files which can be used to run Nektar1D simulations; and (ii) files specifying shell script commands, which can be used to run the simulations. They are saved to the directory specified by up.paths.Matlab_computer_shared_folder.
Part of the wider Pulse Wave Database Project