Syntax
smbSetSimulationtolerance([tol])
Input Parameter
tol : | | default is 0.001; USE 0.1 for MTT ==> ConsistencyTolFactor |
Copyright 2023-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, smbSetSimulationtolerance
, is designed to adjust the simulation tolerance for SimScape models, particularly for 4-bar linkages, which have become more challenging to simulate accurately in recent versions.
Input Parameters
- tol: This parameter represents the tolerance factor for the simulation. The default value is 0.001, but for MTT (presumably a specific modeling context), a value of 0.1 is recommended. This parameter is used to set the
ConsistencyTolFactor
in the simulation settings.
Algorithm Steps
- The function begins by retrieving the tolerance value from the input arguments using the
getfuncparams
function. If no value is provided, it defaults to 0.01.
- It checks if the retrieved tolerance value is a character string. If not, it converts the numeric value to a string using
sprintf
.
- The function then searches for the 'Solver Configuration' block in the current Simulink model using
find_system
with the current system context gcs
.
- Once the 'Solver Configuration' block is identified, the function sets its
ConsistencyTolFactor
parameter to the specified tolerance value using set_param
.
This function is part of the SolidGeometry library and is intended to ensure that simulation examples, particularly those used in lectures, run smoothly by adjusting the tolerance settings to accommodate changes in SimScape 2023.
Algorithm explaination created using ChatGPT on 2025-08-19 00:16. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21