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.

HOW TO WRITE EQUATION IN PLECS

0 votes
375 views
I have the attached equations in MATLAB FUNCTION. I want them in PLECS. I tried C script, but i don't know C much. How to incorporate this in PLECS. Kindly suggest.
asked Feb 9, 2023 by shruti pandey (12 points)

1 Answer

0 votes

You cannot directly use a Matlab function to calculate the output of a block based on the simulation inputs.  As you suggested, a C-Script block would be appropriate and is the most flexible option.

However, if you're not familiar with C or the C-Script block, the simple arithmetic functions your example can be implemented using the "Function" block.  For the sake of readability, you can break down your equation into a few Function blocks and connect them with other blocks such as multiply, sum, offset, etc.

See the attached example and screenshot.

answered Feb 10, 2023 by Bryan Lieblick (1,995 points)
...