error after 24 seconds in model

25 visualizaciones (últimos 30 días)
harsh
harsh el 30 de Nov. de 2024 a las 21:35
Respondida: Suraj Kumar el 1 de Dic. de 2024 a las 5:51
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

Respuestas (1)

Suraj Kumar
Suraj Kumar el 1 de Dic. de 2024 a las 5:51
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!

Categorías

Más información sobre Simulation Setup en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by