Before You Begin
Installing PLECS Standalone
Installing PLECS on your system is easy. You do not need to have system administrator permissions.
Installation on Microsoft Windows
If you already have a license file
*.lic, copy it to your harddisk.Run the installer executable by double-clicking it. PLECS can be installed for the current user or all users of a machine. To install PLECS for all users the installer must be executed with administrator privileges.
Start PLECS.
Installation on macOS
If you already have a license file
*.lic, copy it to your harddisk.Open the disk image by double-clicking it.
Copy PLECS to the Application folder.
Start PLECS.
Installation on Linux
If you already have a license file
*.lic, copy it to your harddisk.Open a terminal and extract the package
plecs-standalone-x-y-z_linux64.tar.gzby entering the commandtar xf plecs-standalone-x-y-z_linux64.tar.gz
in a directory of your choice. This will create a new sub-directory named
plecscontaining the required files.Start PLECS by executing
PLECSin the folderplecs.
Licensing
If PLECS cannot locate any license file when you start it, it will show a message that it is unlicensed.
Choose Start in demo mode to use PLECS in a restricted demo mode that lets you build models and run simulations. Saving models or data is disabled in this mode.
Choose Open license manager… to open the License Manager, which lets you install a license file or request a time-limited trial or student license.
If PLECS does locate license files but they do not contain a valid license (e.g. because it has expired), it will immediately open the License Manager without the option to start the demo mode.
Installing PLECS Blockset
Installing PLECS Blockset on your computer is easy. You do not need to have system administrator permissions. Since PLECS Blockset requires MATLAB and Simulink make sure these programs are installed on your computer.
Installation on Microsoft Windows
If you already have a license file
*.lic, copy it to your harddisk.Run the installer executable by double-clicking it. PLECS can be installed for the current user or all users of a machine. To install PLECS for all users the installer must be executed with administrator privileges.
After the installer has finished, it will automatically start the PLECS Blockset Installation Wizard.
On the License File page you can choose to keep an existing license file, copy a new license file from your harddisk or request a trial or student license.
Review the MATLAB Search Path page and click Continue.
Start MATLAB and enter
plecslibor choose the entry PLECS in the Simulink Library Browser to open the PLECS Library.
Installation on macOS
If you already have a license file
*.lic, copy it to your harddisk.Open the diskimage by double-clicking it and copy the folder
PLECS Blockset x.yto a location of your choice.Run the application
PLECS.appinside the folderPLECS Blockset x.yby double-clicking it. This will start the PLECS Blockset Installation Wizard.On the License File page you can choose to keep an existing license file, copy a new license file from your harddisk or request a trial or student license.
Review the MATLAB Search Path page and click Continue.
Start MATLAB and enter
plecslibor choose the entry PLECS in the Simulink Library Browser to open the PLECS Library.
Installation on Linux
If you already have a license file
*.lic, copy it to your harddisk.Open a terminal and extract the package
plecs-blockset-x-y-z_linux64.tar.gzby entering the commandtar xf plecs-blockset-x-y-z_linux64.tar.gz
in a directory of your choice.
Still within the terminal execute the program
PLECS.setupinside the folderplecs/bin/glnxa64. This will start the PLECS Blockset Installation Wizard.On the License File page you can choose to keep an existing license file, copy a new license file from your harddisk or request a trial or student license.
Review the MATLAB Search Path page and click Continue.
Start MATLAB and enter
plecslibor choose the entry PLECS in the Simulink Library Browser to open the PLECS Library.
Licensing
If PLECS cannot locate any license file when you start it, it will show a message that it is unlicensed.
Choose Start in demo mode to use PLECS in a restricted demo mode that lets you build models and run simulations. Saving Simulink models containing PLECS blocks is disabled in this mode.
Choose Open license manager… to open the License Manager, which lets you install a license file or request a time-limited trial or student license.
If PLECS does locate license files but they do not contain a valid license (e.g. because it has expired), it will immediately open the License Manager without the option to start the demo mode.
Without a valid license you will still be able to open or save Simulink models containing PLECS blocks. However, you cannot modify a circuit schematic or run a simulation.
Note
PLECS scans the license file only once when the module is loaded by MATLAB. Therefore, if you reinstall the license file, you need to clear the PLECS module before the changes can become effective. You can do this by entering plecsclear at the MATLAB command prompt.
Configuring the MATLAB Search Path
The recommended method to register PLECS Blockset with MATLAB is to add appropriate addpath commands to the startup file startup.m in your MATLAB startup folder. For information on the startup.m file, enter doc startup in MATLAB. The PLECS Blockset Installation Wizard will assist you in creating or updating this file.
Using this method has the advantage that if you update MATLAB after having installed PLECS, the new MATLAB version will automatically know about PLECS. The disadvantage is that each user must setup their startup file individually.
As an alternative method you can register PLECS with a specific MATLAB installation using the MATLAB Path Browser or by directly editing the file pathdef.m in the directory matlabroot/toolbox/local/. This method may be appropriate if PLECS will be used by multiple users sharing the same computer. You need to add the PLECS directory and its subdirectory demos to the MATLAB search path.
Configuring PLECS
For information about setting global configuration options for PLECS see Configuring PLECS.
Installing Different Versions of PLECS Blockset in Parallel
If you want to keep different versions of PLECS installed in parallel on one computer, you must ensure that only one version is on your MATLAB path at any time during a MATLAB session. Otherwise, loss of data may occur. Before changing the MATLAB path, be sure to clear the currently loaded PLECS module by entering plecsclear at the MATLAB command prompt. As an additional precaution you should restart MATLAB after the change.
Uninstalling PLECS Blockset
Uninstalling PLECS Blockset is as easy as installing it.
Locate the directory where PLECS is installed by entering
which plecsin the MATLAB command line.
Remove the PLECS directory and its subdirectory
demosfrom the search path. Depending on how the directories were added to the path during installation, this is done using the Path Browser or by editing the filepathdef.min the directorymatlabroot/toolbox/local/or your MATLAB startup filestartup.m.Quit MATLAB.
On Windows, deinstall PLECS Blockset by choosing the appropriate entry in the Windows control panel. On macOS and Linux just delete the PLECS directory.
License File Location
Both PLECS Standalone and PLECS Blockset search for license files named *.lic in the following directories:
Platform |
Search Paths |
|---|---|
Windows |
|
macOS |
|
Linux |
|
The License Manager will install license files in the first directory listed for each platform because this location is usually writable by the user. However, an administrator may choose to install license files to be used for all users in the other directory.
If none of the search directories contains any license file *.lic, PLECS uses the environment variables PLEXIM_LICENSE_FILE and LM_LICENSE_FILE to locate the license file.
Network Licensing
If you purchase one or more floating licenses for PLECS, the license server program FlexNet Publisher is employed to control access to PLECS. FlexNet Publisher is a product of Flexera Software. The license file sent to you must be installed on the license server. This file contains information that identifies the computer running the license manager and specifies the number of floating licenses you have purchased.
On the client computer(s), you need to use a text editor to create a license file network.lic with the following content:
SERVER licenseserver ANYUSE_SERVER
where licenseserver is the IP address or the hostname or fully qualified domain name (FQDN) of the server computer running the license manager. If the hostname or FQDN is used, verify that the client computer can resolve it to the correct IP address. If the license manager uses a TCP port other than 27000-27009, the port number must be specified on the SERVER line after the keyword ANY, e.g.:
SERVER licenseserver ANY 3456USE_SERVER
PLECS tries to obtain a license from the server the first time you load a model or library containing a PLECS circuit. If the license is not granted – e.g. because the server is down or unreachable or because the licensed number of concurrent users is already reached – PLECS will open the License Manager to report the problem. In order to retry to obtain a license you need to restart PLECS Standalone or clear PLECS Blockset from the MATLAB memory using the MATLAB command plecsclear. Once granted, a license is returned to the server when quit PLECS Standalone or clear PLECS Blockset from the MATLAB memory.
If the connection to the license server is lost after you have obtained a license, PLECS will temporarily switch to the unlicensed mode. Upon successful reconnection to the server, PLECS will switch back to normal operation.
What’s New in Version 5.0
Major New Features
PLECS Spice is a separately licensed add-on for PLECS Standalone that allows you to import SPICE netlists into a PLECS model and connect them to other components in a schematic. Read more in the chapter SPICE.
The external mode of the PLECS Coder supports the Nanostep Scope introduced in the RT Box Target Support Package version 4.0, which enables you to monitor internal voltages and currents in Nanostep blocks with Nanostep time resolution.
The Nanostep library contains new blocks for modeling on-board chargers, such as the Bidirectional PSFB Converter and various single-stage topologies with matrix converter frontends. These blocks support real-time simulations with step sizes as small as 4 ns on PLECS RT Boxes with firmware version 4.0 or newer. For a full list see Nanostep in the chapter Components by Category.
The Functional Mockup Interface of PLECS allows you to export and import Model Exchange and Co-Simulation Functional Mockup Units conforming to the FMI standard versions 2.0 and 3.0. See Functional Mockup Interface for more information.
The Frequency Response Analysis is a robust general-purpose small-signal analysis type that works with plain time-domain simulations. See Frequency Response for details.
Further Enhancements
The PLECS Standalone solvers by default use an analytical method to calculate the Jacobian matrix of a model for enhanced performance during the simulation of stiff systems. See Variable-Step Solver Options.
PLECS validates parameter expressions as you enter them into dialog boxes and flags both syntax errors and semantic errors (such as entering a negative number where only positive values are allowed).
PLECS shows the evaluated parameter values as tooltips both in dialog boxes and for parameters shown on the schematic.
You can visualize vectorized connections and optionally show their widths in a schematic, see the section Schematic in Configuring PLECS.
The Scope, Multiplexer and Demultiplexer blocks can be stretched vertically to facilitate the creation of cleaner schematics.
The Curve Properties editor of the scope allows you to configure markers for visualizing the time steps of a simulation, see Changing Curve Properties.
Pressing the Enter key in the schematic editor opens the parameter dialog of a selected component, see Specifying Component Parameters.
If a schematic is larger than the window, you can press the middle mouse button (or the scroll wheel) while dragging the mouse for panning.