## Saturday, 29 October 2011

### Getting Started with Simulink: Simple Power calculations

Getting Started with Simulink: Simple Power calculations

In this small example, we will calculate the instantaneous power along with average rms power and voltage using simulink when equation of V and I are given.

Problem:
if v(t)=10cos(120πt+30) and i(t)=6cos(120πt+60).Determine the average power and rms value of v(t).

Formulas Used:
As we know instantaneous power is given as
$P(t)=v(t) i(t)$
and average power is given as
$P_{avg}=\frac{1}{T} \int_0^T{P(t)dt}$
similarly rms voltage is given as
$V_{rms}=\sqrt {\frac{1}{T} \int_0^T{V^2(t)dt}}$
where T is an integer multiple of timeperiod.

Source Creation:
First we will create two sin sources V and I and adjust their parameter to match the problem
V Source:
Amplitude: 10
freq:          60
phase:       pi/6
sample time: 0.01

I Source:
Amplitude:  6
freq:          60
phase:       pi/3
sample time: 0.01

RMS Voltage
we will simple follow the equation of Vrms for the calculation.
1. first put a math function block, double click on it and change the equation as u^2
connect this block's input from the output of V source.
Output of this block represent V^2
2. Now put a integrator block and connect the input of it from V^2. The output represents $\int_0^T{V^2(t)dt}$
3. Now put a divider block and connect the output of integrator to its input.
Output of this block represents                    $\frac{1}{T} \int_0^T{V^2(t)dt}$
4. Put a math function block, double click on it and change the equation as sqrt. Now connect this to
the output of step3.
5. Put a display block and connect the step4 output to it.

 Fig1: Simulink model for RMS Voltage calculation
Instantaneous Power
Calculation of Inst, Power is very simple. Just multiply the V and I source and put a scope block to display it.
 Fig2: Inst. Power
Average Power
Again Average Power calculation is simple and follows from RMS Voltage calculation. Put an integrator and divide block after the instant. power and connect it with the display block.
.

#### 1 comment:

1. you should integrate 1 then divide it.