## Modelica.Electrical.MultiPhase.Basic

Basic components for electrical multiphase models

### Information

This package contains basic analog electrical multiphase components.

Main Authors:
  Anton Haumer
  Technical Consulting & Electrical Engineering
  A-3423 St.Andrae-Woerdern
  Austria
  email: a.haumer@haumer.at

Release Notes:
  - v1.00 2004/06/25 Anton Haumer

Copyright:
  Copyright © 1998-2004, Modelica Association and Anton Haumer.
  The Modelica package is free software; it can be redistributed and/or modified under the terms of the Modelica license, see the license conditions and the accompanying disclaimer in the documentation of package Modelica in file "Modelica/package.mo".

Name | Description
--- | ---
Star | Star-connection
Delta | Delta (polygon) connection
PlugToPin_p | Connect one (positive) Pin to a Plug Connector
PlugToPin_n | Connect one (negative) Pin to a Plug connector
Resistor | Ideal linear electrical resistors
Conductor | Ideal linear electrical conductors
Capacitor | Ideal linear electrical capacitors
Inductor | Ideal linear electrical inductors
SaturatingInductor | Simple model of inductors with saturation
Transformer | Multiphase Transformer
VariableResistor | Ideal linear electrical resistors with variable resistance
VariableConductor | Ideal linear electrical conductors with variable conductance
VariableCapacitor | Ideal linear electrical capacitors with variable capacitance
VariableInductor | Ideal linear electrical inductors with variable inductance

## Modelica.Electrical.MultiPhase.Basic.Star

Star-connection

### Information

Connects all pins of plug_p to pin_n, thus establishing a so-called star-connection.

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases

### Modelica definition

    model Star "Star-connection"
      parameter Integer m(final min=1) = 3 "number of phases";
      Interfaces.PositivePlug plug_p(
                                     final m=m);
      Modelica.Electrical.Analog.Interfaces.NegativePin pin_n;
    equation
      for j in 1:m loop
        connect(plug_p.pin[j],pin_n);
      end for;
    end Star;

## Modelica.Electrical.MultiPhase.Basic.Delta

Delta (polygon) connection

### Information

Connects in a cyclic way plug_n.pin[j] to plug_p.pin[j+1], thus establishing a so-called delta (or polygon) connection when used in parallel to another component.

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases

### Modelica definition

    model Delta "Delta (polygon) connection"
      parameter Integer m(final min=2) = 3 "number of phases";
      Interfaces.PositivePlug plug_p(
                                     final m=m);
      Interfaces.NegativePlug plug_n(
                                     final m=m);
    equation
      for j in 1:m loop
        if j<m then
          connect(plug_n.pin[j],plug_p.pin [j+1]);
        else
          connect(plug_n.pin[j],plug_p.pin [1]);
        end if;
      end for;
    end Delta;

## Modelica.Electrical.MultiPhase.Basic.PlugToPin_p

Connect one (positive) Pin to a Plug Connector

### Information

Connects pin k of plug_p to pin_p, leaving the other pins of plug_p unconnected.

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases
k | 1 | phase index

### Modelica definition

    model PlugToPin_p "Connect one (positive) Pin to a Plug Connector"
      parameter Integer m(final min=1) = 3 "number of phases";
      parameter Integer k(
        final min=1,
        final max=m) = 1 "phase index";
      Interfaces.PositivePlug plug_p(
                                     final m=m);
      Modelica.Electrical.Analog.Interfaces.PositivePin pin_p;
    equation
      pin_p.v = plug_p.pin[k].v;
      for j in 1:m loop
        plug_p.pin[j].i = if j == k then -pin_p.i else 0;
      end for;
    end PlugToPin_p;

## Modelica.Electrical.MultiPhase.Basic.PlugToPin_n

Connect one (negative) Pin to a Plug connector

### Information

Connects pin k of plug_n to pin_n, leaving the other pins of plug_n unconnected.

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases
k | 1 | phase index

### Modelica definition

    model PlugToPin_n "Connect one (negative) Pin to a Plug connector"
      parameter Integer m(final min=1) = 3 "number of phases";
      parameter Integer k(
        final min=1,
        final max=m) = 1 "phase index";
      Interfaces.NegativePlug plug_n(
                                     final m=m);
      Modelica.Electrical.Analog.Interfaces.NegativePin pin_n;
    equation
      pin_n.v = plug_n.pin[k].v;
      for j in 1:m loop
        plug_n.pin[j].i = if j == k then -pin_n.i else 0;
      end for;
    end PlugToPin_n;

## Modelica.Electrical.MultiPhase.Basic.Resistor

Ideal linear electrical resistors

### Information

Contains m resistors (Modelica.Electrical.Analog.Basic.Resistor)

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases
R[m] | fill(1, m) | Resistance [Ohm]

### Modelica definition

    model Resistor "Ideal linear electrical resistors"
      extends Interfaces.TwoPlug;
      parameter Modelica.SIunits.Resistance R[       m]=fill(1, m) "Resistance";
      Modelica.Electrical.Analog.Basic.Resistor resistor[
                                                         m](final R=R);
    equation
      connect(resistor.p, plug_p.pin);
      connect(resistor.n, plug_n.pin);
    end Resistor;

## Modelica.Electrical.MultiPhase.Basic.Conductor

Ideal linear electrical conductors

### Information

Contains m conductors (Modelica.Electrical.Analog.Basic.Conductor)

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases
G[m] | fill(1, m) | Conductance [Ohm]

### Modelica definition

    model Conductor "Ideal linear electrical conductors"
      extends Interfaces.TwoPlug;
      parameter Modelica.SIunits.Resistance G[       m]=fill(1, m) "Conductance";
      Modelica.Electrical.Analog.Basic.Conductor conductor[
                                                           m](final G=G);
    equation
      connect(plug_p.pin, conductor.p);
      connect(plug_n.pin, conductor.n);
    end Conductor;

## Modelica.Electrical.MultiPhase.Basic.Capacitor

Ideal linear electrical capacitors

### Information

Contains m capacitors (Modelica.Electrical.Analog.Basic.Capacitor)

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases
C[m] | fill(1, m) | Capacitance [F]

### Modelica definition

    model Capacitor "Ideal linear electrical capacitors"
      extends Interfaces.TwoPlug;
      parameter Modelica.SIunits.Capacitance C[       m]=fill(1, m) "Capacitance";
      Modelica.Electrical.Analog.Basic.Capacitor capacitor[
                                                           m](final C=C);
    equation
      connect(capacitor.p, plug_p.pin);
      connect(capacitor.n, plug_n.pin);
    end Capacitor;

## Modelica.Electrical.MultiPhase.Basic.Inductor

Ideal linear electrical inductors

### Information

Contains m inductors (Modelica.Electrical.Analog.Basic.Inductor)

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases
L[m] | fill(1, m) | Inductance [H]

### Modelica definition

    model Inductor "Ideal linear electrical inductors"
      extends Interfaces.TwoPlug;
      parameter Modelica.SIunits.Inductance L[       m]=fill(1, m) "Inductance";
      Modelica.Electrical.Analog.Basic.Inductor inductor[
                                                         m](final L=L);
    equation
      connect(inductor.p, plug_p.pin);
      connect(inductor.n, plug_n.pin);
    end Inductor;

## Modelica.Electrical.MultiPhase.Basic.SaturatingInductor

Simple model of inductors with saturation

### Information

Contains m saturating inductors (Modelica.Electrical.Analog.Basic.SaturatingInductor)

Attention!!!
Each element of the array of saturatingInductors is only dependent on the current flowing through this element.

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases
Inom[m] | fill(1, m) | Nominal current [A]
Lnom[m] | fill(1, m) | Nominal inductance at Nominal current [H]
Lzer[m] | {2*Lnom[j] for j in 1:m} | Inductance near current=0 [H]
Linf[m] | {Lnom[j]/2 for j in 1:m} | Inductance at large currents [H]

### Modelica definition

    model SaturatingInductor "Simple model of inductors with saturation"
      extends Interfaces.TwoPlug;
      parameter Modelica.SIunits.Current Inom[       m]=fill(1,m) "Nominal current";
      parameter Modelica.SIunits.Inductance Lnom[       m]=fill(1,m)
        "Nominal inductance at Nominal current";
      parameter Modelica.SIunits.Inductance Lzer[       m]={2*Lnom[j] for j in 1:m}
        "Inductance near current=0";
      parameter Modelica.SIunits.Inductance Linf[       m]={Lnom[j]/2 for j in 1:m}
        "Inductance at large currents";
      Modelica.Electrical.Analog.Basic.SaturatingInductor saturatingInductor[
                                                                             m](
        final Inom=Inom,
        final Lnom=Lnom,
        final Lzer=Lzer,
        final Linf=Linf);
    equation
      connect(saturatingInductor.p, plug_p.pin);
      connect(saturatingInductor.n, plug_n.pin);
    end SaturatingInductor;

## Modelica.Electrical.MultiPhase.Basic.Transformer

Multiphase Transformer

### Information

Contains m transformers (Modelica.Electrical.Analog.Basic.Transformer)

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases
L1[m] | fill(1, m) | Primary inductance [H]
L2[m] | fill(1, m) | Secondary inductance [H]
M[m] | fill(1, m) | Coupling inductance [H]

### Modelica definition

    model Transformer "Multiphase Transformer"
      extends Interfaces.FourPlug;
      parameter Modelica.SIunits.Inductance L1[       m]=fill(1, m) "Primary inductance";
      parameter Modelica.SIunits.Inductance L2[       m]=fill(1, m) "Secondary inductance";
      parameter Modelica.SIunits.Inductance M[       m]=fill(1, m) "Coupling inductance";
      Modelica.Electrical.Analog.Basic.Transformer transformer[
                                                               m](
        final L1=L1,
        final L2=L2,
        final M=M);
    equation

      connect(plug_p1.pin, transformer.p1);
      connect(plug_p2.pin, transformer.p2);
      connect(plug_n1.pin, transformer.n1);
      connect(plug_n2.pin, transformer.n2);
    end Transformer;

## Modelica.Electrical.MultiPhase.Basic.VariableResistor

Ideal linear electrical resistors with variable resistance

### Information

Contains m variable resistors (Modelica.Electrical.Analog.Basic.VariableResistor)

Attention!!!
It is recomended that none of the R_Port signals should not cross the zero value. Otherwise depending on the surrounding circuit the probability of singularities is high.

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases

### Modelica definition

    model VariableResistor
      "Ideal linear electrical resistors with variable resistance"
      extends Interfaces.TwoPlug;
      Modelica.Blocks.Interfaces.InPort R_Port(
                                               final n=m);
      Modelica.Electrical.Analog.Basic.VariableResistor variableResistor[
                                                                         m];
    equation
      variableResistor.R_Port.signal[1]=R_Port.signal;
      connect(variableResistor.p, plug_p.pin);
      connect(variableResistor.n, plug_n.pin);
    end VariableResistor;

## Modelica.Electrical.MultiPhase.Basic.VariableConductor

Ideal linear electrical conductors with variable conductance

### Information

Contains m variable conductors (Modelica.Electrical.Analog.Basic.VariableConductor)

Attention!!!
It is recomended that none of the G_Port signals should not cross the zero value. Otherwise depending on the surrounding circuit the probability of singularities is high.

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases

### Modelica definition

    model VariableConductor
      "Ideal linear electrical conductors with variable conductance"
      extends Interfaces.TwoPlug;
      Modelica.Blocks.Interfaces.InPort G_Port(
                                               final n=m);
      Modelica.Electrical.Analog.Basic.VariableConductor variableConductor[
                                                                           m];
    equation
      variableConductor.G_Port.signal[1]=G_Port.signal;
      connect(variableConductor.p, plug_p.pin);
      connect(variableConductor.n, plug_n.pin);
    end VariableConductor;

## Modelica.Electrical.MultiPhase.Basic.VariableCapacitor

Ideal linear electrical capacitors with variable capacitance

### Information

Contains m variable capacitors (Modelica.Electrical.Analog.Basic.VariableCapacitor)

It is required that each C_Port.signal ≥ 0, otherwise an assertion is raised. To avoid a variable index system,
C = Cmin, if 0 ≤ C_Port.signal < Cmin, where Cmin is a parameter with default value Modelica.Constants.eps.

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases
Cmin[m] | fill(Modelica.Constants.eps,... | [F]

### Modelica definition

    model VariableCapacitor
      "Ideal linear electrical capacitors with variable capacitance"
      extends Interfaces.TwoPlug;
      parameter Modelica.SIunits.Capacitance Cmin[       m]=fill(Modelica.Constants.eps,m);
      Modelica.Blocks.Interfaces.InPort C_Port(
                                               final n=m);
      Modelica.Electrical.Analog.Basic.VariableCapacitor variableCapacitor[
                                                                           m](final Cmin
          =    Cmin);
    equation
      variableCapacitor.C_Port.signal[1]=C_Port.signal;
      connect(variableCapacitor.p, plug_p.pin);
      connect(variableCapacitor.n, plug_n.pin);
    end VariableCapacitor;

## Modelica.Electrical.MultiPhase.Basic.VariableInductor

Ideal linear electrical inductors with variable inductance

### Information

Contains m variable inductors (Modelica.Electrical.Analog.Basic.VariableInductor)

It is required that each L_Port.signal ≥ 0, otherwise an assertion is raised. To avoid a variable index system,
L = Lmin, if 0 ≤ L_Port.signal < Lmin, where Lmin is a parameter with default value Modelica.Constants.eps.

### Parameters

Name | Default | Description
--- | --- | ---
m | 3 | number of phases
Lmin[m] | fill(Modelica.Constants.eps,... | [H]

### Modelica definition

    model VariableInductor
      "Ideal linear electrical inductors with variable inductance"
      extends Interfaces.TwoPlug;
      parameter Modelica.SIunits.Inductance Lmin[       m]=fill(Modelica.Constants.eps,m);
      Modelica.Blocks.Interfaces.InPort L_Port(
                                               final n=m);
      Modelica.Electrical.Analog.Basic.VariableInductor variableInductor[
                                                                         m](final Lmin
          =    Lmin);
    equation
      variableInductor.L_Port.signal[1]=L_Port.signal;
      connect(variableInductor.p, plug_p.pin);
      connect(variableInductor.n, plug_n.pin);
    end VariableInductor;