-
Notifications
You must be signed in to change notification settings - Fork 50
feat: Ec2 2023 9.3 - 9.3.2 and 9.3.4 #116
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: dev-ec2-2023
Are you sure you want to change the base?
feat: Ec2 2023 9.3 - 9.3.2 and 9.3.4 #116
Conversation
Co-authored-by: talledodiego <38036285+talledodiego@users.noreply.github.com>
…codes into ec_2004_crack_control
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.
Thanks for the excellent contribution 👍 I have merged dev and fixed docstrings before Diego will check the code equations.
talledodiego
left a comment
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.
Excellent!
A couple of minor comments.
| return wk_cal_, k_1_r_, srm_cal_, epssm_epscm_ | ||
|
|
||
|
|
||
| def simpl_span_depth_ratio( |
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.
May the prefix in the name simpl_ make some confusion with the simply supported conditions? If so, I suggest to rethink slighly the name.
| the necessary values. | ||
|
|
||
| Args: | ||
| ss (str): An integer corresponding to the structural system type: 'ss' |
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 final ss should be on a new line?
| for simply supported beams/slabs, 'es' for end spans or one-way | ||
| spanning slab, 'is' for interior spans or one-way spanning slab, | ||
| 'c' for cantilevers. | ||
| wr (float): The mechanical reinforcement ratio, expressed as a decimal |
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.
Should the relation for wr be implemented in a function with the equation reported in note a) of Table 9.3?
| 45, 30). | ||
|
|
||
| Returns: | ||
| float: The interpolated or extrapolated l/d ratio. |
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.
Should be extrapolation permitted?
Notes a) and b) in Table 9.3 state that intermediate values may be interpolated (there is no mention to extrapolation).
"Extrapolation" is mentioned in subclause (3) with reference to other support conditions (multiplying them by cubic root of ...).
| psi_2 = 0.3. | ||
|
|
||
| It uses linear interpolation; however, cubic or nearest interpolation | ||
| methods can also be applied. |
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.
can something else than linear be used in this code? I don't see a kwarg for permitting so.
| Deflection limits are set to l/250, in line with the standards. | ||
|
|
||
| The `wr` and `ll_tl` values should ideally be within the bounds given | ||
| in the table. Extrapolation is possible but may lead to less accurate |
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.
See previous comment. I don't know if extrapolation should be permitted. Anyhow it seems to me that griddata does not manage extrapolation and returns nan?
| load_type: Literal['short', 'cycle'], | ||
| sigma_sr_sigma_s: float, |
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.
maybe zeta should be the input parameter and factor out a new equation for (9,29) with definition of zeta?
| load_type (str): Used for getting the beta_parameter that takes into | ||
| consideration the type of the load. Short for 'short' loads and | ||
| 'cycle' for repeated loading. | ||
| sigma_sr_sigma_s (float): The ratio between the highest stress having | ||
| occurred up to the moment being analysed in the tension | ||
| reinforcement calculated on the basis of a cracked section and the | ||
| stress in the tension reinforcement calculated on the basis of a | ||
| cracked section under loading conditions causing first cracking. | ||
| Can be replaced by Mcr/M or Ncr/N where Mcr is the cracking moment | ||
| and Ncr is the cracking force. |
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.
See previous comment about factoring out (9.29)
| beta = 1.0 if load_type == 'short' else 0.5 | ||
| zeta = max(0, 1 - beta * sigma_sr_sigma_s**2) |
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.
See previous comment about factoring out this portion.
| @pytest.mark.parametrize( | ||
| 'alpha_I, alpha_II, load_type, sigma_sr_sigma_s, expected', | ||
| [ | ||
| # Basic functionality with short load type | ||
| (1.0, 0.5, 'short', 0.0, 0.5), | ||
| (1.0, 0.5, 'short', 1.0, 1.0), | ||
| # Basic functionality with cycle load type | ||
| (1.0, 0.5, 'cycle', 0.0, 0.5), | ||
| (1.0, 0.5, 'cycle', 1.0, 0.75), | ||
| # Testing edge cases where sigma_sr_sigma_s is at boundary conditions | ||
| (1.0, 0.5, 'short', -1.0, 1.0), | ||
| (1.0, 0.5, 'cycle', -1.0, 0.75), | ||
| # Testing extremes of sigma_sr_sigma_s | ||
| (1.0, 0.5, 'short', 10.0, 1.0), | ||
| (1.0, 0.5, 'cycle', 10.0, 1.0), | ||
| ], | ||
| ) | ||
| def test_delta_gen(alpha_I, alpha_II, load_type, sigma_sr_sigma_s, expected): | ||
| """Test the general method for deflection calculations.""" | ||
| assert _section9_sls.delta_gen( | ||
| alpha_I, alpha_II, load_type, sigma_sr_sigma_s | ||
| ) == pytest.approx(expected) |
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.
See previous comment about factoring out (9.29).
I have just added two new methods (and their respective tests) that were missing in for the 'Deflection Control' chapter from the Eurocode 2:2023.
This work should complete the Issue #52 unless otherwise specified.