MATLAB: How to add initial states to a circuit simulation

In summary, the SimPowerSystems library from simulink does not seem to work with circuits that have a powergui solver. When trying to add an initial current or voltage to a circuit, the simulation will give an error message that states the initial value is being ignored. However, when trying to calculate initial states, the powergui solver will get stuck at "Calculating stating variables."
  • #1
franciobr
13
0
Hello!

I am having trouble using the SimPowerSystems library from simulink to simulate circuits (with the powergui solver).
On all the circuits I have simulated so far either of the following happens:

- Adding the initial current/voltage directly at the RLC branch block culminates into an error message when I run the simulation that states that the initial value is being ignored.

- The powergui: "initial settings" menu either says that "There is no state variable at this model" or gets stuck at "Calculating stating variables" and displays a long warning message at the command window. The warning message is below.

It should be elementary to add initial states since there are apparently so many convenient ways of doing it (either directly at the block or at the powergui solver) but unfortunately none of them work! Please, any help would be much appreciated.

Thank you in advance!

Warning message shown:

> In C:\Program Files\MATLAB\R2012b\toolbox\physmod\powersys\powersys\private\power_init_pr.p>power_init_pr at 125
In power_init at 68
In C:\Program Files\MATLAB\R2012b\toolbox\physmod\powersys\powersys\private\power_initstates_pr.p>EvaluateTheModel at 636
In C:\Program Files\MATLAB\R2012b\toolbox\physmod\powersys\powersys\private\power_initstates_pr.p>power_initstates_pr at 35
In power_initstates at 24
In C:\Program Files\MATLAB\R2012b\toolbox\physmod\powersys\powersys\powergui.p>InitialStatesSettingButton_Callback at 132
In C:\Program Files\MATLAB\R2012b\toolbox\physmod\powersys\powersys\powergui.p>powergui at 87
 
Physics news on Phys.org
  • #3
Good idea, just submitted the request. Anyway, if anybody has the workaround for this problem any help is appreciated.
 

1. What is MATLAB and how is it used for circuit simulations?

MATLAB is a powerful software tool used for numerical computing and data visualization. It allows users to perform complex mathematical calculations, create and manipulate arrays and matrices, and plot data. In the context of circuit simulations, MATLAB can be used to model and analyze the behavior of electronic circuits.

2. How do I add initial states to a circuit simulation in MATLAB?

To add initial states to a circuit simulation in MATLAB, you can use the "initial" function. This function takes in the circuit's initial conditions, such as the initial voltage or current values, and incorporates them into the simulation. You can also specify the time span for the simulation and any other parameters that may affect the circuit's behavior.

3. Can I import a circuit from external software into MATLAB for simulation?

Yes, you can import circuits from external software, such as SPICE, into MATLAB for simulation. MATLAB has a built-in function called "readspice" that allows you to import SPICE netlists and convert them into a format that can be used for circuit simulations. This feature makes it easier to use models and circuits created in other software tools within MATLAB.

4. What are the benefits of using MATLAB for circuit simulations?

MATLAB offers several benefits for circuit simulations, including a user-friendly interface, a wide range of built-in functions and tools, and the ability to customize and automate simulations. It also has a robust set of visualization tools, allowing users to easily plot and analyze simulation results. Additionally, MATLAB's powerful computing capabilities make it well-suited for handling complex circuit simulations.

5. Is MATLAB the only software tool available for circuit simulations?

No, there are several other software tools available for circuit simulations, such as SPICE, LTspice, and PSpice. However, MATLAB offers a unique combination of features and capabilities, making it a popular choice for circuit simulations among scientists and engineers. It is also commonly used in academic and industrial settings, making it a valuable tool for collaboration and research.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
8K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Introductory Physics Homework Help
Replies
11
Views
763
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top