feat: Ec2 2023 9.3 - 9.3.2 and 9.3.4#116
feat: Ec2 2023 9.3 - 9.3.2 and 9.3.4#116DanielGMorenaFhecor wants to merge 31 commits intofib-international:dev-ec2-2023from
Conversation
Co-authored-by: talledodiego <38036285+talledodiego@users.noreply.github.com>
…codes into ec_2004_crack_control
talledodiego
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.