Skip to content

Extracting Simulation Data

Peter Charlton edited this page Feb 8, 2019 · 15 revisions

Extracting Simulation Data

Introduction

This page describes the steps taken to extract simulation data from the text files produced by the simulations. Data were extracted by importing them into Matlab ®, and then saving them in a Matlab ® file called collated_data.

Requirements

You will need the following in order to extract the simulation data:

  • The files produced by the simulations, which should be stored in the shared folder (as described in the previous step).
  • The Matlab ® script for extracting the simulation data: extract_pwdb_simulation_data.m
  • The Matlab ® script for setting the paths for post-processing: setup_paths_for_post_processing
  • The Matlab ® script for importing History (.his) file data into Matalb ®: ConvertHistoryFiles.m
  • An installation of Matlab ®

Steps

The process of extracting the simulation data is performed by running extract_pwdb_simulation_data.m. To use this script:

  1. Open the setup_paths_for_post_processing.m, and adjust: (i) PATHS.shared_folder to the path of the shared folder; and (ii) PATHS.storage_folder to the path of a folder in which to store the outputs.
  2. Open the extract_pwdb_simulation_data.m script in Matlab ® .
  3. Run the extract_pwdb_simulation_data.m script.

The extract_pwdb_simulation_data.m script performs the following steps:

Copying simulation files from the shared folder

The CopyFiles function checks to see whether there are any files in the shared folder.

  • If there are files in the shared folder, then the script assumes that these are simulation files which haven't yet been extracted. In this case, it copies all the files into a new subfolder within the shared folder. This subfolder is named pwdb_#, where # is the number assigned to this pulse wave database. This will be 1 unless simulation files have previously been copied across, in which case the pwdb is named using the next number available.
  • If there aren't files in the shared folder, then the script assumes that files have already been copied across, and it continues for the most recent pwdb (i.e. the one with the highest number).

Importing pulse wave data

The ConvertHistoryFiles function imports data from history (.his) and lumped parameter (.lum) files into Matlab ® format. These data include the simulated pulse waves.

Importing arterial system characteristics data

The import_system_chars function imports arterial system characteristics data from period-averaged data (_period.tex) files (such as total compliance, peripheral vascular resistance, and the systemic time constant).

Importing peripheral boundary conditions

The import_peripheral_boundarys function imports the characteristics of the peripheral Windkessel models from the input (.mat) files.

Collating input and output data

The collate_input_and_output_data function collates the data (now in Matlab ® format) from: (i) input (.mat) files; and (ii) output - history (.his), lumped parameter (.lum), and period-averaged data (_period.tex) - files. These data include the simulated pulse waves. It also estimates PPG pulse waves from the simulated waves.

Clone this wiki locally