Scicos Block
fr - eng

##
Electrical AC voltage source

### Contents

- Electrical AC voltage source
  - Description
  - Dialog box
  - Default properties
  - Interfacing function
  - Modelica model

### Description

This component is an AC voltage source with sinosoid output voltage. The amplitude and the frequency of the output voltage is set by the user. The ohmic resistance of this block is zero.

### Dialog box

Set voltage source parameter |
Amplitude (Volt) | 220
Frequency (Hz) | 50

- Amplitude (Volt) : Type 'vec' of size -1. Amplitude of the output sinosoid voltage
- Frequency (Hz) : Type 'vec' of size -1. Frequency of the output sinosoid voltage

### Default properties

- always active: no
- direct-feedthrough: yes
- zero-crossing: no
- mode: no
- number/sizes of inputs: 1 / 1
- number/sizes of outputs: 1 / 1
- number/sizes of activation inputs: 0 /
- number/sizes of activation outputs: 0 /
- continuous-time state: no
- discrete-time state: no
- name of modelica function: VsourceAC

### Interfacing function

`VsourceAC.sci`

### Modelica model

    class VsourceAC "Sin-wave voltage source"
    	Pin p, n;
    	Real v;
    	parameter Real VA = 220 "Amplitude";
    	parameter Real f = 50 "Frequency";
    	parameter Real PI=3.141592653589793;
    equation
    	v = VA*Modelica.Math.sin(2*PI*f*time);
    	v = p.v - n.v;
    	0 = p.i + n.i;
    end VsourceAC;