Monday, February 29, 2016

MathLabTutorial 02/28/2016

Introduction to Numerical Computation with FreeMat
Below are all the works-practice, exercise, and assignments
Exercise 1 page, using FreeMat as a calculator





Create a row vector, starting from 0 to 10; 0.5 increment





CC= cos(x)*sin(x) gave error because 1*21 marix multiply 1*21 does not make sense, it should be (1*21)x(21*1). For the DD=cos(x).*sin(x),  it just each x from each matrix multiply together, which makes sense


Plotting

Used Hold command and I added one more graph

hold off and replot the graph

If we plot sinx and cosx as x and y, we get a circle, much as we expect as polar coordinate




solving for system of equation by finding inverse matrix




complex number practice






script to convert  from rectangular to polar coordinate








II. Finding roots and finding Laplace transform
By finding the root,  I now could factor out the denominator. 

I performed fraction decomposition manually and was able to use the table to find the inverse Laplace transform


III. Summary:
Overall, I found it not really hard to do. Just a few comments, sometimes, the tutorial came short so I had to look up some information online, such as when I wanted to print the polar coordinate, I had to look up sprintf. Secondly, I think that Matlab is easier than Java/C++ when it comes to Math, for these program, it would have cost me much greater time to finish with Java.

second day 02/25/2016

Date: 02/25/2016
Kirchoff review, introduction to waveform, and how to use analog discovery
I. Kirchoff review:
Here we were given a circuit ( I believed this problem was from 4B class). Our goal was to find the potential of the middle resistor



For this problem, we actually used different approach. We assumed that the power source produced 50W, and all of the resistors would dissipate all of the power produced, using conseravtion of energy, we found the V_0 to be 20V

II. Introduction to Waveform:
We already installed waveform (and also Freemat on my laptop). Our goal now is to find relationship between current and potential by varying the potential using analog
1. First lab- predict how would the graph voltage v. current behave?

Test Trial- We checked to make sure that everything worked

Waveform 2015 version. The linear horizontal line of voltage indicated we were using the DC current

We checked the resistor- 102 ohms, our resistor's color was brown, black, brown, yellow, which was 100 ohms



Here is the data, Vs is the voltage from the analog discovery. Vr is from the multimeter. For this lab, our first attempt was to use two multimeters at the same time, but due to greater resistor value error( the more multimeters we used, the greater the perecent of the resistor), we only measured current and voltage one at the time.

Here are the two plots Vs vs. current and Vr vs current, notice that the resistor, at a point, would be 120 ohms if we take voltage/ current at that time
II. Definition-counting nodes, branches, and loops:
Node: the connection between two branches, the nodes are the conjunction, and the loop is a completion of a circuit

Here, we have 7 elements- therefore, we have 7 branches,5 nodes, and 3 loops

By applying Kirchoff Law, we able to find the  Vab=22V from I=6A

III. Mosfet Lab:
We were given the mosfet, our goal is to connect the mosfet in series with the analog and the multimeter.

Here is the setup. The DMM was connected to the resistor and to the left pin of the mosfet (and then connected to the red wire 5V). The middle pin of the mosfet was connected to the yellow female head, to read the G value. and the last pin was connected back to the circuit and the black female head (ground) 
2. Data Analysis

As we look at the graph, initially from 0 to 1.4, there was nothing happen, the mosfet now is just a regular piece of iron. As the voltage went to 1.5V, the electron started to "jump" to another pin, closing the circuit (Electron will jump with high enough potential- really similar to Hall Effect). After that, the current stayed constant
V. Conclusion:
Today we spent most of our time to study how to use Waveform program. At the first look, the Analog Discovery seemed to be complicated due to its many wires, but not too complicated after we figured things out. Eventually, I found it easy to set up circuit on the breadboard and adjust the voltage accordingly, much better than just using oscilloscope as we did in 4B

First day- review 02/23/2016


First Day of Class 02/23/2016
I. Review of a circuit:
Today, Professor Mason started us off with a simple electric circuit. The middle light bulb was not turned on because the current choose the top part with lower resistance to go through. Therefore, the top and bottom light bulbs stayed the same whereas the middle was still not on


II. Sinusoidal Graph- draft plotting
1. Current, charge, potential:
Here we recalled that current is the time rate of change of charge. I=dq/dt. With the given graph, we used our intuition to draw our graph, including the graph function, which turned out  to be correct.


the graph is of charge of time. For intensity, we just needed to take the first derivative with respect to time.

Here we had to find the charge from 0 to 2 seconds. Since we already had the i(t). We just needed to take integral with given time range to find Q.

Here we were given the voltage =10V, the function power=10i. Since we had the graph of current, the graph of power is just 10 times the magnitude of current. Since we knew that E=P*t, we understood that the energy graph would be a triangle
III. Experiment with the breadboard:
We were given the breadboard and the multimeter. Our goal was to find the relationship between the holes in the same rows in the same section, the holes in the same rows with the different section, and the holes in different rows. Note: we were measuring the current.
Here is our setup, we assumed that the multimeter had minimal resistance.

We made the connection by adding the jumper cable in the middle

Only the holes in the same rows in the same section; or the circuit must have jumper wire ; to make a closed circuit

Here we tested the circuit of the outermost column; they are actually connected



Here is our conclusion, notice that the green continuous line is how the circuit connects
V. Plotting the power graph v. time based on current and potential graph:
Here, we were given the two graphs of current and potential. First, when we made the new graph, the divided the time scale to four pieces, 0-4, with the increment of 1. Then we noticed that we just needed to find the first half, the second half would be the reflection through the vertical line
After getting our graph, we found the graph equations, take integral and times 2 (due to symmetry)
VI. Summery:
Today, we spent first 20 minutes of class figuring out how the circuit work, which was also a good chance for us to review Kirchoff's law in the circuit. Most of our time today was about learned how to use the breadboard. In addition, we also reviewed our skills and intuition to understand the relationship between current, charge, and intensity. We agreed that with the breadboard, it is easier for us to set up the circuit than we did in 4B, which was a mess of wire and hard to follow