# Write 2 pages thesis on the topic circuit project 2. Lab Report, Engineering and Construction Circuit Project 2 Simulation Simulation The equations are xn = Ax + BU and y = Cx + Du 1.1. Source Code

Write 2 pages thesis on the topic circuit project 2. Lab Report, Engineering and Construction Circuit Project 2 Simulation Simulation The equations are xn = Ax + BU and y = Cx + Du 1.1. Source Code

% Function definition

Function [xdot] = trans_analysis(tim, xn)

xn1 = zeros (4, 2).

xn1 = [xn(1). xn(2). xn(3). xn(4)].

Ln1 = 1.4.

Rn1 = 3300.

Ln2 = 0.15.

Cn1 = 51e-6.

Cn2 = 14e-6.

un = 150 * sin(10 * tn).

Ax = [0 1 1 0.(-Ln2 – Ln1) / (Ln1 * Ln2 * Cn1) (-Rn1 * Ln2 – Rn1 * Ln1) / (Ln1 * Ln2) – 1 / (Ln2 * Cn2) 0. 0 0 1 1.-1 / (Ln2 * Cn1) -Rn1 / Ln2 -1 / (Ln2 * Cn2) 0].

Bx = [0. (Ln2 + Ln1) / (Ln1 * Ln2).0.1 / Ln2].

Un = un.

xn = A * xn1 + B * U.

Calling Functions File

t0 = 0.

tnf = 3.

tn_interval = 0.10.

xn0 = [0.1.1.0].

tspan = t0: tn_interval:tf.

[tn, xn] = ode22(trans, tspan, x1).

figure(1)

plot(tn, xn(:,5),Tn / Xn)

grid on

title(circuit current)

xlabel(Time – seconds)

ylabel(Current Amp [A])

figure(2)

plot(tn, xn(:, 5),Ks)

grid on

title( Current / Time)

xlabel(Time seconds)

ylabel(Current [Amps])

figure(3)

plot(t, (xn (:, 5) – xn(:, 5)), ks)

grid on

title(Current / Time)

xlabel(Time sec’)

ylabel(Current [Amps])

Y = C * x + d * U

% first condition is ST. input and FT:

yt = 0. Tn = 0.11. Nt = 15.

ut = 5. %

for ii = 0 : t : N

knt1 = Tnx * f (yy, t, tt).

knt1 = Tnx * f (yt + knt1, ut, tNt + T).

yt = yt + 0.20 * (kt1 + kt2).

end

1.2. &nbsp.Using ODE

1.2.1. Output Display

1.3. Using State Space block in Simulink

1.3.1. Output Display

&nbsp.

1.4. Building scheme applying Powersim toolbox

1.4.1. Output Display

Fig 4: Current against Time

2. Report

2.1. Values of the Parameters

The parameters being used in the simulation are voltage, electric current, electric charge from the capacitors, resistance, power and time. The ranges of the values used are shown below:

Parameter

Upper Limit

Lower Limit

Voltage (V)

2

5

Electric Charge – Te

10

20

Electric Charge – Ti

100

200

Resistance R1

10

20

Resistance R2

10

20

Time (Seconds)

20

30

2.2. Introduction

The simulation of the electric circuit in this exercise takes three dimensions, each of which shows a unique result. The methods are simulation with ODE, Powersim toolbox and Simulink and State Space block (Brian, 27). The output demonstrates the variation of the electric properties against time.

2.3. Schematic Diagram

2.4. Comparison of the three Results

The first simulation shows three lines of voltage for Vx1, Vx2 and vx3. These are the three variables representing the voltage at different time and at different currents. Vx3 has the greatest amplitude followed by vx1 then finally vx2. The second simulation shows non linear relationship between the voltage and the time (Shailendra, 54) and (Khaled 38). The bode plottting shows almost constant boud against the time variable then a decline from the midle to the end. Simulation 3 shows results in separate plotting for y1 and y2 in which the amplitude of the voltages are higher that in a separate y1 plotting.

Works Cited

Brian Su-Ming Fan,&nbsp.Modeling and Simulation of a Hybrid Electric Vehicle Using MATLAB/Simulink and ADAMS, NewYork: University of Waterloo, 2007. DepaRnment of Mechanical and Mechatronics Engineering, 2007.

Shailendra, Jain, MODELING & SIMULATION USING MATLAB SIMULINK (With CD). New Delhi: Wiley India Pvt. Limited, 2007

Khaled M. Gharaibeh, Nonlinear Distortion in Wireless Systems:&nbsp.Modeling and Simulation with MATLAB, New York: John Wiley & Sons, 2011.