Couple Caspoc to Simulink
Combine the easy modeling and simulation speed of Caspoc with the toolboxes in Matlab/Simulink!
The advantages of the combined Caspoc-Simulink simulation is the modeling of the control in Matlab/Simulink that is connected with the circuit simulator Caspoc modeling the Power Electronics and Electrical Drive.
To understand the advantages of a combined simulation the strengths of Simulink and Caspoc have to be emphasized.
Where Simulink is thanks to the various toolboxes good in modelling and simulation of the control systems, it lacks support for power electronics simulation. Also the recently developed Power Systems toolbox didn't meet the goals many power electronics engineers have in mind. It lacks especially the component models, speed and accuracy of the simulation. Due to the numerical integration method and network calculation method used, the power toolbox suffers from the algebraic loop. It requires that a parasitic inductance and or capacitance be added to the circuit, which increases the order of the system. One of the strong features of Matlab/Simulink are the toolboxes such as the Control toolbox with detailed description of several control methods.
On the other side Caspoc was developed dedicated to the simulation and animation of power electronics and electrical drives. It is therefore much better suited for the simulation of switching circuits with highly non-linear switching models. However it is possible to combine both simulations through the open interfaces in both Simulink and Caspoc. Combination of both simulation packages seems to be advantageous for educational purpose too. Students are on one side familiar with the Simulink from the basic curricula. Caspoc is very easy to handle and learn in a short time.
Model in ANSI C code without external compiler
Create your own models using ANSI C Code without an external compiler!
The advantages of the C Code is that you can create any type of model and use it in the simulation. No external compiler is required, so that makes it very easy to use!
Local variable can be defied outside the main function as is done in lines 1 and 2. There has to be one main function with opening and closing braces, see lines 3,4 and 8. The variable a is defined as being the input of the block. It doesn't have to be declared, as it is done automatically by Caspoc as a local variable that is defined inside the scope of the main function. The argument of the return function, in this case y in line 7, is the output of the block.

The blocks Cscript2, Cscript3, ... Cscript20 have more inputs labeled from "a" until "t"

Inside the Cscript block you can use loops like for, while do and if-then-else structures. Functions can be called recursively and you can pass local variables as function arguments.
Features of Cscript include:
Parameterized functions with local variables
The if statement
The do-while, while, and for loops
Integer and character variables
Global variables
Integer and character constants
String constants (limited implementation)
The return statement, both with and without a value
A limited number of standard library functions
Operators: +, -, *, / , %, <, >, <=, >=, ==, !=, unary -, unary +, *=, +=, -=, /=, &=, |= and ^=
Support for && and || in comparisons
Functions returning integers
Comments // and /* */
copyright 2009-2011 Real-Time I.T.S. Co.,Ltd.