• Non ci sono risultati.

Introduction to Simulink

N/A
N/A
Protected

Academic year: 2021

Condividi "Introduction to Simulink"

Copied!
14
0
0

Testo completo

(1)

DEI - Department of Electrical and Information Engineering

POLYTECHNIC UNIVERSITY OF BARI

Introduction to Simulink

Eng. Domenico Buongiorno

Prof. Vitoantonio Bevilacqua

(2)

Simulink

Simulink is a graphical programming environment for modeling, simulating and analyzing multidomain dynamical systems.

▪ Its primary interface is a graphical block diagramming tool and a customizable set of block libraries.

▪ It offers tight integration with the rest of the MATLAB environment and can either drive MATLAB or be scripted from it.

▪ Simulink is widely used in automatic control and digital signal processing for

multidomain simulation and Model-Based Design.

(3)

DEI -Department of Electrical and Information Engineering

POLYTECHNIC UNIVERSITY OF BARI

Why Simulink?

▪ Simulink, makes simulations easier to achieve, by using blocks that correspond to codes you do not see.

▪ With Simulink, the model of the system you want to simulate is more readable, because it is represented by graphics.

▪ You can use Matlab to simulate a system, but you have to program your own routines added to the ones that are provided by Matlab.

▪ Simulink easily allows to simulate hybrid systems that include both continuous

and discrete blocks.

(4)

Why Simulink?

▪ Simulink Real-Time (formerly known as xPC Target), together with x86-based real-time systems, is an environment for simulating and testing Simulink and Stateflow models in real-time on the physical system.

▪ Simulink easily allows to design and simulate complex state machines and flow charts.

▪ Coupled with another of MathWorks’s

products, Simulink can automatically

generate C source code for real-time

implementation of systems.

(5)

DEI -Department of Electrical and Information Engineering

POLYTECHNIC UNIVERSITY OF BARI

▪ Simulink also supports specific embedded targets (e.g. Arduino, Raspberry).

Why Simulink?

(6)

RLC Series Circuit: Step Response

State Variables:

▪ 𝑋𝐴 𝑡 = 𝑉𝑐 𝑡

▪ 𝑋𝐵 𝑡 = 𝑖 𝑡

𝑉

𝑖𝑛

𝑡 = 𝑅𝑖 𝑡 + 𝐿

𝑑𝑖(𝑡)𝑑𝑡

+ 𝑉

𝐶

(𝑡) 𝑉

𝑜𝑢𝑡

𝑡 = 𝑉

𝐶

𝑡 =

1𝐶

׬

0𝑡

𝑖 𝜏 𝑑𝜏

Electrical parameters:

▪ 𝑉𝑖𝑛 𝑡 = 5 𝑉

▪ 𝑅 = 2 Ω

▪ 𝐿 = 2 𝐻

▪ 𝐶 = 0.5 𝐹 Initial state conditions

▪ 𝑋𝐴 0 = 0 𝑉

▪ 𝑋𝐵 0 = 0 𝐴

(7)

DEI -Department of Electrical and Information Engineering

POLYTECHNIC UNIVERSITY OF BARI

RLC Series Circuit: Step Response

𝑉

𝑜𝑢𝑡

𝑡 = 𝑉

𝐶

𝑡 =

1𝐶

׬

0𝑡

𝑖 𝜏 𝑑𝜏

𝑉

𝑖𝑛

𝑡 = 𝑅𝑖 𝑡 + 𝐿

𝑑𝑖(𝑡)𝑑𝑡

+ 𝑉

𝐶

(𝑡)

State Variables:

▪ 𝑋𝐴 𝑡 = 𝑉𝑐 𝑡

▪ 𝑋𝐵 𝑡 = 𝑖 𝑡

ሶ𝑋

𝐴

=

𝐶1

𝑋

𝐵

(𝑡) ሶ𝑋

𝐵

(𝑡) = 1

𝐿 ( 𝑉

𝑖𝑛

𝑡 − 𝑅𝑋

𝐵

(𝑡) − 𝑋

𝐴

𝑡 )

(8)

RLC Series Circuit: Step Response

(9)

DEI -Department of Electrical and Information Engineering

POLYTECHNIC UNIVERSITY OF BARI

RLC Series Circuit: Bode plot with Matlab

𝐺 𝑠 = 𝑉

𝑜𝑢𝑡

(𝑠)

𝑉

𝑖𝑛

(𝑠) = 1

𝐿𝐶𝑠

2

+ 𝑅𝐶𝑠 + 1

>> R = 2; L = 2; C = 0.5;

>> H = tf([1],[L*C R*C 1]);

>> bode(H)

(10)

RLC Series Circuit: Resonance

𝐺 𝑠 = 𝑉

𝑜𝑢𝑡

(𝑠)

𝑉

𝑖𝑛

(𝑠) = 1

𝐿𝐶𝑠

2

+ 𝑅𝐶𝑠 + 1

>> R = 0.4; L = 2; C = 0.5;

>> H = tf([1],[L*C R*C 1]);

>> bode(H)

𝜔

𝑅

= 1

𝐿𝐶

(11)

DEI -Department of Electrical and Information Engineering

POLYTECHNIC UNIVERSITY OF BARI

RLC Series Circuit: Resonance

(12)

RLC Series Circuit: Resonance

(13)

DEI -Department of Electrical and Information Engineering

POLYTECHNIC UNIVERSITY OF BARI

PID Tuning

(14)

Riferimenti

Documenti correlati

Remark 2.2 Obvious rules enabling one to displace source and sink are: – In a graph of type ∃∃ or ¬∃∃, the roles of source and sink can indifferently be played by any two

These appli- cations can greatly benefit from a flexible reconstruction workflow where refined image processing solutions such as innovative flat fielding approaches, ring artifacts

Mais comme les plus hautes entreprises sont ordinairement aussi les plus périlleuses, certainement celle-cy n’est point sans beaucoup de danger ; car encore qu’il

Nanchino”), in cui Nanjing è diventata la più comune Nanchino. In alcuni casi, invece, una traduzione di tutti gli elementi del nome dato a un edificio è sembrata una

Here, it is sufficient to indicate that under the conditions of a commodity money system such as that existing in fourteenth to sixteenth century Europe, combining data on

Gli organi istituzionali preposti alla promozione dell’economia circolare in Cina sono i seguenti: la Commissione per la Protezione dell’Ambiente e delle Risorse

Kimiko non sapeva perché si trovasse come in un vicolo cieco, come se avesse litigato senza neanche un motivo preciso, senza che ci fossero stati problemi o fosse

15 In a constitutional democracy, the political public life loses its religious fundament as a transcendent and unshakeable authority: in Lefort’s suggestive image,