I am trying to model a valve with hard stops based on the valve closed position and the spring closed coil length. I was able to achieve the expected behavior with only a spring, but adding in the hardstop is proving difficult. I have tried the hard stop on two modes:
(1) "Full stifness and damping applied at bounds, undamped rebound"
(2) "Based on coefficient of restitution"
In mode (1), the hard stop limts I've set seem to be ignored for postion. It isn't an exact match, but it appears that they are being applied to velocity instead. I would expect the behavior to be that velocity is set to zero at position == hard stop limits, but that is not the case.
When using hard stop mode (2), the model fails to converge when position reaches the hard stop. The error message is provideed at the bottom of the post.
Am I doing something wrong with the initilization of the hardstop? I haven't changed any of the initial targets or nominal values. End goal would be to have the output in the "Mass Position" scope limited to the bounds of the hard stop, regardless of the force applied to the mechancial translational converter. I would expect the hard stop to be able to apply a reactant force equal to the force provided by the converter.
Model:
Mode 2 Error Message:
Error:An error occurred while running the simulation and the simulation was terminated
['sample_model/Solver Configuration']: Transient initialization at time 1.001461997276205, solving for consistent states and modes, failed to converge.
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
all components and nodal across variables involved
Cannot solve for one or more variables, including dynamic variable derivatives:
Time derivative of 'Translational_Mechanical_Converter_IL.p_I' (Pressure of liquid volume)
'Pressure_Source_IL.mdot_A' (Mass flow rate into port A)
'Pressure_Source_IL.mdot_B' (Mass flow rate into port B)
'Reservoir_IL.mdot_A' (Mass flow rate into port A)
'Translational_Mechanical_Converter_IL.mdot_A' (Mass flow rate into port A)
Problems possible for transient initialization, as well as stepsize control for transient solve, due to equations (including nonlinear equations) of one or more components:
'C:\Program Files\MATLAB\R2023b\toolbox\physmod\simscape\library\m\+foundation\+signal\+sources\ramp.ssc' (line 22)
'sample_model/Pressure Source (IL)'
'C:\Program Files\MATLAB\R2023b\toolbox\physmod\simscape\library\m\+foundation\+isothermal_liquid\+sources\pressure_source.ssc' (line 54)
'sample_model/Reservoir (IL)'
'C:\Program Files\MATLAB\R2023b\toolbox\physmod\simscape\library\m\+foundation\+isothermal_liquid\+elements\reservoir.ssc' (line 86)
'C:\Program Files\MATLAB\R2023b\toolbox\physmod\simscape\library\m\+foundation\+isothermal_liquid\+elements\reservoir.ssc' (line 89)
'sample_model/Translational Mechanical Converter (IL)'
'C:\Program Files\MATLAB\R2023b\toolbox\physmod\simscape\library\m\+foundation\+isothermal_liquid\+elements\translational_mechanical_converter.ssc' (line 216)
'C:\Program Files\MATLAB\R2023b\toolbox\physmod\simscape\library\m\+foundation\+isothermal_liquid\+elements\translational_mechanical_converter.ssc' (line 236)