Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

Change Sample Time during simulation in PLECS Blockset

+1 vote
Hello all,

I'm using PLECS Blockset.
Is there any possibilty to change the 'Sample time' in the 'Discrete state-space options' during simluation? For my usecase it would be sufficient to have something like a step depending on the simulation time.

Thank you for answering in advance.

Best regards
asked Jan 14, 2020 by sgra (21 points)

1 Answer

+1 vote
Best answer
You can change the sample time placing the Discrete State Space component within a Triggered Subsystem and setting the Sample Time parameter to "-1" for an inherited sample time.  With this configuration, you can generate a variable frequency trigger pulse, which in turn will vary the effective sample time of the discrete state space system.

Attached is an example in PLECS Blockset and PLECS Standalone.  The triggered implementation of the Discrete State Space component is compared against a Discrete State Space component with a fixed sample time and a comparable continuous state space system.
answered Jan 15, 2020 by Bryan Lieblick (1,949 points)
selected Jan 16, 2020 by sgra
Thanks a lot!
This solved my issue.