Command-Based Access to SPS Examples

Documentation Home Page SPS Software Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

Command-Based Access to SPS Examples

Page Contents


Command‑Based Access to SPS Examples

SPS provides a small API to make the example models:

  • Easy to discover (browseable by category with tab completion)

  • Fast to open (one command, no menus)

  • Consistent (same commands work across all example families)


1. Overview

SPS examples are exposed through the namespace:

sps.Examples

Under this namespace, examples are grouped by category (e.g., Intro, Analysis, PowerConverters, Machines, …). Each example is represented by a lightweight handle object that supports:

  • Opening the example model

  • Opening the associated documentation

All access is command‑based and fully compatible with MATLAB tab completion.


2. Browsing Examples by Category

Start by typing:

sps.Examples.

and press TAB. MATLAB will list all available categories, for example:

Analysis Control Doc Intro Machines MotorDrives PowerConverters PowerGrid Renewables

Each category corresponds to a family of SPS examples.

Example

sps.Examples.Analysis.

Press TAB again to list all analysis‑related examples.


3. Opening an Example Model

To open an example model, call open with the example handle:

open(sps.Examples.<Category>.<ExampleName>)

Example

open(sps.Examples.Analysis.IEEE13NodeTestFeederExample)

This opens the Simulink model associated with the example.

Another Example

open(sps.Examples.PowerConverters.SwitchingFunctionConverterExample)
SpsExamples01.gif

4. Opening Example Documentation

Most examples include an associated documentation page.

To open the documentation:

doc(sps.Examples.<Category>.<ExampleName>)

Example

doc(sps.Examples.Analysis.LoadFlow5BusNetworkExample)

This opens the documentation describing the example, theory, and usage.

 

If an example does not define documentation, an informative error is displayed.


5. Accessing Documentation by Model Name

In some workflows, you may know the model name (e.g., power_AveragedPulses.slx) but not the example name or category.

You can open documentation directly using:

sps.Catalog.openDocByModel(<modelName>)

Example

sps.Catalog.openDocByModel("power_AveragedPulses.slx")

This command:

  1. Searches the SPS catalog for the example whose Model matches the given name

  2. Opens the associated documentation

This is especially useful when navigating from models, scripts, or error messages.


6. Listing and Searching Examples

List All Examples

sps.Catalog.list

Returns a table with all examples, including:

  • Category

  • Name

  • Model

  • Title

  • Documentation availability

List Examples in a Category

sps.Catalog.list("Analysis")
Category Name Model Title ____________ _____________________________________ ______________________________ _____________________________________________________________________________________ {'Analysis'} {'IEEE13NodeTestFeederExample' } {'power_13NodeTestFeeder.slx'} {'IEEE 13 Node Test Feeder' } {'Analysis'} {'LoadFlow5BusNetworkExample' } {'power_LFnetwork_5bus.slx' } {'Initializing a 5-Bus Network with the Load Flow Tool of Powergui' } {'Analysis'} {'LoadFlow29BusNetworkExample' } {'power_LFnetwork_29bus.slx' } {'Initializing a 29-Bus, 7-Power Plant Network with the Load Flow Tool of Powergui' } {'Analysis'} {'CoupledCablesExample' } {'power_cable.slx' } {'Four Coupled 66-kV Cables' } {'Analysis'} {'SimulinkInterfaceExample' } {'power_SLmodeling.slx' } {'Interfacing Simulink Models with SPS' } {'Analysis'} {'SimscapeInterfaceExample' } {'power_SSCmodeling.slx' } {'Interfacing Simscape Models with SPS' } {'Analysis'} {'BuckConverterInterpolationExample'} {'power_buck.slx' } {'Increased Accuracy and Simulation Speed Using Interpolation' } {'Analysis'} {'DecoupledPVArrayGridExample' } {'power_PVarray_Grid.slx' } {'Running a Grid-Connected PV Array Model in Real-Time Using Decoupling Line Blocks'}

Search by Keyword

sps.Catalog.search("average")
Category Model Name Title ___________________ _________________________________ __________________________________________ _____________________________________________________________________________________ {'PowerConverters'} {'power_AveragedPulses.slx' } {'SwitchingFunctionConverterExample' } {'Switching Function Converter Controlled by Averaged Firing Pulses' } {'PowerConverters'} {'power_converters.slx' } {'PowerConvertersExample' } {'Power Converters Modeling Techniques' } {'PowerGrid' } {'power_hvdc12pulse_average.slx'} {'HVDCAverageModelExample' } {'Thyristor-Based HVDC Transmission System Average Model' } {'PowerGrid' } {'power_dstatcom_avg.slx' } {'DistributionSTATCOMAverageModelExample'} {'D-STATCOM Average Model' } {'Renewables' } {'power_PVarray_grid_avg.slx' } {'PVArrayGridAverageModelExample' } {'Average Model of a 100-kW Grid-Connected PV Array' } {'Renewables' } {'power_wind_dfig_avg.slx' } {'WindFarmDFIGAverageModelExample' } {'Wind Farm - Doubly-Fed Induction Generator (DFIG) Average Model' } {'Renewables' } {'power_wind_type_4_avg.slx' } {'WindFarmType4AverageModelExample' } {'Wind Farm - Synchronous Generator and Full Scale Converter (Type 4) Average Model'} {'Doc' } {'power_sfavg.slx' } {'ThreePhaseVSCModelsComparison' } {'Comparing Three-Phase VSC Models (Detailed, Switching-Function and Average)' }

Search matches against:

  • Category

  • Example name

  • Title


7. Working with Example Handles

Each entry under sps.Examples.<Category>.<ExampleName> is an example handle. You normally do not need to manipulate it directly, but it supports useful behavior:

ex = sps.Examples.Intro.SteadyStateAnalysisExample; disp(ex)

Typical output:

Intro/SteadyStateAnalysisExample → power_filter.slx

You can then reuse the handle:

open(ex) doc(ex)

8. Examples Across Categories

Introductory Examples

open(sps.Examples.Intro.SteadyStateAnalysisExample)

Power Converter Examples

open(sps.Examples.PowerConverters.BoostConverterExample)

Machine Models

open(sps.Examples.Machines.SynchronousMachineExample)

Grid‑Level Studies

open(sps.Examples.PowerGrid.HVDCMMCInterconnectionExample)

9. Opening the Examples Home Documentation

In addition to opening documentation for individual examples, SPS provides a command to open the home documentation page that gives an overview of all SPS example models.

Use the following command:

sps.Examples.docHome

This command opens the main SPS Example Models documentation page in your web browser.

This is useful when you want to:

  • Explore the full set of available SPS examples

  • Discover examples outside your current area

  • Navigate documentation visually instead of by command