Syntax
smbCreateSineWave([SName,EPort,amp])
Input Parameter
SName : | | Generator name; default is 'Sine Wave' |
EPort : | | Optional Port to connect |
amp : | | optional amplitude; default is +pi |
Copyright 2016-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, smbCreateSineWave
, is designed to create a cosine wave as a Simulink signal. It is part of the SG-Library and was introduced in SolidGeometry 3.1. Below is a detailed explanation of the algorithm and its parameters.
Input Parameters
- SName: The name of the generator. The default value is 'Sine Wave'.
- EPort: An optional port to connect. If not specified, it remains empty.
- amp: The amplitude of the sine wave. The default value is À (pi).
Algorithm Steps
- Initialize the default values for
SName
, EPort
, and amp
.
- Check if any input arguments are provided and update the default values accordingly.
- Use the function
smbAddBlock
to add a 'Sine Wave' block to the current Simulink model (gcs
).
- Set the position of the current block (
gcb
) using smbSetPosition
and smbNewGridPos
.
- Configure the block parameters:
- Set the phase to À/2 to ensure no force during singularity.
- Set the amplitude using the provided or default value of
amp
.
- If
EPort
is not empty:
- Extract the subsystem name from
EPort
.
- Use
smbWhich
to determine the subsystem.
- Retrieve the ports using
smbGetPorts
.
- If there are existing connections, delete them using
delete_line
.
- Add a new line connecting the 'Sine Wave' block to the specified
EPort
with autorouting enabled.
Algorithm explaination created using ChatGPT on 2025-08-19 08:08. (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