PreqPMoB (Predefined Requirements-based Physical Model Builder) is a Python implementation for constructing physical models by combining equations extracted from scientific literature. The method ensures compliance with four predefined requirements to build accurate, consistent, and solvable models. This repository accompanies the paper: "Automated Physical Model Building from Literature Sources: Combining Equations Based on Four Predefined Requirements."
- Automates the process of constructing physical models from equations.
- Supports handling complex and noisy datasets.
- Ensures models meet the following predefined requirements:
- Required Variables Inclusion
- Degrees of Freedom Consistency
- Solvability
- Unique Constant Equations
- Provides efficient and flexible algorithms, including the Refined Gradual Method.
Ensure you have the following installed:
- Python 3.10.15 or higher
- Required Python libraries (listed in
pyproject.toml
)
-
Clone the repository:
git clone https://github.com/humansys-lab/PreqPMoB.git cd PreqPMoB
-
Install dependencies:
poetry install
- Prepare your input equations, defining input and output variables. The case studies in the paper can be generated using
notebooks/generate_case_study_datasets.ipynb
. - Run
experiments/run_experiments.py
to validate the method on the case studies. If you want to run more than one time, you can use the scriptexperiments/run_experiments.sh
. - Analyze and validate the constructed models by running
experiments/analyze_results.py
.
You can also use your own file to perform the model building process.
Note that the input file must be in JSON format and follow the structure below:
{
"name": "case_study_name",
"variables": {
"input_variables": ["input_var1", "input_var2"],
"output_variables": ["output_var1", "output_var2"]
},
"equations": [
{
"equation": "equation1",
"variables": ["var1", "var2"]
},
{
"equation": "equation2",
"variables": ["var3", "var4"]
}
],
"correct_models": [
{
"equations": [
"equation1",
"equation2"
],
"variables": [
"var1",
"var2",
"var3",
"var4"
]
}
]
}
If the file includes the correct models, the method will validate the constructed models against them.
data
: Datasets used in the experiments.preq_pmob
: Core implementation of the PreqPMoB method.experiments
: Scripts for running experiments and analyzing results.notebooks
: Jupyter notebooks for generating case studies.results
: Results of the experiments.tests
: Unit tests for the library.
This project is licensed under the MIT License. See the LICENSE file for details.