Saturday, September 12, 2015

MATLAB Homework 1


Problem 1


   For the first problem, I declared a bunch of variables that was given for the assignment. Using these variables, I created equations to solve for the total volume and the total surface area. For the surface area, I calculated the surface area of both spheres, then the side of the cylinder, and then the top and bottom of the cylinder. I added the surface areas together but subtracted the surface area of the top and bottom cylinder. This makes sure I don't account for the small area on the sphere that is blocked by the cylinder.

Problem 2


   For the second problem, we had to calculate the temperature of a gas with the given parameters using two different equations. The temperature were similar but not the same. I stated the givens at the top. I found that everything was not in S.I. units but realized that all the units would cancel out in the end leaving a temperature in Kelvin.

Problem 3


    For problem 3, we take a look at a circuit and calculate the response denoted by S. This response has 2 values. After, I created a set of numbers for R and recalculated the response. Some of the numbers shown to be complex numbers.


   I changed the parameters for R to find the smallest value of R that produces a real number for the response. 


   Again, I change the parameters of R. I found that the smallest value for R was 634. But, I realized that I was only checking half of the equation.


I changed the equation and found that it was still at 634. I, also, found that when the R value increases, the S value decreases.

Problem 4


   The forth problem had us evaluating gravitational pull. I stated the values above and created an equation to solve for the force afterward. Then, I created a set of 10 distances that are evenly spaced using the linspace command. I plugged this set of values to the force equation while being mindful that the dot product is needed.

Problem 5


   For problem 5, I am given the amount of miles a group of cars drive a year, the miles they  can drive per gallon, and the rate at which they produce carbon dioxide. I had to find the amount of carbon dioxide produced. This is a simple unit conversion problem. I start with the rate at which cars drove a year and cancel the miles using miles er gallon, leaving me with gallon per yer and cancel out gallons with the rate for pounds of carbon dioxide per gallon. I do the same type of unit conversion for the second part when I solve for the cost of driving each car, but instead of using the amount of carbon dioxide, I use the cost rate.

No comments:

Post a Comment