Creating a Voltage Source

Create a voltage source by searching and navigating the documentation.

  1. Search for voltagesource in the integrated help.
    The results returned in response to the voltagesource query includes VoltageSource (object).
  2. Double-click VoltageSource (object).
  3. View the VoltageSource (object).
    Note: Since there can be multiple voltage sources in the model, the voltage source object is part of a collection.


    Figure 1. A snippet of the VoltageSource object which shows the Parent Collection List.
  4. Click SourceCollection hyperlink to navigate to the SourceCollection description.


    Figure 2. A snippet of the SourceCollection which shows the Usage locations.
    Note: A voltage source is configuration specific. It can be added to either a standard configuration or a characteristic modes configuration.

We want to add the voltage source to the default configuration (standard configuration).

  1. Search for StandardConfiguration in the integrated help.
    Double-click StandardConfiguration (object).
  2. View the standard configuration object.
    Note: Since there can be multiple standard configurations in a model, the standard configuration object is part of a collection.


    Figure 3. A snippet of the StandardConfiguration object which shows the Parent collection list.
  3. Click the SolutionConfigurationCollection hyperlink to navigate to the SolutionConfigurationCollection description.
    Note: The application project contains the StandardConfiguration.


    Figure 4. A snippet of the SolutionConfigurationCollection which shows the Usage locations (collections).
    The prepending syntax is as follows.
    Project.SolutionConfigurations
  4. Go back to SolutionConfigurationCollection in the integrated help.
    Note: The Index list indicates you can reference the specific StandardConfiguration through indexing with the use of a number or a string.


    Figure 5. A snippet of the SolutionConfigurationCollection which shows the Index list.
  5. Create a separate handle for the configuration.
    this_config = my_project.SolutionConfigurations[1]
    Tip: It is not necessary to create a separate handle for the StandardConfiguration, but is convenient for adding more configuration specific objects.
  6. Add the voltage source using the following syntax.
    my_voltage_source = thisConfig.Sources:AddVoltageSource(myPort)