smbCreateSineWave

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 3.1, Creation date: 2016-11-24, Last change: 2025-09-14

Creates a Cosinus Wave as Simulink Signal



See Also: smbCreateConnection , smbCreateSG , smbCreateSGJoint , smbCreateSGNode , smbCreateStopJointC , smbCreateStopJointR , smbCopyConnections , smbCreateDrive

Example Illustration

 missing image of smbCreateSineWave (SName,EPort,amp)

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

Algorithm Steps

  1. Initialize the default values for SName, EPort, and amp.
  2. Check if any input arguments are provided and update the default values accordingly.
  3. Use the function smbAddBlock to add a 'Sine Wave' block to the current Simulink model (gcs).
  4. Set the position of the current block (gcb) using smbSetPosition and smbNewGridPos.
  5. 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.
  6. 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