Saturday, March 16, 2013

MatLab Laboratory

Simple Plot

Two Plots on a Graph

Solving simultaneous equations


 Assignment 1:

Given the circuit with V1=15V, V2=7V, R1=20ohms, R2=5ohms, R3=10ohms, find the current through R3 using FreeMat.


Using Mesh analysis,
At i1, 30i1 -10i2 = 15
At i2, -10i1 + 15i2 = 7

Solving the simultaneous equations we get;


 where i1 = 0.8429 and i2 = 1.0286.
At the upper node we have i1 = i2 + I, so

I = i1 -i2 = -0.1857A





Plotting exponentials and adding sinusoids
Assignment 1:
1. Circuit A has a time constant of 100ms, while circuit B has a time constant of 200ms. Because of the design of the circuit, the ouput is 2e^-t/tau. Plot the two outputs, and describe which circuit will have the lowest out put sooner.

Circuit A (time constant = 100ms) has the lowest output sooner.


2. The circuit was redesigned, so the output is now 2(1-e^-t/tau). Plot the output of both circuits.

Assignment 2:
1. Both theoretically and using MATHLAB, determine what the output would be when adding the following two sinusoids: 3sin(2t+10deg) and 5cos(2t-30deg). Does the MATHLAB output resemble your theoretical outpu - plot your theoretical output in MATHLAB, and compare.

Two sinusoids and the superposition of both (red)



Theoretical output of addition of both sinusoids


Theoretical graph of the superposition of both sinusoids
The theoretical and MATHLAB generated sinusoid superpositions differ by some phase angle.

2.  You now need to repeat this for a large number of frequencies. Write a script to implement this and demonstrate the output at 10Hz.

Superposition of the two sinusoids at 10Hz




No comments:

Post a Comment