Thursday, March 14, 2013

Using FreeMat

What is FreeMat?

        FreeMat is a free version of the popular MATLAB technical desktop software application which allow the user to solve mathematical equations as well as graphing them. FreeMat works alot like a graphic calculator but the user interface in a programming interface.
 
Graphing y=sin(x).

Graphing y=cos(x)
 
By typing "hold on", two graphs can be drawn on the same page. If "hold off", further equatins will be open on a new page.


          FreeMat also allows the users to wrtie Script Files to perform particular functions or operations. In fact, Script Files are like modules or functions in C++ language.
A Script File to perform square, and square root calculation for a predefined variable. 
 
 
Another main function for FreeMat is to solve for solution for matrix equation. This function is particularly useful for solving complex Kirchoff's law which may form a 6x6 matrix or even bigger.
The martix can be solved by using the inverse function from the liberary of FreeMat. As the as the marix is set up correctly, FreeMat will solve it with ease.
 
There is an easier way to generate point plots for a specific range by using the "linspace" function. This function becomes very handly when compare or adding multiple equations within the same range of data.
3 different exponential graphs shown on the same window.
 
Adding graphs together can be done by simply defining a new variable as the sum of two equations and plot it using the plot function. This will come in handy when adding sinusoid waves together instead of solving it by hands with trig. subsitution.
 
 
Additional Assignments:
 
 
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 output is 2e^(-t/tau), tau as in time constant. Plot the two outputs and identify which circuit will have the lower output sooner.
 
The graph shows that circuit A will have a lower output sooner than B.
 
If the output is changed into 2(1-e^(-7/tau)), replot the graph.
 


Instead of decreasing the output, the output increase.
 
 
2) Determine what the output would be when adding the following two sinusoids: 3sin(2t+10degree) and 5cos(2t-30degree).
The graphical result of the sum of the two sinusoid equations.
 
   Replot the graph with the frequency change to 10Hz.
 
The period changes as frequency changes.


 


No comments:

Post a Comment