Sunday, March 9, 2014

Freemat Assignment 1

Part 1:

Introduction.
     The assignment asks to find the current that runs through a resistor in the given circuit. The goal of this assignment is to use FreeMat to solve the linear set of equations that would be made when solving the circuit.



Procedure.
     A Picture of the circuit has the given known variables. The current that needs to be solved is through R_3.
V1 = 15V V2 = 7V R1 = 20 Ohm R2 = 5 Ohm R3 = 10 Ohm.
Mesh 1 runs through the left loop clockwise and Mesh 2 also runs through the right loop clockwise.


We set up the equations using KVL and end up with two unknown currents.















The resultant linear set of equations were put in FreeMat to be solved and the currents were found to be:


Current from Mesh 1 = 0.8429 A Down 
Current from Mesh 2 = 1.0286 A Up

Current through R3 = .1856 A Up


Conclusion
     The FreeMat software successfully generated the correct answer for the assignment.

Part 2

Introduction
     The second part of this experiment asks to use FreeLab to visualize various time varying signals by using the plot function.

Procedure

A1)
Part A: 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 output is 2e^-t/(tau). Using MATLAB, plot the two outputs, and tell me which circuit will have the lowest output sooner?

Commands
linspace(0,700);
output1 = 2*(exp(-time/100) );
output2 = 2*(exp(-time/200) );
plot(time,output1,'r-'   ,   time,output2,'b-');




The circuit with the time constant 100ms will have the lowest output sooner.

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

Commands
time = linspace(0,700);
output1 = 2*(1 - exp(-time/100) );
output2 = 2*(1 - exp(-time/200) );
plot(time,output1,'r-'   ,   time,output2,'b-');



A2) 
Part A: Both theoretically and using MATLAB, determine what the ouput would be when adding the following two sinusoids: 3sin(2t+10) <degrees> and 5cos(2t-30) <degrees>. Does the MATLAB output resemble your theoretical output - plot your theoretical output in MATLAB, and compare.



Commands
time = linspace(-3*pi,3*pi);
output = 3*sin(2*time+10*pi/180) + 5*cos(2*time-30*pi/180);
outputT = 7.30*sin(2*time + 0.726);
plot(time,output,'r-'   ,   time,outputT,'b-');



Yes, my theoretical output resembles the adding of sinusoids.
Part B: You now need to repeat this for a large number of frequencies. Write a script to implement this and demonstrate the output at 10Hz

Commands
freq = 10;
time = linspace(-3*pi,3*pi);
omega = 2*pi*freq;
output1 = 3*sin(omega*time+10*pi/180) + 5*cos(omega*time-30*pi/180);
plot(time,output1,'r-');



   









Conclusion.
     Freemat is awesome and graphs functions and stuff. Okie.


No comments:

Post a Comment