Oct 27, 2015

HW#15

Question 1: using the traps() function to estimate area under a curve

Question 2: writing a derivative function
Question 3: I couldn't figure this one out :(

Oct 22, 2015

HW#14

Questions were related to each other. Question 1 dealt with interpolating linearly and cubic slice. Question 2 used polyfit() to fit a first-, second-, third-, and fourth- order polynomial to the given data. Question 3 manipulated the equation and graphed it.


Oct 20, 2015

Lecture 15

I am tired today, not enough energy to type much.
Linear interpolation: estimate a data point between points
Interpolation options for interp1():

Practice exercise for interp1() and 'spline':

Context Example: Thermodynamic properties: using steam tables
Use linear interpolation to determine the internal energy at 215°C. Use linear interpolation to determine the temperature if the internal energy is 2600 kJ/kg.

[insert whiteboard]



















Context Example: Thermodynamic properties: expanding the steam tables

Two-dimensional interpolation
Use interp2()





























HW#13

All questions use a message box to output results.

Question 1: Solving symbolically.
Solving for distance from a pivot point to the center of gravity of a pendulum using a formula for frequency. I just used solve() to find L.

Question 2: Projectile
Solve for horizontal and vertical distances. Using subs() to substitute real values for symbolic data.
Question 3: Weather balloon
Question 4: Spring


Question 5: Trigonometric Function

Oct 15, 2015

Lecture 14

Today we're continuing symbolic functions.
Plotting some functions with set intervals.

Plotting trig graphs, multiple graphs in one, and parametric graphs.

Some symbolic functions: 

This is some screenshots of a few of the different three-dimensional plots using symbolic equations.

Practice problems using three-dimensional plotting functions to plot a symbolic equation.














































Ballistics context example. Using ezplot() to plot projectile motion and range.











































Next is calculus in MATLAB. There are functions that differentiate equations.

We modified the ballistics program to use calculus to find the optimum angle for the maximum range and the maximum range.
























Next is integration. This table shows some integration functions.

HW#12

Question 1: Some practice exercises dealing with symbolic equations and subs()

Question  2: Pendulum
I didn't do anything special for this question. The solution is a very simple 3 line program.
I just created a symbolic equation and then solved for 'L' in the equation.


Question 3: Chemical processes
We had done this question before using matrices and linear algebra. This method is much faster, but the answers are not as accurate as using linear algebra. There is nothing special with this program either.

Oct 13, 2015

Lecture 13

Modified the planetary data program to extract different data.


Today we are focusing on symbolic algebra. This screenshot shows the practice exercises we did in the beginning. The symbols and expressions are going to be used throughout the class.


Using numden() to extract the numerator and denominator of a symbolic expression.

Typing mupad opens a MuPad window.
Practice exercise
An example using solve() to symbolically solve for Q.














Solving a system of equation: originally with linear algebra, and then with solve().
This example containing free-fall and kinematics. Solve for the range.




HW#11

Most of the problems were fairly easy to do, almost on-par with the practice exercises from in class.

Questions 1 and 2: practice exercises (pretty much)


Question 3: Simple encoding
I used if statements inside of a while loop to change the odd and even elements into different characters. The odd elements had a different type of encoding than the even elements. Also used was a menu() function to ask the user if they want to decode the text.








Question 4: Planetary data
Practicing struct arrays
Question 5: Cell arrays and extracting data