This case study demonstrates how Ascoos OS can be used for technical computations in engineering applications. It calculates force using Newton’s Second Law, stores the result in a JSON file, and logs system events.
This example highlights the use of the following Ascoos OS components:
- TMathsHandler: Performs force calculations using mathematical operations.
- TFilesHandler: Stores results and checks quota limits.
- TEventHandler: Logs force calculation events.
- TCoreSystemHandler: Monitors CPU load and logs system status.
The case study is implemented in a single PHP file:
engineering_forces.php: Includes calculation, storage, and logging.
- Ensure Ascoos OS is installed (main repository).
- Write permissions for
$AOS_LOGS_PATHand$AOS_TMP_DATA_PATH/ascoos_data/engineering/. - Global variables (
$conf,$AOS_TMP_DATA_PATH,$AOS_LOGS_PATH) are automatically set by Ascoos OS. - The
phpBCL8library is preinstalled and auto-loaded.
- Run the script via a web server:
https://localhost/aos/examples/case-studies/engineering/forces/engineering_forces.php
$mass = 100.0; // kg
$acceleration = 9.81; // m/s^2
$force = $maths->power($mass * $acceleration, 1); // F = m * aThe script generates a JSON file with the calculated force. Example output:
{
"structure_id": "STR001",
"force": 981,
"timestamp": "2025-08-18T15:21:00+03:00"
}Want to contribute to this case study? Fork the repository, modify or extend engineering_forces.php, and submit a pull request. See CONTRIBUTING.md for guidelines.
This case study is licensed under the Ascoos General License (AGL). See LICENSE.