error after 24 seconds in model

조회 수: 2 (최근 30일)
harsh
harsh 2024년 11월 30일
답변: Suraj Kumar 2024년 12월 1일
component divide
% PS Divide :0.75
% This block divides the first input signal by the second one:
% y = u_1 ./ u_2
%
% All connections are physical signal ports.
inputs
I1; % Left input signal (numerator)
I2; % Right input signal (denominator)
end
outputs
O; % Output signal (result of division)
end
equations
epsilon = 1e-1; % Small value to prevent division by zero
O = I1 ./ max(I2, epsilon); % Apply regularization to denominator
end
end

답변 (1개)

Suraj Kumar
Suraj Kumar 2024년 12월 1일
Hi @harsh,
The error that you are encountering during simulation of the model can be eliminated by using the following steps.
You can select 'Use local solver' in the ‘SolverConfiguration’ block if it is present in the model.
This allows Simscape and physical network components to utilize a specialized local discrete solver. The local solver treats the physical network as a stiff system, using an implicit solver to iteratively find the solution for the next time step with an algebraic solver.
To learn more about making optimal solver choices for physical simulation, you can refer to the following documentation:
Hope it helps!

카테고리

Help CenterFile Exchange에서 Trimming and Linearization에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by