Friday, March 10, 2017

MATLAB Practice


Objective. 
The reason for introducing MATLAB to the class is to make our calculations easier to acquire since we are dealing with circuits who have many unknown currents or voltages in the form of a system of equations. We can place theses equations into matrices and solve for the unknown using the reduced row echelon or using the matrix inverse. We will use all the skills from the MATLAB practice packet for our future problems involving circuits. 

MATLAB Codes and Results:
The images below shows the use of percentage sign to signify that there is comment written with the particular problem or exercise. The answer is also shown on the right of some of the images. However, Some of the problem answers were too long to show so they had to be suppressed. Overall, Matlab makes problem solving easier than doing on paper and saves time. I also used %% to make a page break or else the results would all show from each exercise. It helps with organization and to understand the results based on the problems seen on the right highlighted in yellow.



Figure 1 The image simple math functions and the use of creating arrays. We can also manipulate the array by using the (') to transpose the array. 
Figure 2. The images above shows the use of addressing arrays and using RREF on matrices for finding unknown values. Furthermore, the image shows how to create plots with appropriate title and axis labeling. 



Figure 3. The image above goes along with Figure 2 problems as part of plotting exponentials and sinusoids. 

Figure 4. The image shows the use of adding sinusoids and conversion between rectangular to polar and vise versa. 

Figure 5. The image shows the plot when adding a cosine and sine function. Unfortunately, it is difficult to read which function in which. However, it can be seen more clearly in Figure 6 since a legend was introduced in the plot. 

Figure 6. The image shows the plot of circuit outputs.

Figure 7. The image shows how to convert rectangular to polar. and solving for roots of equations. 

Figure 8. This images is part of Figure 7 problems where not only the MATLAB results needed to be shown but also the theoretical results as seen above.
MATLAB Summary and Learning Outcome:
The most important outcome learned was the use of solving for the roots of equations for which would be later used for time analysis of a circuit. It is also helpful in solving a system of linear equations. Using the program has substantially increase problem solving performance. Not only is it helpful for problem solving but we are able to create our own functions or equations that may be saved for future use such as conversions. By calling the function, we can easily solve a problem depending what equation is needed to solve the problem. 

No comments:

Post a Comment