-
Notifications
You must be signed in to change notification settings - Fork 1
Chpater59 sfpe #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Chpater59 sfpe #65
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||||||||||||||
| pub mod equation_59_10; | ||||||||||||||||||
| pub mod equation_59_11; | ||||||||||||||||||
| pub mod equation_59_5; | ||||||||||||||||||
| pub mod equation_59_6; | ||||||||||||||||||
| pub mod equation_59_7; | ||||||||||||||||||
| pub mod equation_59_8; | ||||||||||||||||||
| pub mod equation_59_9; | ||||||||||||||||||
|
|
||||||||||||||||||
| use pyo3::prelude::*; | ||||||||||||||||||
| use pyo3::wrap_pymodule; | ||||||||||||||||||
|
|
||||||||||||||||||
| #[pymodule] | ||||||||||||||||||
| /// Chapter 59 - Placeholder equations. | ||||||||||||||||||
| /// | ||||||||||||||||||
| /// This chapter contains placeholder equations that will be implemented. | ||||||||||||||||||
|
Comment on lines
+13
to
+15
|
||||||||||||||||||
| /// Chapter 59 - Placeholder equations. | |
| /// | |
| /// This chapter contains placeholder equations that will be implemented. | |
| /// Chapter 59 - Hydraulic egress flow model. | |
| /// | |
| /// This chapter exposes equations for the hydraulic model of occupant flow | |
| /// (Equations 59.5–59.9). Equations 59.10 and 59.11 are currently provided | |
| /// as placeholders and may not be fully implemented. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use pyo3::prelude::*; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #[pyfunction] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Placeholder for equation 59.10. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// This function is a placeholder and will be implemented with the actual | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// equation logic. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// .. math:: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// \text{TODO: Add equation} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// where: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// - TODO: Add variable definitions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Args: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// TODO: Add arguments | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Returns: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// float: TODO: Add return description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Example: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// >>> import ofire | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// >>> # TODO: Add example when equation is implemented | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+4
to
+25
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Placeholder for equation 59.10. | |
| /// | |
| /// This function is a placeholder and will be implemented with the actual | |
| /// equation logic. | |
| /// | |
| /// .. math:: | |
| /// | |
| /// \text{TODO: Add equation} | |
| /// | |
| /// where: | |
| /// | |
| /// - TODO: Add variable definitions | |
| /// | |
| /// Args: | |
| /// TODO: Add arguments | |
| /// | |
| /// Returns: | |
| /// float: TODO: Add return description | |
| /// | |
| /// Example: | |
| /// >>> import ofire | |
| /// >>> # TODO: Add example when equation is implemented | |
| /// SFPE Handbook Equation 59.10 (placeholder). | |
| /// | |
| /// This function is a placeholder for Equation 59.10 from the SFPE Handbook. | |
| /// The equation has not yet been implemented, and this function will always | |
| /// raise :class:`NotImplementedError` when called. | |
| /// | |
| /// Example: | |
| /// >>> import ofire | |
| /// >>> from ofire.sfpe_handbook.chapter_59 import equation_59_10 | |
| /// >>> try: | |
| /// ... equation_59_10.equation_59_10_placeholder() | |
| /// ... except NotImplementedError: | |
| /// ... print("Equation 59.10 is not yet implemented") |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use pyo3::prelude::*; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #[pyfunction] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Placeholder for equation 59.11. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// This function is a placeholder and will be implemented with the actual | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// equation logic. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// .. math:: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// \text{TODO: Add equation} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// where: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// - TODO: Add variable definitions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Args: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// TODO: Add arguments | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Returns: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// float: TODO: Add return description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Example: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// >>> import ofire | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// >>> # TODO: Add example when equation is implemented | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+4
to
+25
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Placeholder for equation 59.11. | |
| /// | |
| /// This function is a placeholder and will be implemented with the actual | |
| /// equation logic. | |
| /// | |
| /// .. math:: | |
| /// | |
| /// \text{TODO: Add equation} | |
| /// | |
| /// where: | |
| /// | |
| /// - TODO: Add variable definitions | |
| /// | |
| /// Args: | |
| /// TODO: Add arguments | |
| /// | |
| /// Returns: | |
| /// float: TODO: Add return description | |
| /// | |
| /// Example: | |
| /// >>> import ofire | |
| /// >>> # TODO: Add example when equation is implemented | |
| /// Equation 59.11 placeholder – not yet implemented. | |
| /// | |
| /// This Python binding reserves the API name for Equation 59.11 from the | |
| /// SFPE Handbook, Chapter 59. The underlying engineering calculation has | |
| /// not yet been implemented in this library. | |
| /// | |
| /// Calling this function will always raise a :class:`NotImplementedError` | |
| /// in Python to indicate that the equation is currently unavailable. | |
| /// | |
| /// Example: | |
| /// >>> import ofire | |
| /// >>> from ofire.sfpe_handbook import chapter_59 | |
| /// >>> # This call will raise NotImplementedError until implemented | |
| /// >>> chapter_59.equation_59_11.equation_59_11_placeholder() |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| use pyo3::prelude::*; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| use openfire::sfpe_handbook::chapter_59::equation_59_5 as rust_equation_59_5; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| #[pyfunction] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Calculates pedestrian travel speed along a path (Equation 59.5). | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// .. math:: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// S = k - akD | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// where: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// - :math:`S` is the speed along the line of travel | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// - :math:`k` is the speed constant from Table 59.2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// - :math:`a` is the unit conversion constant (0.266 for SI, 2.86 for imperial) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// - :math:`D` is the population density in persons per unit area | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Args: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// k (float): Speed constant from Table 59.2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// a (float): Unit conversion constant (0.266 for SI, 2.86 for imperial) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// d (float): Population density (persons per unit area) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Returns: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| /// float: Speed S along the line of travel | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+25
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| /// - :math:`S` is the speed along the line of travel | |
| /// - :math:`k` is the speed constant from Table 59.2 | |
| /// - :math:`a` is the unit conversion constant (0.266 for SI, 2.86 for imperial) | |
| /// - :math:`D` is the population density in persons per unit area | |
| /// | |
| /// Args: | |
| /// k (float): Speed constant from Table 59.2 | |
| /// a (float): Unit conversion constant (0.266 for SI, 2.86 for imperial) | |
| /// d (float): Population density (persons per unit area) | |
| /// | |
| /// Returns: | |
| /// float: Speed S along the line of travel | |
| /// - :math:`S` is the speed along the line of travel (m/s or ft/s, consistent with :math:`k`) | |
| /// - :math:`k` is the speed constant from Table 59.2 (m/s or ft/s) | |
| /// - :math:`a` is the unit conversion constant (m²/person for SI, ft²/person for imperial) | |
| /// - :math:`D` is the population density (persons/m² or persons/ft²) | |
| /// | |
| /// Args: | |
| /// k (float): Speed constant from Table 59.2 (m/s or ft/s) | |
| /// a (float): Unit conversion constant (m²/person for SI, ft²/person for imperial) | |
| /// d (float): Population density (persons/m² or persons/ft²) | |
| /// | |
| /// Returns: | |
| /// float: Speed :math:`S` along the line of travel (m/s or ft/s, consistent with :math:`k`) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| use pyo3::prelude::*; | ||
|
|
||
| use openfire::sfpe_handbook::chapter_59::equation_59_6 as rust_equation_59_6; | ||
|
|
||
| #[pyfunction] | ||
| /// Calculates specific flow of evacuating persons (Equation 59.6). | ||
| /// | ||
| /// Specific flow is the flow of evacuating persons past a point in the exit | ||
| /// route per unit of time per unit of effective width. | ||
| /// | ||
| /// .. math:: | ||
| /// | ||
| /// F_s = S \cdot D | ||
| /// | ||
| /// where: | ||
| /// | ||
| /// - :math:`F_s` is the specific flow (persons/min/ft or persons/s/m of effective width) | ||
| /// - :math:`S` is the speed along the line of travel (from Equation 59.5) | ||
| /// - :math:`D` is the population density (persons per unit area) | ||
| /// | ||
| /// Args: | ||
| /// s (float): Speed along the line of travel (m/s or ft/min) | ||
| /// d (float): Population density (persons/m² or persons/ft²) | ||
| /// | ||
| /// Returns: | ||
| /// float: Specific flow Fs (persons/s/m or persons/min/ft of effective width) | ||
| /// | ||
| /// Example: | ||
| /// >>> import ofire | ||
| /// >>> result = ofire.sfpe_handbook.chapter_59.equation_59_6.specific_flow(1.0, 0.5) | ||
| /// >>> print(f"{result:.2f} persons/s/m") | ||
| fn specific_flow(s: f64, d: f64) -> PyResult<f64> { | ||
| Ok(rust_equation_59_6::specific_flow(s, d)) | ||
| } | ||
|
|
||
| #[pymodule] | ||
| pub fn equation_59_6(m: &Bound<'_, PyModule>) -> PyResult<()> { | ||
| m.add_function(pyo3::wrap_pyfunction!(specific_flow, m)?)?; | ||
| Ok(()) | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,42 @@ | ||||||||||||||||||||||||||||||||||
| use pyo3::prelude::*; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| use openfire::sfpe_handbook::chapter_59::equation_59_7 as rust_equation_59_7; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| #[pyfunction] | ||||||||||||||||||||||||||||||||||
| /// Calculates specific flow by combining Equations 59.5 and 59.6 (Equation 59.7). | ||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||
| /// This equation combines the travel speed equation (59.5) with the specific | ||||||||||||||||||||||||||||||||||
| /// flow equation (59.6) to express specific flow directly in terms of density. | ||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||
| /// .. math:: | ||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||
| /// F_s = (1 - aD) \cdot k \cdot D | ||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||
| /// where: | ||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||
| /// - :math:`F_s` is the specific flow (persons/min/ft or persons/s/m of effective width) | ||||||||||||||||||||||||||||||||||
| /// - :math:`a` is the unit conversion constant (0.266 for SI, 2.86 for imperial) | ||||||||||||||||||||||||||||||||||
| /// - :math:`D` is the population density (persons per unit area) | ||||||||||||||||||||||||||||||||||
| /// - :math:`k` is the speed constant from Table 59.2 | ||||||||||||||||||||||||||||||||||
| /// | ||||||||||||||||||||||||||||||||||
| /// Args: | ||||||||||||||||||||||||||||||||||
| /// a (float): Unit conversion constant (0.266 for SI units, 2.86 for imperial units) | ||||||||||||||||||||||||||||||||||
| /// d (float): Population density (persons/m² or persons/ft²) | ||||||||||||||||||||||||||||||||||
| /// k (float): Speed constant from Table 59.2 | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+18
to
+25
|
||||||||||||||||||||||||||||||||||
| /// - :math:`a` is the unit conversion constant (0.266 for SI, 2.86 for imperial) | |
| /// - :math:`D` is the population density (persons per unit area) | |
| /// - :math:`k` is the speed constant from Table 59.2 | |
| /// | |
| /// Args: | |
| /// a (float): Unit conversion constant (0.266 for SI units, 2.86 for imperial units) | |
| /// d (float): Population density (persons/m² or persons/ft²) | |
| /// k (float): Speed constant from Table 59.2 | |
| /// - :math:`a` is the unit conversion constant (m²/person or ft²/person; 0.266 for SI, 2.86 for imperial) | |
| /// - :math:`D` is the population density (persons/m² or persons/ft²) | |
| /// - :math:`k` is the speed constant from Table 59.2 (m/s or ft/min, consistent with the chosen unit system) | |
| /// | |
| /// Args: | |
| /// a (float): Unit conversion constant (m²/person or ft²/person; 0.266 for SI units, 2.86 for imperial units) | |
| /// d (float): Population density (persons/m² or persons/ft²) | |
| /// k (float): Speed constant from Table 59.2 (m/s or ft/min, consistent with the chosen unit system) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| use pyo3::prelude::*; | ||
|
|
||
| use openfire::sfpe_handbook::chapter_59::equation_59_8 as rust_equation_59_8; | ||
|
|
||
| #[pyfunction] | ||
| /// Calculates the flow rate of persons passing a point in an exit route (Equation 59.8). | ||
| /// | ||
| /// The calculated flow is the predicted flow rate of persons passing a particular | ||
| /// point in an exit route. This equation assumes the achievable flow rate through | ||
| /// a component is directly proportional to its width. | ||
| /// | ||
| /// .. math:: | ||
| /// | ||
| /// F_c = F_s \cdot W_e | ||
| /// | ||
| /// where: | ||
| /// | ||
| /// - :math:`F_c` is the calculated flow (persons/min or persons/s) | ||
| /// - :math:`F_s` is the specific flow (persons/min/ft or persons/s/m of effective width) | ||
| /// - :math:`W_e` is the effective width of the component being traversed (ft or m) | ||
| /// | ||
| /// Args: | ||
| /// fs (float): Specific flow (persons/min/ft or persons/s/m of effective width) | ||
| /// we (float): Effective width of the component being traversed (ft or m) | ||
| /// | ||
| /// Returns: | ||
| /// float: Calculated flow Fc (persons/min or persons/s) | ||
| /// | ||
| /// Example: | ||
| /// >>> import ofire | ||
| /// >>> result = ofire.sfpe_handbook.chapter_59.equation_59_8.calculated_flow(1.3, 1.5) | ||
| /// >>> print(f"{result:.2f} persons/s") | ||
| fn calculated_flow(fs: f64, we: f64) -> PyResult<f64> { | ||
| Ok(rust_equation_59_8::calculated_flow(fs, we)) | ||
| } | ||
|
|
||
| #[pymodule] | ||
| pub fn equation_59_8(m: &Bound<'_, PyModule>) -> PyResult<()> { | ||
| m.add_function(pyo3::wrap_pyfunction!(calculated_flow, m)?)?; | ||
| Ok(()) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new Chapter 59 section uses headings like “Equation 59.5” without short descriptions, while the rest of this file uses the “Equation X.Y - Description” heading style. Consider adding brief descriptions to these Chapter 59 equation headings (and adjust underline lengths accordingly) to keep the API docs consistent and scannable.