solve
This error is usually accompanied by a warning that algebraic loop (algebraic loop) exists. It seems to be an error of the s-function, but in fact the problem does not lie in this, but in the simulation step size. It is normal for my model to enter 10 again, and an error is reported at 100. Obviously, there should be no problem with the model. This is also the reason why I locked the problem in the simulink solution method instead of the model.
Error screenshot:
solution:
Set the model to a fixed step size, and choose a smaller step size: