within ;
package ComplexLib
"Library for steady-state analysis of AC circuits within phasor domain, version 1.0"
annotation (
Documentation(info="
This library contains electrical components suitable for steady-state
analysis of AC circuits with fixed frequency (analysis within phasor
domain using so-called time phasors).
Under special assumptions, the library can also be used to investigate AC
circuits in the quasi-stationary mode.
An introduction is given e.g. in O. Enge, C. Clauß, P. Schneider,
P. Schwarz, M. Vetter, S. Schwunk:
Quasi-stationary AC analysis using phasor description with Modelica.
5th Int. Modelica Conf., Vienna, Austria, September 4-5, 2006,
Proc. pp. 579-588.
Main Authors:
Olaf Enge-Rosenblatt (and partially Christoph Clauß)
Fraunhofer Institut Integrierte Schaltungen
Institutsteil Entwurfsautomatisierung IIS/EAS
Zeunerstraße 38
01069 Dresden
Germany
email: olaf.enge@eas.iis.fraunhofer.de
Matthias Vetter, Simon Schwunk
Fraunhofer Institut Solare Energiesysteme ISE
Heidenhofstraße 2
79110 Freiburg
Germany
email: matthias.vetter@ise.fraunhofer.de
"), uses(Modelica(version="3.0")));
import SI = Modelica.SIunits;
package UsersGuide "User's Guide of ComplexLib"
annotation (__Dymola_DocumentationClass=true, Documentation(info="
The package ComplexLib is a free Modelica library for
steady-state analysis of linear AC circuits with fixed frequency.
In this context, an AC circuit is understood as a set of components which
are coupled galvanically among each other.
The package provides model components with certain interface definitions.
The behavior of the electrical components is described using phasor domain
(so-called time phasors).
Under special assumptions, the library can also be used to investigate AC
circuits in the quasi-stationary mode (see package Quasi-stationary mode
for more information).
Some components are electromechanical ones.
In these cases, the electrical subsystem is modelled within the phasor domain
while the mechanical subsystem is described using time domain.
The package ComplexLib is fully compatible with the Modelica Standard Library.
An introduction is given e.g. in O. Enge, C. Clauß, P. Schneider,
P. Schwarz, M. Vetter, S. Schwunk:
Quasi-stationary AC analysis using phasor description with Modelica.
5th Int. Modelica Conf., Vienna, Austria, September 4-5, 2006,
Proc. pp. 579-588.
This is a short User's Guide for the ComplexLib.
"));
class Overview "Overview of Complexlib"
annotation (Documentation(info="
The ComplexLib consists of the following main sub-libraries:
- SinglePhase: basic and special components for single-phase AC circuits
- MultiPhase: basic and special components for multi-phase AC circuits
(well-known is the three-phase system, other numbers of phases are possible)
- Machines: some basic electric AC induction machines (asynchronous and
synchronous type)
The packages Constants, Interfaces, SIunits and Math provide additional
sub-models and functions.
"));
end Overview;
class Connectors "Connectors"
annotation (__Dymola_DocumentationClass=true, Documentation(info="
The ComplexLib uses three kinds of connectors: one for phasor description of
single-phase AC circuits (ComplexPin), one for phasor description of
multi-phase AC circuits (ComplexPlug), and one for coupling with
components from rotational mechanics (Flange_a or Flange_b).
The phasor-based connectors are defined within the corresponding packages, see
- ComplexLib.SinglePhase.Interfaces.ComplexPin and
- ComplexLib.MultiPhase.Interfaces.ComplexPlug
The mechanical connector of the Modelica Standard Library is used for mechanical
subsystem in the package ComplexLib.Machines.
"));
end Connectors;
class QuasiStationaryMode "Quasi-stationary mode"
annotation (__Dymola_DocumentationClass=true, Documentation(info="
A quasi-stationary mode is usually not included within phasor domain method.
However under some special assumptions, such an approach is allowed which yields
enormous savings of simulation time.
The quasi-stationary mode shall be understood as a sequence of steady
states on the following condition: parameters (which would be constant at
steady-state analysis) may vary extraordinary slowly compared to the system's
dominant time constant T.
It is signalized by slow alterations of amplitudes and phases of the
sinusoidal quantities.
Usually, it is a good choise if the dynamic processes have time constants
higher than 10*T.
Attention!!!
Please note for the present release that there is no algorithm implemented to test
if variations of parameters are slow enough. Hence, this is still a task to be
done by user.
"));
end QuasiStationaryMode;
class Compatibility "Compatibility to Modelica Standard Library"
annotation (__Dymola_DocumentationClass=true, Documentation(info="
Phasor-domain description can be used for linear AC circuits, i.e. for electrical
systems the components of which are coupled galvanically among each other.
In case of an electromechanical system like an induction machine, the complete
electrical subsystem has to be described using phasor domain while the mechanical
subsystem is represented using time domain.
Hence, there is no need for compatibility to time-domain represented electrical
circuits.
However, mechanical subsystems are fully compatible to Modelica.Mechanics.Rotational.
"));
end Compatibility;
class Releases "Release notes"
class Version_1_0 "Version 1.0 (Mai 18, 2009)"
annotation (__Dymola_DocumentationClass=true, Documentation(info=
"
First official release of ComplexLib.
This release is fully equivalent to the former library Complex Version 3.3
which was developed within the internal Fraunhofer project GENSIM.
The main authors of the library are shown in the main information
on the very top as well as in the package Contact of the
User's Guide.
"));
end Version_1_0;
end Releases;
class License "The Modelica License 2"
annotation (Documentation(info="
This page contains the “Modelica License 2” which was
released by the Modelica Association on Nov. 19, 2008. It is used for
all material from the Modelica Association provided to the public
after this date. It is recommended that other providers of free
Modelica packages license their library also under “Modelica
License 2”. Additionally, this document contains a description
how to apply the license and has a “Frequently Asked Questions”
section.
The Modelica License 2
(in other formats:
standalone html,
pdf,
odt,
doc)
How to Apply the Modelica License 2
Frequently Asked Questions
The Modelica License 2
Preamble. The goal of this license is that Modelica related
model libraries, software, images, documents, data files etc. can be
used freely in the original or a modified form, in open source and in
commercial environments (as long as the license conditions below are
fulfilled, in particular sections 2c) and 2d). The Original Work is
provided free of charge and the use is completely at your own risk.
Developers of free Modelica packages are encouraged to utilize this
license for their work.
The Modelica License applies to any Original Work that contains the
following licensing notice adjacent to the copyright notice(s) for
this Original Work:
Licensed
by <name of Licensor> under the Modelica License 2
1.
Definitions.
“License” is this Modelica License.
“Original Work” is any work of authorship, including
software, images, documents, data files, that contains the above
licensing notice or that is packed together with a licensing notice
referencing it.
“Licensor” is the provider of the Original Work who has
placed this licensing notice adjacent to the copyright notice(s) for
the Original Work. The Original Work is either directly provided by
the owner of the Original Work, or by a licensee of the owner.
“Derivative Work” is any modification of the Original
Work which represents, as a whole, an original work of authorship.
For the matter of clarity and as examples:
Derivative Work shall not include work that remains separable from
the Original Work, as well as merely extracting a part of the
Original Work without modifying it.
Derivative Work shall not include (a) fixing of errors and/or (b)
adding vendor specific Modelica annotations and/or (c) using a
subset of the classes of a Modelica package, and/or (d) using a
different representation, e.g., a binary representation.
Derivative Work shall include classes that are copied from the
Original Work where declarations, equations or the documentation
are modified.
Derivative Work shall include executables to simulate the models
that are generated by a Modelica translator based on the Original
Work (of a Modelica package).
“Modified Work” is any modification of the Original Work
with the following exceptions: (a) fixing of errors and/or (b)
adding vendor specific Modelica annotations and/or (c) using a
subset of the classes of a Modelica package, and/or (d) using a
different representation, e.g., a binary representation.
"Source Code" means the preferred form of the Original
Work for making modifications to it and all available documentation
describing how to modify the Original Work.
“You” means an individual or a legal entity exercising
rights under, and complying with all of the terms of, this License.
“Modelica package” means any Modelica library that is
defined with the
“package
<Name> ... end
<Name>;“ Modelica language element.
2. Grant of Copyright License. Licensor grants You a
worldwide, royalty-free, non-exclusive, sublicensable license, for
the duration of the copyright, to do the following:
To reproduce the Original Work in copies, either alone or as part of
a collection.
To create Derivative Works according to Section 1d) of this License.
To distribute or communicate to the public copies of the Original
Work or a Derivative Work under this License. No
fee, neither as a copyright-license fee, nor as a selling fee for
the copy as such may be charged under this License. Furthermore, a
verbatim copy of this License must be included in any copy of the
Original Work or a Derivative Work under this License.
For
the matter of clarity, it is permitted A) to distribute or
communicate such copies as part of a (possible commercial)
collection where other parts are provided under different licenses
and a license fee is charged for the other parts only and B) to
charge for mere printing and shipping costs.
To distribute or communicate to the public copies of a Derivative
Work, alternatively to Section 2c), under any other license
of your choice, especially also under a license for
commercial/proprietary software, as long as You comply with Sections
3, 4 and 8 below.
For the matter of clarity, no
restrictions regarding fees, either as to a copyright-license fee or
as to a selling fee for the copy as such apply.
To perform the Original Work publicly.
To display the Original Work publicly.
3. Acceptance. Any use of the Original Work or a
Derivative Work, or any action according to either Section 2a) to 2f)
above constitutes Your acceptance of this License.
4. Designation of Derivative Works and of Modified Works.
The identifying designation of Derivative Work and of Modified
Work must be different to the corresponding identifying designation
of the Original Work. This means especially that the (root-level)
name of a Modelica package under this license must be changed if the
package is modified (besides fixing of errors, adding vendor specific
Modelica annotations, using a subset of the classes of a Modelica
package, or using another representation, e.g. a binary
representation).
5. Grant of Patent License.
Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license,
under patent claims owned by the Licensor or licensed to the Licensor by
the owners of the Original Work that are embodied in the Original Work
as furnished by the Licensor, for the duration of the patents,
to make, use, sell, offer for sale, have made, and import the Original Work
and Derivative Works under the conditions as given in Section 2.
For the matter of clarity, the license regarding Derivative Works covers
patent claims to the extent as they are embodied in the Original Work only.
6. Provision of Source Code. Licensor agrees to provide
You with a copy of the Source Code of the Original Work but reserves
the right to decide freely on the manner of how the Original Work is
provided.
For the matter of clarity, Licensor might provide only a binary
representation of the Original Work. In that case, You may (a) either
reproduce the Source Code from the binary representation if this is
possible (e.g., by performing a copy of an encrypted Modelica
package, if encryption allows the copy operation) or (b) request the
Source Code from the Licensor who will provide it to You.
7. Exclusions from License Grant. Neither the names of
Licensor, nor the names of any contributors to the Original Work, nor
any of their trademarks or service marks, may be used to endorse or
promote products derived from this Original Work without express
prior permission of the Licensor. Except as otherwise expressly
stated in this License and in particular in Sections 2 and 5, nothing
in this License grants any license to Licensor’s trademarks,
copyrights, patents, trade secrets or any other intellectual
property, and no patent license is granted to make, use, sell, offer
for sale, have made, or import embodiments of any patent claims.
No license is granted to the trademarks of
Licensor even if such trademarks are included in the Original Work,
except as expressly stated in this License. Nothing in this License
shall be interpreted to prohibit Licensor from licensing under terms
different from this License any Original Work that Licensor otherwise
would have a right to license.
8. Attribution Rights. You must retain in the Source
Code of the Original Work and of any Derivative Works that You
create, all author, copyright, patent, or trademark notices, as well
as any descriptive text identified therein as an "Attribution
Notice". The same applies to the licensing notice of this
License in the Original Work. For the matter of clarity, “author
notice” means the notice that identifies the original
author(s).
You must cause the Source Code for any Derivative
Works that You create to carry a prominent Attribution Notice
reasonably calculated to inform recipients that You have modified the
Original Work.
In case the Original Work or Derivative Work is not provided in
Source Code, the Attribution Notices shall be appropriately
displayed, e.g., in the documentation of the Derivative Work.
9. Disclaimer
of Warranty.
The Original Work is provided under this
License on an "as is" basis and without warranty, either
express or implied, including, without limitation, the warranties of
non-infringement, merchantability or fitness for a particular
purpose. The entire risk as to the quality of the Original Work is
with You. This disclaimer of warranty constitutes an
essential part of this License. No license to the Original Work is
granted by this License except under this disclaimer.
10. Limitation of Liability. Under no circumstances and
under no legal theory, whether in tort (including negligence),
contract, or otherwise, shall the Licensor, the owner or a licensee
of the Original Work be liable to anyone for any direct, indirect,
general, special, incidental, or consequential damages of any
character arising as a result of this License or the use of the
Original Work including, without limitation, damages for loss of
goodwill, work stoppage, computer failure or malfunction, or any and
all other commercial damages or losses. This limitation of liability
shall not apply to the extent applicable law prohibits such
limitation.
11. Termination. This License conditions your rights to
undertake the activities listed in Section 2 and 5, including your
right to create Derivative Works based upon the Original Work, and
doing so without observing these terms and conditions is prohibited
by copyright law and international treaty. Nothing in this License is
intended to affect copyright exceptions and limitations. This License
shall terminate immediately and You may no longer exercise any of the
rights granted to You by this License upon your failure to observe
the conditions of this license.
12. Termination for Patent Action. This License shall
terminate automatically and You may no longer exercise any of the
rights granted to You by this License as of the date You commence an
action, including a cross-claim or counterclaim, against Licensor,
any owners of the Original Work or any licensee alleging that the
Original Work infringes a patent. This termination provision shall
not apply for an action alleging patent infringement through
combinations of the Original Work under combination with other
software or hardware.
13. Jurisdiction. Any action or suit relating to this
License may be brought only in the courts of a jurisdiction wherein
the Licensor resides and under the laws of that jurisdiction
excluding its conflict-of-law provisions. The application of the
United Nations Convention on Contracts for the International Sale of
Goods is expressly excluded. Any use of the Original Work outside the
scope of this License or after its termination shall be subject to
the requirements and penalties of copyright or patent law in the
appropriate jurisdiction. This section shall survive the termination
of this License.
14. Attorneys’ Fees. In any action to enforce the
terms of this License or seeking damages relating thereto, the
prevailing party shall be entitled to recover its costs and expenses,
including, without limitation, reasonable attorneys' fees and costs
incurred in connection with such action, including any appeal of such
action. This section shall survive the termination of this License.
15. Miscellaneous.
If any
provision of this License is held to be unenforceable, such
provision shall be reformed only to the extent necessary to make it
enforceable.
No verbal
ancillary agreements have been made. Changes and additions to this
License must appear in writing to be valid. This also applies to
changing the clause pertaining to written form.
You may use the
Original Work in all ways not otherwise restricted or conditioned by
this License or by law, and Licensor promises not to interfere with
or be responsible for such uses by You.
How to Apply the Modelica License 2
At the top level of your Modelica package and at every important
subpackage, add the following notices in the info layer of the
package:
|
Licensed by <Licensor> under the Modelica License 2
Copyright © <year1>-<year2>, <name of copyright
holder(s)>.
|
|
This Modelica package is free software and
the use is completely at your own risk;
it can be redistributed and/or modified under the terms of the
Modelica license 2, see the license conditions (including the
disclaimer of warranty)
here
or at
http://www.modelica.org/licenses/ModelicaLicense2.
|
Include
a copy of the Modelica License 2 under
<library>.UsersGuide.ModelicaLicense2
(use
http://www.modelica.org/licenses/ModelicaLicense2.mo). Furthermore, add
the list of authors and contributors under
<library>.UsersGuide.Contributors or
<library>.UsersGuide.Contact.
For
example, sublibrary Modelica.Blocks of the Modelica Standard Library
may have the following notices:
|
Licensed by Modelica Association under the Modelica License 2
Copyright © 1998-2008, Modelica Association.
|
|
This Modelica package is free software and
the use is completely at your own risk;
it can be redistributed and/or modified under the terms of the
Modelica license 2, see the license conditions (including the
disclaimer of warranty)
here
or at
http://www.modelica.org/licenses/ModelicaLicense2.
|
For
C-source code and documents, add similar notices in the corresponding
file.
For
images, add a “readme.txt” file to the directories where
the images are stored and include a similar notice in this file.
In
these cases, save a copy of the Modelica License 2 in one directory
of the distribution, e.g.,
http://www.modelica.org/licenses/ModelicaLicense2.html
in directory <library>/help/documentation/ModelicaLicense2.html.
Frequently Asked Questions
This section contains questions/answer to users and/or distributors of
Modelica packages and/or documents under Modelica License 2. Note,
the answers to the questions below are not a legal interpretation of
the Modelica License 2. In case of a conflict, the language of the
license shall prevail.
Using or Distributing a Modelica Package under the Modelica License 2
What are the main
differences to the previous version of the Modelica License?
Modelica License 1 is unclear whether the licensed Modelica package
can be distributed under a different license. Version 2 explicitly
allows that “Derivative Work” can be distributed under
any license of Your choice, see examples in Section 1d) as to what
qualifies as Derivative Work (so, version 2 is clearer).
If You modify a Modelica package under Modelica License 2 (besides
fixing of errors, adding vendor specific Modelica annotations, using
a subset of the classes of a Modelica package, or using another
representation, e.g., a binary representation), you must rename the
root-level name of the package for your distribution. In version 1
you could keep the name (so, version 2 is more restrictive). The
reason of this restriction is to reduce the risk that Modelica
packages are available that have identical names, but different
functionality.
Modelica License 1 states that “It is not allowed to charge a
fee for the original version or a modified version of the software,
besides a reasonable fee for distribution and support“.
Version 2 has a similar intention for all Original Work under
Modelica License 2 (to remain free of charge and open source)
but states this more clearly as “No fee, neither as a
copyright-license fee, nor as a selling fee for the copy as such may
be charged”. Contrary to version 1, Modelica License 2 has no
restrictions on fees for Derivative Work that is provided under a
different license (so, version 2 is clearer and has fewer
restrictions).
Modelica License 2 introduces several useful provisions for the
licensee (articles 5, 6, 12), and for the licensor (articles 7, 12,
13, 14) that have no counter part in version 1.
Modelica License 2 can be applied to all type of work, including
documents, images and data files, contrary to version 1 that was
dedicated for software only (so, version 2 is more general).
Can I distribute a
Modelica package (under Modelica License 2) as part of my commercial
Modelica modeling and simulation environment?
Yes,
according to Section 2c). However, you are not allowed to charge a
fee for this part of your environment. Of course, you can charge for
your part of the environment.
Can I distribute a
Modelica package (under Modelica License 2) under a different
license?
No.
The license of an unmodified Modelica package cannot be changed
according to Sections 2c) and 2d). This means that you cannot sell
copies of it, any distribution has to be free of charge.
Can I distribute a
Modelica package (under Modelica License 2) under a different license
when I first encrypt the package?
No.
Merely encrypting a package does not qualify for Derivative Work and
therefore the encrypted package has to stay under Modelica License 2.
Can I distribute a
Modelica package (under Modelica License 2) under a different license
when I first add classes to the package?
No.
The package itself remains unmodified, i.e., it is Original Work, and
therefore the license for this part must remain under Modelica
License 2. The newly added classes can be, however, under a different
license.
Can
I copy a class out of a Modelica package (under Modelica License 2)
and include it unmodified in a Modelica package
under a commercial/proprietary license?
No,
according to article 2c). However, you can include model, block,
function, package, record and connector classes in your Modelica
package under Modelica License 2. This means that your
Modelica package could be under a commercial/proprietary license, but
one or more classes of it are under Modelica License 2.
Note, a
“type” class (e.g., type Angle = Real(unit=”rad”))
can be copied and included unmodified under a commercial/proprietary
license (for details, see the next question).
Can
I copy a type class or part of a model, block,
function, record, connector class, out of a Modelica package (under
Modelica License 2) and include it modified or unmodified in a
Modelica package under a commercial/proprietary
license
Yes,
according to article 2d), since this will in the end usually qualify
as Derivative Work. The reasoning is the following: A type class or
part of another class (e.g., an equation, a declaration, part of a
class description) cannot be utilized “by its own”. In
order to make this “usable”, you have to add additional
code in order that the class can be utilized. This is therefore
usually Derivative Work and Derivative Work can be provided under a
different license. Note, this only holds, if the additional code
introduced is sufficient to qualify for Derivative Work. Merely, just
copying a class and changing, say, one character in the documentation
of this class would be no Derivative Work and therefore the copied
code would have to stay under Modelica License 2.
Can
I copy a class out of a Modelica package (under Modelica License 2)
and include it in modified form in a
commercial/proprietary Modelica package?
Yes.
If the modification can be seen as a “Derivative Work”,
you can place it under your commercial/proprietary license. If the
modification does not qualify as “Derivative Work” (e.g.,
bug fixes, vendor specific annotations), it must remain under
Modelica License 2. This means that your Modelica package could be
under a commercial/proprietary license, but one or more parts of it
are under Modelica License 2.
Can I distribute a
“save total model” under my commercial/proprietary
license, even if classes under Modelica License 2 are included?
Your
classes of the “save total model” can be distributed
under your commercial/proprietary license, but the classes under
Modelica License 2 must remain under Modelica License 2. This means
you can distribute a “save total model”, but some parts
might be under Modelica License 2.
Can I distribute a
Modelica package (under Modelica License 2) in encrypted form?
Yes.
Note, if the encryption does not allow “copying” of
classes (in to unencrypted Modelica source code), you have to send
the Modelica source code of this package to your customer, if he/she
wishes it, according to article 6.
Can I distribute an
executable under my commercial/proprietary license, if the model from
which the executable is generated uses models from a Modelica package
under Modelica License 2?
Yes,
according to article 2d), since this is seen as Derivative Work. The
reasoning is the following: An executable allows the simulation of a
concrete model, whereas models from a Modelica package (without
pre-processing, translation, tool run-time library) are not able to
be simulated without tool support. By the processing of the tool and
by its run-time libraries, significant new functionality is added (a
model can be simulated whereas previously it could not be simulated)
and functionality available in the package is removed (e.g., to build
up a new model by dragging components of the package is no longer
poss" + "ible with the executable).
Is my modification to
a Modelica package (under Modelica License 2) a Derivative Work?
It
is not possible to give a general answer to it. To be regarded as "an
original work of authorship", a derivative work must be
different enough from the original or must contain a substantial
amount of new material. Making minor changes or additions of little
substance to a preexisting work will not qualify the work as a new
version for such purposes.
Using or Distributing a Modelica Document under the Modelica License 2
This
section is devoted especially for the following applications:
A Modelica tool extracts information out of a Modelica package and
presents the result in form of a “manual” for this
package in, e.g., html, doc, or pdf format.
The Modelica language specification is a document defining the
Modelica language. It will be licensed under Modelica License 2.
Someone writes a book about the Modelica language and/or Modelica
packages and uses information which is available in the Modelica
language specification and/or the corresponding Modelica package.
Can I sell a manual
that was basically derived by extracting information automatically
from a Modelica package under Modelica License 2 (e.g., a “reference
guide” of the Modelica Standard Library):
Yes.
Extracting information from a Modelica package, and providing it in a
human readable, suitable format, like html, doc or pdf format, where
the content is significantly modified (e.g. tables with interface
information are constructed from the declarations of the public
variables) qualifies as Derivative Work and there are no restrictions
to charge a fee for Derivative Work under alternative 2d).
Can
I copy a text passage out of a Modelica document (under Modelica
License 2) and use it unmodified in my document
(e.g. the Modelica syntax description in the Modelica Specification)?
Yes.
In case you distribute your document, the copied parts are still
under Modelica License 2 and you are not allowed to charge a license
fee for this part. You can, of course, charge a fee for the rest of
your document.
Can
I copy a text passage out of a Modelica document (under Modelica
License 2) and use it in modified form in my
document?
Yes,
the creation of Derivative Works is allowed. In case the content is
significantly modified this qualifies as Derivative Work and there
are no restrictions to charge a fee for Derivative Work under
alternative 2d).
Can I sell a printed
version of a Modelica document (under Modelica License 2), e.g., the
Modelica Language Specification?
No,
if you are not the copyright-holder, since article 2c) does not allow
a selling fee for a (in this case physical) copy. However, mere
printing and shipping costs may be recovered.
"));
end License;
class Contact "Contact"
annotation (Documentation(info="
- The Library ComplexLib was developed by
- Olaf Enge-Rosenblatt
Fraunhofer Institut Integrierte Schaltungen
Institutsteil Entwurfsautomatisierung IIS/EAS
Zeunerstraße 38
01069 Dresden
Germany
email: olaf.enge@eas.iis.fraunhofer.de
and
- Matthias Vetter, Simon Schwunk
Fraunhofer Institut Solare Energiesysteme ISE
Heidenhofstraße 2
79110 Freiburg
Germany
email: matthias.vetter@ise.fraunhofer.de
"));
end Contact;
end UsersGuide;
package Examples "Examples to demonstrate the usage of ComplexLib"
model RlcCircuit "Simple RLC circuit"
extends Modelica.Icons.Example;
ComplexLib.SinglePhase.Basic.Ground ground
annotation (Placement(transformation(extent={{-70,-40},{-50,-20}})));
ComplexLib.SinglePhase.Sources.SineVoltage V(V=10) annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={-60,10})));
ComplexLib.SinglePhase.Basic.Resistor R(R=30)
annotation (Placement(transformation(extent={{-40,30},{-20,50}})));
ComplexLib.SinglePhase.Basic.Inductor L(L=0.2) annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={10,40})));
annotation (uses(Modelica(version="3.0")), Diagram(coordinateSystem(
preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics),
Documentation(info="
This example shows a simple series of a voltage source with resistor,
inductor, and capacitor.
Because of phasor description, all results have constant values.
Simulate for an arbitrary time interval (e.g. 1 s).
Plot in seperate windows
- V.v, R.v, L.v,
and C.v versus "Time"
- V.phi_v, R.phi_v, L.phi_v,
and C.phi_v versus "Time"
to see the corresponding steady-state values.
- Main Author:
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"));
ComplexLib.SinglePhase.Basic.Capacitor C(C=1e-5)
annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={40,10})));
equation
connect(V.p, R.p) annotation (Line(
points={{-60,20},{-60,40},{-40,40}},
color={0,0,255},
smooth=Smooth.None));
connect(R.n, L.p) annotation (Line(
points={{-20,40},{0,40}},
color={0,0,255},
smooth=Smooth.None));
connect(V.n, ground.p) annotation (Line(
points={{-60,0},{-60,-20}},
color={0,0,255},
smooth=Smooth.None));
connect(L.n, C.p) annotation (Line(
points={{20,40},{40,40},{40,20}},
color={0,0,255},
smooth=Smooth.None));
connect(C.n, ground.p) annotation (Line(
points={{40,0},{40,-20},{-60,-20}},
color={0,0,255},
smooth=Smooth.None));
end RlcCircuit;
model VaryingResistance "Electric circuit with varying resistance"
extends Modelica.Icons.Example;
ComplexLib.SinglePhase.Basic.Ground ground
annotation (Placement(transformation(extent={{-70,-40},{-50,-20}})));
ComplexLib.SinglePhase.Sources.SineVoltage V(V=10) annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={-60,10})));
ComplexLib.SinglePhase.Basic.Resistor R2(R=2)
annotation (Placement(transformation(extent={{-40,30},{-20,50}})));
ComplexLib.SinglePhase.Basic.Inductor L(L=0.005)
annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={0,10})));
ComplexLib.SinglePhase.Basic.VariableResistor R3 annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={40,10})));
Modelica.Blocks.Sources.Ramp Ramp(
height=5,
offset=0.01,
duration=10)
annotation (Placement(transformation(extent={{60,-40},{80,-20}})));
annotation (uses(Modelica(version="3.0")), Diagram(coordinateSystem(
preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics),
Documentation(info="
This example shows a purely electric circuit containing a VariableResistor component (R3).
The resistance of R3 is determined depending on time function of component Ramp.
It starts at a very small value (0.01 Ohm) and reaches 5 Ohm after 10 s.
Using this example, we would like to give an idea how one can decide if the system
is in a quasi-stationary mode or not.
The main (and only) time constant of the system reads T = L*(R2+R3)/(R2*R3).
It is well-known for first-order components that, after a step-like change of an
input signal, the output signal reaches 95 % of íts final value after a time period
of 3*T.
This time period is called decayTime.
Checking the difference between decayTime and the time interval of the
simulation experiment yields the information if the system is in a quasi-stationary
mode.
Because of variable resistor R3, it is necessary to calculate decayTime
during the simulation experiment according to decayTime = 3*L*(R2+R3)/(R2*R3).
The Boolean quasiStationaryOk tests if decayTime is smaller than
the simulation interval tInterval (which is necessary for quasi-stationary
mode).
Hence in the first part of the simulation (Time < 2.4 s), the system is
not in a quasi-stationary mode and the appropriate points in time of the
result curves represent only a series of steady states without any correlation with time.
In the second part of the simulation (Time > 2.4 s), the system is
quasi-stationary and the result curves reflect a correct relationship with time.
Simulate until 10 s.
Plot in seperate windows
- V.v, R2.v,
and L.v versus "Time"
- L.vRe and L.vIm versus "Time"
- quasiStationaryOk versus "Time"
to see steady-state sequences or the quasi-stationary plots of the corresponding values.
- Main Authors:
- Olaf Enge-Rosenblatt, Christoph Clauß
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"),
experiment(StopTime=10));
constant Real tInterval=10/500 "10 seconds devided into 500 intervals";
Real decayTime;
Boolean quasiStationaryOk;
equation
connect(V.p, R2.p) annotation (Line(
points={{-60,20},{-60,40},{-40,40}},
color={0,0,255},
smooth=Smooth.None));
connect(R2.n, L.p) annotation (Line(
points={{-20,40},{1.83697e-015,40},{1.83697e-015,20}},
color={0,0,255},
smooth=Smooth.None));
connect(R2.n, R3.p) annotation (Line(
points={{-20,40},{40,40},{40,20}},
color={0,0,255},
smooth=Smooth.None));
connect(V.n, ground.p) annotation (Line(
points={{-60,0},{-60,-20}},
color={0,0,255},
smooth=Smooth.None));
connect(L.n, ground.p) annotation (Line(
points={{-1.83697e-015,0},{0,0},{0,-20},{-60,-20}},
color={0,0,255},
smooth=Smooth.None));
connect(R3.n, ground.p) annotation (Line(
points={{40,0},{40,-20},{-60,-20}},
color={0,0,255},
smooth=Smooth.None));
connect(Ramp.y, R3.R) annotation (Line(
points={{81,-30},{90,-30},{90,10},{52,10}},
color={0,0,127},
smooth=Smooth.None));
decayTime = 3*L.L*(R2.R+R3.R)/(R2.R*R3.R);
quasiStationaryOk = decayTime < tInterval;
end VaryingResistance;
model QuasiStationaryAIM
"Asynchronous induction machine in quasi-stationary mode"
extends Modelica.Icons.Example;
ComplexLib.MultiPhase.Sources.SignalVoltage signalVoltage annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={-40,10})));
annotation (uses(Modelica(version="3.0")),
Diagram(coordinateSystem(preserveAspectRatio=true,
extent={{-100,-100},{100,100}}), graphics),
Documentation(info="
This example deals with a three-phase asynchronous induction machine.
It consists of a simple electrical circuit to drive the motor via a
variable voltage source.
Besides the shaft's interia and a damper component, a variable
time-dependent applied torque is used as load.
The machine's electrical subsystem is connected
to a three-phase voltage source which is the same
as being connected to three single source components.
The three-phase source works with variable amplitude
and phase.
It is governed by two input signals (one for amplitude, one for phase)
for holding symmetrical conditions.
Simulate until 40 s.
Plot in seperate windows:
- signalVoltage.V and torque.tau
versus "Time" to see the input stimuli
- omega and aIM_3ph.inertiaRotor.w
or aIM_3ph.s versus "Time"
to get the slip of the machine (s=(omega-w)/omega))
- completeElPwr and aIM_3ph.P_mech
versus "Time" to see the power balance
always as a sequence of steady states.
- Main Author:
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"),
experiment(StopTime=40));
ComplexLib.MultiPhase.Basic.Star star
annotation (Placement(transformation(extent={{-30,-40},{-10,-20}})));
ComplexLib.SinglePhase.Basic.Ground ground
annotation (Placement(transformation(extent={{-10,-50},{10,-30}})));
Modelica.Blocks.Sources.Ramp rampV(height=220, duration=10)
annotation (Placement(transformation(extent={{-80,40},{-60,60}})));
Modelica.Blocks.Sources.Constant constPhase(k=0)
annotation (Placement(transformation(extent={{-80,0},{-60,20}})));
ComplexLib.Machines.BasicMachines.AIM_3ph aIM_3ph(Ls=0.5, Lr=0.5)
annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
rotation=90,
origin={10,10})));
Modelica.Mechanics.Rotational.Components.Inertia inertia(J=0.15)
annotation (Placement(transformation(extent={{40,50},{60,70}})));
Modelica.Mechanics.Rotational.Components.Damper damper(d=1)
annotation (Placement(transformation(extent={{40,10},{60,30}})));
Modelica.Mechanics.Rotational.Components.Fixed fixed
annotation (Placement(transformation(extent={{70,10},{90,30}})));
Modelica.Mechanics.Rotational.Sources.Torque torque
annotation (Placement(transformation(extent={{60,-20},{40,0}})));
Modelica.Blocks.Sources.Ramp rampT(
duration=10,
height=400,
startTime=20)
annotation (Placement(transformation(extent={{40,-60},{60,-40}})));
Real omega;
Real completeElPwr;
equation
connect(rampV.y, signalVoltage.V) annotation (Line(
points={{-59,50},{-20,50},{-20,10},{-33,10}},
color={0,0,127},
smooth=Smooth.None));
connect(constPhase.y, signalVoltage.phaseRef) annotation (Line(
points={{-59,10},{-53,10},{-53,10},{-47,10}},
color={0,0,127},
smooth=Smooth.None));
connect(signalVoltage.plug_p, aIM_3ph.plug_p) annotation (Line(
points={{-40,20},{-40,30},{0,30},{0,16}},
color={0,0,255},
smooth=Smooth.None));
connect(signalVoltage.plug_n, aIM_3ph.plug_n) annotation (Line(
points={{-40,0},{-40,-10},{0,-10},{0,4}},
color={0,0,255},
smooth=Smooth.None));
connect(signalVoltage.plug_n, star.plug_p) annotation (Line(
points={{-40,0},{-40,-30},{-30,-30}},
color={0,0,255},
smooth=Smooth.None));
connect(star.pin_n, ground.p) annotation (Line(
points={{-10,-30},{0,-30}},
color={0,0,255},
smooth=Smooth.None));
connect(aIM_3ph.shaft, inertia.flange_a) annotation (Line(
points={{10,20},{10,60},{40,60}},
color={0,0,0},
smooth=Smooth.None));
connect(aIM_3ph.shaft, damper.flange_a) annotation (Line(
points={{10,20},{10,40},{40,40},{40,20}},
color={0,0,0},
smooth=Smooth.None));
connect(damper.flange_b, fixed.flange) annotation (Line(
points={{60,20},{80,20}},
color={0,0,0},
smooth=Smooth.None));
connect(aIM_3ph.shaft, torque.flange) annotation (Line(
points={{10,20},{10,40},{30,40},{30,-10},{40,-10}},
color={0,0,0},
smooth=Smooth.None));
connect(rampT.y, torque.tau) annotation (Line(
points={{61,-50},{80,-50},{80,-10},{62,-10}},
color={0,0,127},
smooth=Smooth.None));
omega = ComplexLib.Constants.omega;
completeElPwr = signalVoltage.activePwr[1]+signalVoltage.activePwr[2]
+signalVoltage.activePwr[3];
end QuasiStationaryAIM;
end Examples;
package Constants "Package for definitions of constants"
annotation (Documentation(
info="
The package contains the definition of the constant
frequency f in Hz.
This frequency is used within the complete electrical system
which is modelled using the phasor domain description.
The angular frequency ω in rad/s is also calculated
and made available.
"));
constant SI.Frequency frequency=50
"Frequency of the complete AC circuit [Hz]";
constant SI.AngularFrequency omega=2*Modelica.Constants.pi*frequency
"AngularFrequency of the complete AC circuit [rad/s]";
end Constants;
package SinglePhase "Library for phasor domain-based single-phase components"
annotation (
Documentation(info="
The package contains subpackages for electrical components of single-phase type
for phasor domain-based AC analysis:
- Basic: basic components (resistor, inductor, capacitor, conductor, transformers)
- Interfaces: connectors and partial models
- Sensors: sensors to measure potential, voltage, and current
- Sources: sinusoidal voltage, current, or power sources using constant or variable values
- Main Authors:
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
- Matthias Vetter, Simon Schwunk
Fraunhofer ISE, Freiburg
email: matthias.vetter@ise.fraunhofer.de
"));
package Basic
"Basic electrical phasor domain-based single-phase components"
annotation (
Documentation(info="
This package contains basic electrical components for phasor analysis:
- Ground
- Resistor
- Inductor
- Capacitor
- Conductor
- VariableResistor
- VariableInductor
- VariableCapacitor
- VariableConductor
and the subpackage Transformers.
"));
model Ground "Ground node"
annotation (
Documentation(info="
Ground of an electrical circuit. The potential phasor v at the
ground node is zero. Every electrical circuit has to contain at least
one ground object.
- Main Author:
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"), Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Line(points={{-60,50},{60,50}}),
Line(points={{-40,30},{40,30}}),
Line(points={{-20,10},{20,10}}),
Line(points={{0,100},{0,50}}),
Text(
extent={{-144,-60},{138,0}},
lineColor={0,0,255},
textString="%name")}),
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Line(
points={{-60,50},{60,50}},
color={0,0,255},
thickness=0.5),
Line(
points={{-40,30},{40,30}},
color={0,0,255},
thickness=0.5),
Line(
points={{-20,10},{20,10}},
color={0,0,255},
thickness=0.5),
Line(
points={{0,100},{0,50}},
color={0,0,255},
thickness=0.5),
Text(extent={{-24,-38},{22,-6}}, textString="p.v=0")}),
Window(
x=0.23,
y=0.23,
width=0.59,
height=0.63));
ComplexLib.SinglePhase.Interfaces.PosComplexPin p
"Complex pin (positive)"
annotation (Placement(transformation(
origin={0,100},
extent={{10,-10},{-10,10}},
rotation=270)));
equation
p.vRe = 0;
p.vIm = 0;
end Ground;
model Resistor "Ideal linear electrical resistor"
extends ComplexLib.SinglePhase.Interfaces.OnePort;
parameter SI.Resistance R=1 "Resistance of component";
annotation (
Documentation(info="
The linear resistor connects the branch voltage phasor v with the
branch current phasor i by
R*i = v
There is no phase shift between voltage and current.
The resistance R has a constant value.
- Main Author:
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"), Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Rectangle(
extent={{-70,30},{70,-30}},
lineColor={0,0,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,0},{-70,0}}),
Line(points={{70,0},{100,0}}),
Text(
extent={{-144,-60},{144,-100}},
lineColor={0,0,0},
textString="R=%R"),
Text(
extent={{-144,50},{144,110}},
lineColor={0,0,255},
textString="%name")}),
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Rectangle(extent={{-70,30},{70,-30}}),
Line(points={{-100,0},{-70,0}}),
Line(points={{70,0},{100,0}})}),
Window(
x=0.2,
y=0.06,
width=0.62,
height=0.69));
equation
vRe = R*iRe;
vIm = R*iIm;
end Resistor;
model Inductor "Ideal linear electrical inductor"
extends ComplexLib.SinglePhase.Interfaces.OnePort;
parameter SI.AngularFrequency omega=Constants.omega
"AngularFrequency of the complete AC circuit";
parameter SI.Inductance L=1 "Inductance of component";
annotation (
Documentation(info="
The linear inductor connects the branch voltage phasor v with the
branch current phasor i by
jωL*i = v.
The phase shift between voltage and current is 90°.
The inductance L has a constant value.
- Main Author:
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"), Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Ellipse(extent={{-60,-15},{-30,15}}),
Ellipse(extent={{-30,-15},{0,15}}),
Ellipse(extent={{0,-15},{30,15}}),
Ellipse(extent={{30,-15},{60,15}}),
Rectangle(
extent={{-60,-30},{60,0}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{60,0},{100,0}}),
Line(points={{-100,0},{-60,0}}),
Text(
extent={{-138,-60},{144,-102}},
lineColor={0,0,0},
textString="L=%L"),
Text(
extent={{-148,48},{146,110}},
lineColor={0,0,255},
textString="%name")}),
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Ellipse(extent={{-60,-15},{-30,15}}),
Ellipse(extent={{-30,-15},{0,15}}),
Ellipse(extent={{0,-15},{30,15}}),
Ellipse(extent={{30,-15},{60,15}}),
Rectangle(
extent={{-60,-30},{62,0}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{60,0},{100,0}}),
Line(points={{-100,0},{-60,0}})}),
Window(
x=0.3,
y=0.12,
width=0.6,
height=0.6));
equation
vRe = -omega*L*iIm;
vIm = omega*L*iRe;
end Inductor;
model Capacitor "Ideal linear electrical capacitor"
extends ComplexLib.SinglePhase.Interfaces.OnePort;
parameter SI.AngularFrequency omega=Constants.omega
"AngularFrequency of the complete AC circuit";
parameter SI.Capacitance C=1 "Capacitance of component";
annotation (
Window(
x=0.32,
y=0.33,
width=0.48,
height=0.58),
Documentation(info="
The linear capacitor connects the branch voltage phasor v with the
branch current phasor i by
i = jωC*v.
The phase shift between voltage and current is -90°.
The capacitance C has a constant value.
- Main Author:
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"), Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Line(
points={{-10,28},{-10,-28}},
color={0,0,255},
thickness=0.5),
Line(
points={{10,28},{10,-28}},
color={0,0,255},
thickness=0.5),
Line(points={{-100,0},{-10,0}}),
Line(points={{10,0},{100,0}}),
Text(
extent={{-136,-60},{136,-100}},
lineColor={0,0,0},
textString="C=%C"),
Text(
extent={{-142,50},{140,110}},
lineColor={0,0,255},
textString="%name")}),
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Line(
points={{-10,40},{-10,-40}},
color={0,0,255},
thickness=0.5),
Line(
points={{10,40},{10,-40}},
color={0,0,255},
thickness=0.5),
Line(points={{-100,0},{-10,0}}),
Line(points={{10,0},{100,0}})}));
equation
omega*C*vRe = iIm;
-omega*C*vIm = iRe;
end Capacitor;
model Conductor "Ideal linear electrical conductor"
extends ComplexLib.SinglePhase.Interfaces.OnePort;
parameter ComplexLib.SIunits.Conductance G=1 "Conductance of component";
annotation (
Documentation(info="
The linear conductor connects the branch voltage v with the
branch current i by
i = G*v.
There is no phase shift between voltage and current.
The conductance G has a constant value.
- Main Authors:
- Matthias Vetter, Simon Schwunk
Fraunhofer ISE, Freiburg
email: matthias.vetter@ise.fraunhofer.de
"), Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Rectangle(
extent={{-70,30},{70,-30}},
lineColor={0,0,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Rectangle(extent={{-70,30},{70,-30}}),
Line(points={{-100,0},{-70,0}}),
Line(points={{70,0},{100,0}}),
Text(
extent={{-138,-60},{140,-100}},
lineColor={0,0,0},
pattern=LinePattern.None,
textString="G=%G"),
Text(
extent={{-142,50},{140,110}},
lineColor={0,0,255},
textString="%name")}),
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Line(points={{-100,0},{-70,0}}),
Line(points={{70,0},{100,0}}),
Rectangle(extent={{-70,30},{70,-30}})}),
Window(
x=0,
y=0.2,
width=0.63,
height=0.68));
equation
G*vRe = iRe;
G*vIm = iIm;
end Conductor;
model VariableResistor
"Ideal linear electrical resistor with variable resistance"
extends ComplexLib.SinglePhase.Interfaces.OnePort;
Modelica.Blocks.Interfaces.RealInput R
"Resistance of component via input signal [Ohm]"
annotation (Placement(transformation(
origin={0,120},
extent={{-20,-20},{20,20}},
rotation=270)));
annotation (
Documentation(info="
The linear resistor connects the branch voltage phasor v with the
branch current phasor i by
R*i = v.
There is no phase shift between voltage and current.
The resistance R is specified by input signal.
Attention!!!
To ensure that the phasor domain-based model works in a quasi-stationary
mode, the resistance R may alter only very slowly in comparison
with both the nominal frequency f=ω/(2π) and the dominant
time constant of the phasor domain-based model.
Remark:
It is recommended that the R signal should not cross the zero value.
- Main Author:
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"),Icon(coordinateSystem(
preserveAspectRatio=true,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Text(
extent={{-148,-100},{144,-40}},
lineColor={0,0,255},
textString="%name"),
Line(points={{-100,0},{-70,0}}),
Rectangle(
extent={{-70,30},{70,-30}},
lineColor={0,0,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{70,0},{100,0}}),
Line(points={{0,100},{0,30}}, color={0,0,255})}),
Diagram(coordinateSystem(
preserveAspectRatio=true,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Rectangle(
extent={{-70,30},{70,-30}},
lineColor={0,0,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,0},{-70,0}}),
Line(points={{0,100},{0,30}}, color={0,0,255}),
Line(points={{70,0},{100,0}})}));
equation
vRe = R*iRe;
vIm = R*iIm;
end VariableResistor;
model VariableInductor
"Ideal linear electrical inductor with variable inductance"
extends ComplexLib.SinglePhase.Interfaces.OnePort;
parameter SI.AngularFrequency omega=Constants.omega
"AngularFrequency of the complete AC circuit";
Modelica.Blocks.Interfaces.RealInput L
"Inductance of component via input signal [H]"
annotation (Placement(transformation(
origin={0,120},
extent={{-20,-20},{20,20}},
rotation=270)));
annotation (
Documentation(info="
The linear inductor connects the branch voltage phasor v with the
branch current phasor i by
jωL*i = v.
The phase shift between voltage and current is 90°.
The inductance L is specified by input signal.
Attention!!!
To ensure that the phasor domain-based model works in a quasi-stationary
mode, the inductance L may alter only very slowly in comparison
with both the nominal frequency f=ω/(2π) and the dominant
time constant of the phasor domain-based model.
Remark:
It is required that L ≥ 0, otherwise an assertion is raised.
- Main Author:
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"),Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},
{100,100}}), graphics={
Text(
extent={{-138,-100},{136,-40}},
lineColor={0,0,255},
textString="%name"),
Line(points={{-100,0},{-60,0}}),
Line(points={{60,0},{100,0}}),
Line(points={{0,104},{0,8}}, color={0,0,255}),
Ellipse(extent={{-60,-15},{-30,15}}),
Ellipse(extent={{-30,-15},{0,15}}),
Ellipse(extent={{0,-15},{30,15}}),
Ellipse(extent={{30,-15},{60,15}}),
Rectangle(
extent={{-60,-30},{60,0}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid)}),
Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100,
-100},{100,100}}), graphics={
Line(points={{-100,0},{-60,0}}),
Line(points={{0,100},{0,8}}, color={0,0,255}),
Ellipse(extent={{-60,-15},{-30,15}}),
Ellipse(extent={{-30,-15},{0,15}}),
Ellipse(extent={{0,-15},{30,15}}),
Ellipse(extent={{30,-15},{60,15}}),
Rectangle(
extent={{-60,-30},{62,0}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{60,0},{100,0}})}));
equation
assert(L>=0,"Inductance L_ (= " + String(L) + ") has to be >= 0!");
vRe = -omega*L*iIm;
vIm = omega*L*iRe;
end VariableInductor;
model VariableCapacitor
"Ideal linear electrical capacitor with variable capacitance"
extends ComplexLib.SinglePhase.Interfaces.OnePort;
parameter SI.AngularFrequency omega=Constants.omega
"AngularFrequency of the complete AC circuit";
Modelica.Blocks.Interfaces.RealInput C
"Capacitance of component via input signal [F]"
annotation (Placement(transformation(
origin={0,120},
extent={{-20,-20},{20,20}},
rotation=270)));
annotation (
Documentation(info="
The linear capacitor connects the branch voltage phasor v with the
branch current phasor i by
i = jωC*v.
The phase shift between voltage and current is -90°.
The capacitance C is specified by input signal.
Attention!!!
To ensure that the phasor domain-based model works in a quasi-stationary
mode, the capacitance C may alter only very slowly in comparison
with both the nominal frequency f=ω/(2π) and the dominant
time constant of the phasor domain-based model.
Remark:
It is required that C ≥ 0, otherwise an assertion is raised.
- Main Author:
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"),Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
{100,100}}), graphics={
Text(
extent={{-136,-100},{134,-40}},
lineColor={0,0,255},
textString="%name"),
Line(points={{-100,0},{-10,0}}),
Line(points={{10,0},{100,0}}),
Line(points={{0,102},{0,30}}, color={0,0,255}),
Line(
points={{-10,28},{-10,-28}},
color={0,0,255},
thickness=0.5),
Line(
points={{10,28},{10,-28}},
color={0,0,255},
thickness=0.5)}),
Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100,
-100},{100,100}}), graphics={
Line(points={{-100,0},{-10,0}}),
Line(points={{10,0},{100,0}}),
Line(points={{0,100},{0,30}}, color={0,0,255}),
Line(
points={{-10,28},{-10,-28}},
color={0,0,255},
thickness=0.5),
Line(
points={{10,28},{10,-28}},
color={0,0,255},
thickness=0.5)}));
equation
assert(C>=0,"Capacitance C_ (= " + String(C) + ") has to be >= 0!");
omega*C*vRe = iIm;
-omega*C*vIm = iRe;
end VariableCapacitor;
model VariableConductor
"Ideal linear electrical conductor with variable conductance"
extends ComplexLib.SinglePhase.Interfaces.OnePort;
Modelica.Blocks.Interfaces.RealInput G
"Conductance of component via input signal [S]"
annotation (Placement(transformation(
origin={0,120},
extent={{-20,-20},{20,20}},
rotation=270)));
annotation (
Documentation(info="
The linear conductor connects the branch voltage phasor v with the
branch current phasor i by
i = G*v.
There is no phase shift between voltage and current.
The conductance G is specified by input signal.
Attention!!!
To ensure that the phasor domain-based model works in a quasi-stationary
mode, the conductance G may alter only very slowly in comparison
with both the nominal frequency f=ω/(2π) and the dominant
time constant of the phasor domain-based model.
Remark:
It is recommended that the G signal should not cross the zero value.
- Main Author:
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"),Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Text(
extent={{-148,-100},{144,-40}},
lineColor={0,0,255},
textString="%name"),
Line(points={{-98,0},{-70,0}}),
Rectangle(
extent={{-70,30},{70,-30}},
lineColor={0,0,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{70,0},{100,0}}),
Line(points={{0,102},{0,30}}, color={0,0,255})}),
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={2,2}), graphics={
Rectangle(
extent={{-70,30},{70,-30}},
lineColor={0,0,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,0},{-70,0}}),
Line(points={{0,100},{0,30}}, color={0,0,255}),
Line(points={{70,0},{100,0}})}));
equation
G*vRe = iRe;
G*vIm = iIm;
end VariableConductor;
package Transformers "Phasor domain-based single-phase transformers"
model IdealTransformer "Ideal electrical transformer"
extends ComplexLib.SinglePhase.Interfaces.TwoPort;
parameter Real n = 1 "Turns ratio";
annotation (
Documentation(info="
The IdealTransformer is a two-port component with resistive (not inductive!) behaviour.
The left port voltage phasor v1, the left port current phasor i1,
the right port voltage phasor v2, and the right port current phasor i2 are connected by the following
relations:
v1 = n*v2,
i2 = -n*i1.
The turns ratio n has a constant real (but usually integer) value.
- Main Author:
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"), Icon(coordinateSystem(
preserveAspectRatio=true,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics={
Text(
extent={{-101,115},{99,57}},
lineColor={0,0,255},
textString="%name"),
Ellipse(extent={{-45,-50},{-20,-25}}),
Ellipse(extent={{-45,-25},{-20,0}}),
Ellipse(extent={{-45,0},{-20,25}}),
Ellipse(extent={{-45,25},{-20,50}}),
Rectangle(
extent={{-72,-60},{-33,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,50},{-32,50}}),
Line(points={{-100,-50},{-32,-50}}),
Ellipse(extent={{20,-50},{45,-25}}),
Ellipse(extent={{20,-25},{45,0}}),
Ellipse(extent={{20,0},{45,25}}),
Ellipse(extent={{20,25},{45,50}}),
Rectangle(
extent={{33,-60},{72,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{32,50},{100,50}}),
Line(points={{32,-50},{100,-50}}),
Text(extent={{-18,-70},{20,-98}}, textString="n=%n")}),
Diagram(coordinateSystem(
preserveAspectRatio=true,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics={
Ellipse(extent={{-45,-50},{-20,-25}}),
Ellipse(extent={{-45,-25},{-20,0}}),
Ellipse(extent={{-45,0},{-20,25}}),
Ellipse(extent={{-45,25},{-20,50}}),
Rectangle(
extent={{-72,-60},{-33,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,50},{-33,50}}),
Line(points={{-100,-50},{-32,-50}}),
Ellipse(extent={{20,-50},{45,-25}}),
Ellipse(extent={{20,-25},{45,0}}),
Ellipse(extent={{20,0},{45,25}}),
Ellipse(extent={{20,25},{45,50}}),
Rectangle(
extent={{33,-60},{72,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{32,50},{100,50}}),
Line(points={{32,-50},{100,-50}})}),
Window(
x=0.26,
y=0.43,
width=0.6,
height=0.6));
equation
v1Re = n*v2Re;
v1Im = n*v2Im;
i2Re = -n*i1Re;
i2Im = -n*i1Im;
end IdealTransformer;
annotation (
Documentation(info="
This package contains single-phase transformers for phasor analysis:
- IdealTransformer
- IdealTransformer with phase shift
- SimpleTransformer
- PowerTransformer
- VariableIdealTransformer
- VariableSimpleTransformer
- VariablePowerTransformer
"));
model IdealTransformer2 "Ideal electrical transformer with phase shift"
extends ComplexLib.SinglePhase.Interfaces.TwoPort;
parameter Real n = 1 "Turns ratio";
parameter SI.Angle phase = 0
"Phase shift between primary and secondary part via input signal";
annotation (Documentation(info="
The IdealTransformer2 extends the IdealTransformer component while considering an arbitrary
but constant phase shift. The left port voltage phasor v1,
the left port current phasor i1, the right port voltage phasor v2, and the right
port current phasor i2 are connected by the following relations:
v1 = n*v2*e^(jφ),
i2 = n*i1*e^(j(π+φ)),
where n is the ratio between primary and secondary winding and φ stands for
the phase shift angle phase.
Both parameters n and φ have constant values.
-
- Main Authors:
- Matthias Vetter, Simon Schwunk
Fraunhofer ISE, Freiburg
email: matthias.vetter@ise.fraunhofer.de
- and
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"), Icon(coordinateSystem(
preserveAspectRatio=true,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics={
Text(
extent={{-100,105},{100,47}},
lineColor={0,0,255},
textString="%name"),
Ellipse(extent={{-45,-50},{-20,-25}}),
Ellipse(extent={{-45,-25},{-20,0}}),
Ellipse(extent={{-45,0},{-20,25}}),
Ellipse(extent={{-45,25},{-20,50}}),
Rectangle(
extent={{-72,-60},{-33,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,50},{-32,50}}),
Line(points={{-100,-50},{-32,-50}}),
Ellipse(extent={{20,-50},{45,-25}}),
Ellipse(extent={{20,-25},{45,0}}),
Ellipse(extent={{20,0},{45,25}}),
Ellipse(extent={{20,25},{45,50}}),
Rectangle(
extent={{34,-60},{73,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{32,50},{100,50}}),
Line(points={{32,-50},{100,-50}}),
Text(extent={{-13,-55},{15,-78}}, textString="n=%n"),
Text(extent={{-48,-70},{50,-98}}, textString="phase=%phase")}),
Diagram(coordinateSystem(
preserveAspectRatio=true,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics={
Ellipse(extent={{-45,-50},{-20,-25}}),
Ellipse(extent={{-45,-25},{-20,0}}),
Ellipse(extent={{-45,0},{-20,25}}),
Ellipse(extent={{-45,25},{-20,50}}),
Rectangle(
extent={{-72,-60},{-33,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,50},{-32,50}}),
Line(points={{-100,-50},{-32,-50}}),
Ellipse(extent={{20,-50},{45,-25}}),
Ellipse(extent={{20,-25},{45,0}}),
Ellipse(extent={{20,0},{45,25}}),
Ellipse(extent={{20,25},{45,50}}),
Rectangle(
extent={{33,-60},{72,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{32,50},{100,50}}),
Line(points={{32,-50},{100,-50}})}),
Window(
x=0.26,
y=0.43,
width=0.6,
height=0.6));
equation
v2Re = v1/n*cos(phi_v1+phase);
v2Im = v1/n*sin(phi_v1+phase);
i2Re = i1*n*cos(phi_i1+Modelica.Constants.pi+phase);
i2Im = i1*n*sin(phi_i1+Modelica.Constants.pi+phase);
end IdealTransformer2;
model SimpleTransformer "Two coupled linear inductors"
extends ComplexLib.SinglePhase.Interfaces.TwoPort;
parameter SI.AngularFrequency omega=Constants.omega
"AngularFrequency of the complete AC circuit";
parameter SI.Inductance L1 = 1
"Self inductance of first winding (main inductance plus stray inductance)";
parameter SI.Inductance M = 0.99 "Mutual inductance";
parameter SI.Inductance L2 = 1
"Self inductance of second winding (main inductance plus stray inductance)";
annotation (
Documentation(info="
The SimpleTransformer is a two-port component consisting of two ideal inductors (having no resistance).
Between these inductors, there exists a non-ideal coupling.
The left port voltage phasor v1, the left port current phasor i1,
the right port voltage phasor , and the right port current phasor i2 are connected by the following
relations:
v1 = jω*(L1*i1+ M*i2),
v2 = jω*( M*i1+L2*i2),
where M²<L1*L2 is assumed.
The parameters L1 and L2 denote the primary and secondary self inductances, respectively,
while M is called mutual (or coupling) inductance.
All inductances have constant values.
Main Author:
Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"), Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics={
Text(
extent={{-101,115},{99,57}},
lineColor={0,0,255},
textString="%name"),
Ellipse(extent={{-45,-50},{-20,-25}}),
Ellipse(extent={{-45,-25},{-20,0}}),
Ellipse(extent={{-45,0},{-20,25}}),
Ellipse(extent={{-45,25},{-20,50}}),
Rectangle(
extent={{-72,-60},{-33,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,50},{-32,50}}),
Line(points={{-100,-50},{-32,-50}}),
Ellipse(extent={{20,-50},{45,-25}}),
Ellipse(extent={{20,-25},{45,0}}),
Ellipse(extent={{20,0},{45,25}}),
Ellipse(extent={{20,25},{45,50}}),
Rectangle(
extent={{33,-60},{72,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{32,50},{100,50}}),
Line(points={{32,-50},{100,-50}}),
Text(extent={{-89,11},{-41,-16}}, textString="L1=%L1"),
Text(extent={{45,16},{87,-18}}, textString="L2=%L2"),
Text(extent={{-19,-65},{19,-86}}, textString="M=%M")}),
Diagram(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics={
Ellipse(extent={{-45,-50},{-20,-25}}),
Ellipse(extent={{-45,-25},{-20,0}}),
Ellipse(extent={{-45,0},{-20,25}}),
Ellipse(extent={{-45,25},{-20,50}}),
Rectangle(
extent={{-72,-60},{-33,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,50},{-32,50}}),
Line(points={{-100,-50},{-32,-50}}),
Ellipse(extent={{20,-50},{45,-25}}),
Ellipse(extent={{20,-25},{45,0}}),
Ellipse(extent={{20,0},{45,25}}),
Ellipse(extent={{20,25},{45,50}}),
Rectangle(
extent={{33,-60},{72,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{32,50},{100,50}}),
Line(points={{32,-50},{100,-50}})}),
Window(
x=0.26,
y=0.43,
width=0.6,
height=0.6));
equation
v1Re = -omega*(L1*i1Im+M*i2Im);
v1Im = omega*(L1*i1Re+M*i2Re);
v2Re = -omega*(M*i1Im+L2*i2Im);
v2Im = omega*(M*i1Re+L2*i2Re);
end SimpleTransformer;
model PowerTransformer "Power transformer including iron losses"
parameter SI.Resistance R1 = 10 "Primary winding's resistance";
parameter SI.Resistance R2 = 0.001 "Secondary winding's resistance";
parameter SI.Resistance R_Fe = 1000000 "Resistance of iron loss";
parameter SI.Inductance L_h = 1000000 "Main inductance";
parameter SI.Inductance L_1s = 0.01 "Primary stray inductance";
parameter SI.Inductance L_2s = 0.000001 "Secondary stray inductance";
parameter Real w1_w2 = 100 "Turns ratio";
parameter SI.Angle phase = 0 "Phase shift";
ComplexLib.SinglePhase.Basic.Resistor resistor1(R=R1)
annotation (Placement(transformation(extent={{-90,
30},{-70,50}}, rotation=0)));
ComplexLib.SinglePhase.Basic.Resistor resistor2(R=R2)
annotation (Placement(transformation(extent={{80,
30},{60,50}}, rotation=0)));
ComplexLib.SinglePhase.Basic.Resistor resistance_Fe(R=R_Fe)
annotation (Placement(transformation(
origin={-60,0},
extent={{-10,-10},{10,10}},
rotation=270)));
ComplexLib.SinglePhase.Basic.Inductor inductance_h(L=L_h)
annotation (Placement(transformation(
origin={-30,0},
extent={{-10,-10},{10,10}},
rotation=270)));
ComplexLib.SinglePhase.Basic.Inductor inductance1s(L=L_1s)
annotation (Placement(transformation(extent={{-60,
30},{-40,50}}, rotation=0)));
ComplexLib.SinglePhase.Basic.Inductor inductance2s(L=L_2s)
annotation (Placement(transformation(extent={{
48,30},{28,50}}, rotation=0)));
annotation (Diagram(coordinateSystem(preserveAspectRatio=true,
extent={{-100,-100},{100,100}}),
graphics),
Documentation(info="
The PowerTransformer is a two port.
The left port voltage v1, left port current i1,
right port voltage v2 and right port current i2 are connected by the following
relations:
v1 = R1 *i1 + jωL_1s *i1 + R_Fe*jωL_h/(R_Fe + jωL_h)*(i1 + i2')
v2' = R2'*i2' + jωL_2s'*i2' + R_Fe*jωL_h/(R_Fe + jωL_h)*(i1 + i2')
with:
V2' = w1_w2*v2; i2'=i2/w1_w2; L_2s'=(w1_w2)^2*L_2s; R2'=(w1_w2)^2*R2
This is the common way to describe power transformers.
All parameters have constant values.
Main Authors:
Matthias Vetter, Simon Schwunk
Fraunhofer ISE, Freiburg
email: matthias.vetter@ise.fraunhofer.de
and
Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"), Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},
{100,100}}), graphics={
Text(
extent={{-101,115},{99,57}},
lineColor={0,0,255},
textString="%name"),
Ellipse(extent={{-54,30},{6,-30}}, lineColor={0,0,255}),
Ellipse(extent={{-6,30},{54,-30}}, lineColor={0,0,255}),
Line(points={{-54,0},{-80,0}}, color={0,0,255}),
Line(points={{-80,0},{-80,-40}}, color={0,0,255}),
Line(points={{-80,40},{-80,0}}, color={0,0,255}),
Line(points={{-80,40},{-100,40}}, color={0,0,255}),
Line(points={{-80,-40},{-100,-40}}, color={0,0,255}),
Line(points={{100,40},{80,40}}, color={0,0,255}),
Line(points={{80,40},{80,0}}, color={0,0,255}),
Line(points={{80,0},{54,0}}, color={0,0,255}),
Line(points={{80,0},{80,-40}}, color={0,0,255}),
Line(points={{100,-40},{80,-40}}, color={0,0,255})}));
ComplexLib.SinglePhase.Interfaces.PosComplexPin pin_p_1
"Positive complex pin of primary winding"
annotation (Placement(transformation(
extent={{-110,30},{-90,50}}, rotation=0)));
ComplexLib.SinglePhase.Interfaces.PosComplexPin pin_p_2
"Positive complex pin of secondary winding"
annotation (Placement(transformation(
extent={{90,30},{110,50}}, rotation=0)));
ComplexLib.SinglePhase.Interfaces.NegComplexPin pin_n_1
"Negative complex pin of primary winding"
annotation (Placement(transformation(
extent={{-110,-50},{-90,-30}}, rotation=0)));
ComplexLib.SinglePhase.Interfaces.NegComplexPin pin_n_2
"Negative complex pin of secondary winding"
annotation (Placement(transformation(
extent={{90,-50},{110,-30}}, rotation=0)));
IdealTransformer2 idealTransformer(n=w1_w2, phase=phase)
annotation (Placement(transformation(extent={{-6,-6},{26,26}},
rotation=0)));
equation
connect(resistor1.n, inductance1s.p)
annotation (Line(points={{-70,40},{-60,40}},
color={0,0,255}));
connect(inductance2s.p, resistor2.n)
annotation (Line(points={{48,40},{60,40}},
color={0,0,255}));
connect(resistor2.p, pin_p_2)
annotation (Line(points={{80,40},{100,40}},
color={0,0,255}));
connect(resistance_Fe.n, pin_n_1)
annotation (Line(points={{-60,-10},{-60,-10},{-60,
-40},{-100,-40}}, color={0,0,255}));
connect(pin_p_1, resistor1.p)
annotation (Line(points={{-100,40},{-90,40}},
color={0,0,255}));
connect(inductance2s.n, idealTransformer.p2) annotation (Line(
points={{28,40},{26,40},{26,18}}, color={0,0,255}));
connect(idealTransformer.n2, pin_n_2) annotation (Line(points={{26,2},{26,
-40},{100,-40}}, color={0,0,255}));
connect(idealTransformer.n1, pin_n_1) annotation (Line(points={{-6,2},{-6,
-40},{-100,-40}}, color={0,0,255}));
connect(inductance_h.n, pin_n_1) annotation (Line(
points={{-30,-10},{-30,-40},{-100,-40}},
color={0,0,255},
smooth=Smooth.None));
connect(inductance1s.n, idealTransformer.p1) annotation (Line(
points={{-40,40},{-6,40},{-6,18}},
color={0,0,255},
smooth=Smooth.None));
connect(inductance1s.n, inductance_h.p) annotation (Line(
points={{-40,40},{-30,40},{-30,10}},
color={0,0,255},
smooth=Smooth.None));
connect(inductance1s.n, resistance_Fe.p) annotation (Line(
points={{-40,40},{-30,40},{-30,20},{-60,20},{-60,10}},
color={0,0,255},
smooth=Smooth.None));
end PowerTransformer;
model VariableIdealTransformer
"Ideal electrical transformer with variable parameters"
extends ComplexLib.SinglePhase.Interfaces.TwoPort;
Modelica.Blocks.Interfaces.RealInput n "Turns ratio via input signal"
annotation (Placement(
transformation(
origin={0,110},
extent={{-10,-10},{10,10}},
rotation=270)));
Modelica.Blocks.Interfaces.RealInput phase
"Phase shift between primary and secondary part via input signal [rad]"
annotation (Placement(
transformation(
origin={0,-110},
extent={{-10,-10},{10,10}},
rotation=90)));
annotation (Documentation(info="
The VariableIdealTransformer is a two port with variable turns ratio n
and phase shift angle φ=phase. The left port voltage phasor v1,
the left port current phasor i1, the right port voltage phasor v2,
and the right port current phasor i2 are connected
by the following relations:
v1 = n*v2*e^(jφ),
i2 = n*i1*e^(j(π+φ)),
where n is the ratio between primary and secondary winding and φ stands for
the phase shift angle phase.
Both n and phase are specified by input signals.
Attention!!!
To ensure that the phasor domain-based model works in a quasi-stationary
mode, the ratio of primary and secondary windings n may alter
only very slowly in comparison with both the nominal frequency
f=ω/(2π) and the dominant time constant of the
phasor domain-based model.
Main Authors:
Matthias Vetter, Simon Schwunk
Fraunhofer ISE, Freiburg
email: matthias.vetter@ise.fraunhofer.de
and
Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"), Icon(coordinateSystem(
preserveAspectRatio=true,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics={
Ellipse(extent={{-45,-50},{-20,-25}}),
Ellipse(extent={{-45,-25},{-20,0}}),
Ellipse(extent={{-45,0},{-20,25}}),
Ellipse(extent={{-45,25},{-20,50}}),
Rectangle(
extent={{-72,-60},{-33,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,50},{-32,50}}),
Line(points={{-100,-50},{-32,-50}}),
Ellipse(extent={{20,-50},{45,-25}}),
Ellipse(extent={{20,-25},{45,0}}),
Ellipse(extent={{20,0},{45,25}}),
Ellipse(extent={{20,25},{45,50}}),
Rectangle(
extent={{34,-60},{73,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{32,50},{100,50}}),
Line(points={{32,-50},{100,-50}}),
Text(
extent={{-101,-41},{99,-99}},
lineColor={0,0,255},
textString="%name")}),
Diagram(coordinateSystem(
preserveAspectRatio=true,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics={
Ellipse(extent={{-45,-50},{-20,-25}}),
Ellipse(extent={{-45,-25},{-20,0}}),
Ellipse(extent={{-45,0},{-20,25}}),
Ellipse(extent={{-45,25},{-20,50}}),
Rectangle(
extent={{-72,-60},{-33,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,50},{-32,50}}),
Line(points={{-100,-50},{-32,-50}}),
Ellipse(extent={{20,-50},{45,-25}}),
Ellipse(extent={{20,-25},{45,0}}),
Ellipse(extent={{20,0},{45,25}}),
Ellipse(extent={{20,25},{45,50}}),
Rectangle(
extent={{33,-60},{72,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{32,50},{100,50}}),
Line(points={{32,-50},{100,-50}})}),
Window(
x=0.26,
y=0.43,
width=0.6,
height=0.6));
equation
v2Re = v1/n*cos(phi_v1+phase);
v2Im = v1/n*sin(phi_v1+phase);
i2Re = i1*n*cos(phi_i1+Modelica.Constants.pi+phase);
i2Im = i1*n*sin(phi_i1+Modelica.Constants.pi+phase);
end VariableIdealTransformer;
model VariableSimpleTransformer
"Two coupled linear inductors with variable parameters"
extends ComplexLib.SinglePhase.Interfaces.TwoPort;
parameter SI.AngularFrequency omega=Constants.omega
"AngularFrequency of the complete AC circuit";
Modelica.Blocks.Interfaces.RealInput L1
"Self inductance of first winding (main inductance plus stray inductance) [H]"
annotation (Placement(
transformation(extent={{-140,-20},{-100,20}},rotation=0)));
Modelica.Blocks.Interfaces.RealInput M "Mutual inductance [H]"
annotation (Placement(
transformation(
origin={0,120},
extent={{-20,-20},{20,20}},
rotation=270)));
Modelica.Blocks.Interfaces.RealInput L2
"Self inductance of second winding (main inductance plus stray inductance) [H]"
annotation (Placement(
transformation(
origin={120,0},
extent={{-20,-20},{20,20}},
rotation=180)));
annotation (
Documentation(info="
The VariableSimpleTransformer component is a two-port with variable parameters
consisting of two ideal inductors (having no resistance).
Between these inductors, there exists a non-ideal coupling.
The left port voltage phasor v1, the left port current phasor
i1, the right port voltage phasor v2, and the right
port current phasor i2 are connected by the following relations:
v1 = jω*(L1*i1+M*i2),
v2 = jω*(M*i1+L2*i2),
where M²<L1*L2 is always assumed.
The parameters L1 and L1 denote the primary and
secondary self inductances, respectively, while M is called
mutual (or coupling) inductance.
The values of the inductances are specified by independent input signals.
Attention!!!
To ensure that the phasor domain-based model works in a quasi-stationary
mode, all inductances may alter only very slowly in comparison with both
the nominal frequency f=ω/(2π) and the dominant
time constant of the phasor domain-based model.
Remark:
It is required that M² < L1*L2, otherwise an assertion is raised.
Main Author:
Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de
"), Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics={
Ellipse(extent={{-45,-50},{-20,-25}}),
Ellipse(extent={{-45,-25},{-20,0}}),
Ellipse(extent={{-45,0},{-20,25}}),
Ellipse(extent={{-45,25},{-20,50}}),
Rectangle(
extent={{-72,-60},{-33,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,50},{-32,50}}),
Line(points={{-100,-50},{-32,-50}}),
Ellipse(extent={{20,-50},{45,-25}}),
Ellipse(extent={{20,-25},{45,0}}),
Ellipse(extent={{20,0},{45,25}}),
Ellipse(extent={{20,25},{45,50}}),
Rectangle(
extent={{33,-60},{72,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{32,50},{100,50}}),
Line(points={{32,-50},{100,-50}}),
Text(
extent={{-101,-41},{99,-99}},
lineColor={0,0,255},
textString="%name")}),
Diagram(coordinateSystem(
preserveAspectRatio=true,
extent={{-100,-100},{100,100}},
grid={1,1}), graphics={
Ellipse(extent={{-45,-50},{-20,-25}}),
Ellipse(extent={{-45,-25},{-20,0}}),
Ellipse(extent={{-45,0},{-20,25}}),
Ellipse(extent={{-45,25},{-20,50}}),
Rectangle(
extent={{-72,-60},{-33,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{-100,50},{-32,50}}),
Line(points={{-100,-50},{-32,-50}}),
Ellipse(extent={{20,-50},{45,-25}}),
Ellipse(extent={{20,-25},{45,0}}),
Ellipse(extent={{20,0},{45,25}}),
Ellipse(extent={{20,25},{45,50}}),
Rectangle(
extent={{33,-60},{72,60}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{32,50},{100,50}}),
Line(points={{32,-50},{100,-50}})}),
Window(
x=0.26,
y=0.43,
width=0.6,
height=0.6));
equation
assert(M^2
The VariablePowerTransformer is a two port with variable parameters.
The left port voltage v1, left port current i1,
right port voltage v2 and right port current i2 are connected by the following
relations:
v1 = R1 *i1 + jωL_1s *i1 + R_Fe*jωL_h/(R_Fe + jωL_h)*(i1 + i2')
v2' = R2'*i2' + jωL_2s'*i2' + R_Fe*jωL_h/(R_Fe + jωL_h)*(i1 + i2')
with:
v2'=w1_w2*v2; i2'=i2/w1_w2; L_2s'=(w1_w2)^2*L_2s; R2'=(w1_w2)^2*R2
This is the common way to describe power transformers.
All parameters are specified by independent input signals.
Attention!!!
To ensure that the phasor domain-based model works in a quasi-stationary
mode, all input signals may alter only very slowly in comparison
with both the nominal frequency f=ω/(2π) and the dominant
time constant of the phasor domain-based model.
-
- Main Authors:
- Matthias Vetter, Simon Schwunk
Fraunhofer ISE, Freiburg
email: matthias.vetter@ise.fraunhofer.de
- and
- Olaf Enge-Rosenblatt
Fraunhofer IIS/EAS, Dresden
email: olaf.enge@eas.iis.fraunhofer.de