Engineering
College of San Mateo
ENGR 215
L. Demsetz
Simulation Project
Assigned:
Due:
October 18, 2012
Proposal November 10 (will be returned with comments by Nov. 14)
Code upload December 4
Final Report and Presentation December 6
This project should de
%cfw_
Jeffrey Chu, ENGR 215, Dr. Demsetz
Assignment #5, A5P1.m
%
% Calculating Equivalence resistance in a series or parallel circuit,
% assuming that the value of R is the same for all resistors.
response = input('Series or Parallel? S/R: ','s');
if(resp
%cfw_
Jeffrey Chu, ENGR 215, Dr. Demsetz
Assignment #5, A5P2.m
%
function c = A5P2(a,b)
if (a<0|b<0)
abs(a);
abs(b);
end
if (a=0|b=1|a=b)
c = b;
return;
end
if (a=1|b=0)
c = a;
return;
end
if (a>b)
c = GCD(b,mod(a,b);
return;
else
c = GCD(a,mod(b
%cfw_
Jeffrey Chu, ENGR 215, Dr. Demsetz
Assignment #5, A5P3a.m
%
W = 2;
L = 2;
T1 = 70;
T2 = 200;
x = 1;
y = 1;
w = 0;
for n = 1:2:19
w =(2./pi).*(2./n).*sin(n.*pi.*x)./L).*(sinh(n.*pi.*y)./L)./(sinh(n.*pi.*W)./L)+w);
disp(w)
end
Ta = (T2 - T1).*w + T1
%cfw_
Jeffrey Chu, ENGR 215, Dr. Demsetz
Assignment #5, A5P3c.m
%
W = 2;
L = 2;
T1 = 70;
T2 = 200;
Tf = T1*0.01 + T1;
% Temperature within 1% of result is basically when w approaches zero, so
% Tf = (T2-T1)*0 + T1)*0.01 = T1*0.01;
x = 1;
y = 1;
w = 0;
w1
Jeffrey Chu, ENGR 215, Dr. Demsetz
Assignment #2
1. Problem 25/26 (no work)
2. Problem 27
U = [7,3,2,; 3,1,3; 9,4,5; 2,5,4; 6,2,1]
P = [16,14,10,12; 12,15,11,13; 8,9,7,11; 14,13,15,17; 13,16,12,18]
C = U'*P
(a) where C represents Quarterly costs.
C =
326
function [dist,vel] = drop(g,vO,t);
% Computes the distance traveled and the velocity of a dropped object,
% as functions of g, the initial velocity v), and the time t.
vel = g*t + vO;
dist = 0.5*g*t.^2 + vO*t;
a = 32.2;
initial_speed = 10;
time = 5;
[fee
%Jeffrey Chu, ENGR215
function t = A3P4(h,vO,g)
% Computes the time of a dropped object.
% Given: h = vO*t - 1/2*g*t.^2
% Let's convert the equation to a polynomial instead:
% 1/2*g*t.^2 - VO*t + h = 0
% Putting the polynomial in an array using coefficie
Engineering
College of San Mateo
ENGR 215
L. Demsetz
Recursion Examples
Below are two recursive functions and the output that they produce. Display statements have
been added to demonstrate the recursive calls.
function result = mymin(inArray)
%Recursive
Engineering
College of San Mateo
ENGR 215
L. Demsetz
Sample Questions for Exam 1
Exam 1 will be Thursday, October 4 during lecture and lab for the on-campus section and 5:10 7:30 p.m.
in 19-124 for the on-line section. There will be a pencil and paper por
Engineering
College of San Mateo
ENGR 215
L. Demsetz
Solutions to Sample Questions for Exam 1
1. For the matrix A =
1
5
9
13
2
6
10
14
3
7
11
15
4
8
12
16
What will be displayed when the following MATLAB statements are executed (assume the statements
are
Engineering
College of San Mateo
ENGR 215
L. Demsetz
Sample Questions for Exam 2
Exam 2 will be Thursday, November 8 during lecture and lab for the on-campus section and 5:10 7:30
p.m. in 19-124 (overflow portion) for the on-line section. There will be a
Engineering
College of San Mateo
ENGR 215
L. Demsetz
Name:
What is the most advanced math class you have completed?
What is the most advanced physics class you have completed?
Note: ENGR 215 does not have a physics prerequisite.
Intended major and transfe
Engineering
College of San Mateo
ENGR 215
L. Demsetz
Sample Questions for Final Exam
The final exam is Thursday, December 13 in 19-124, 11:10 a.m. -1:40 p.m. for the on-campus section and
5:10 p.m. 7:40 p.m. for the on-line section. The exam is open book
Engineering
College of San Mateo
ENGR 215
L. Demsetz
Solutions to Sample Questions for Final Exam
The final exam is Thursday, December 13 in 19-124, 11:10 a.m. -1:40 p.m. for the on-campus section and
5:10 p.m. 7:40 p.m. for the on-line section. The exam
Engineering
College of San Mateo
ENGR215
L. Demsetz
ENGR 215 Computational Methods for Engineers & Scientists
Fall 2012, 3 units
Section AX, CRN 91590, Lecture: TTh 11:10 12:00 in 19-103107, Lab: T Th 12:10 1:30 in 19-124
Section WX, CRN 91595, on-line; p
Engineering
College of San Mateo
ENGR 215
L. Demsetz
Solutions to Sample Questions for Exam 2
Exam 2 will be Thursday, November 8 during lecture and lab for the on-campus section and 5:10 7:30
p.m. in 19-124 (overflow portion) for the on-line section. The
%cfw_
Jeffrey Chu
ENGR 215, Dr. Demsetz
Assignment 7: mysort.m
Sorts an array of numbers in increasing order
%
function num = mysort(num)
for i = 1:length(num)-1
min_index = i;
for j = i+1:1:length(num)
if (num(j) < num(min_index)
min_index = j;
end
Chapter 7 solutions for problems 22,23,25
22. The session is
Temp = [1:4,6:8,10:12];
Time = [10,9,18,24,21,20,18,15,13,11];
Temp_int = [5,9];
interp1(Temp,Time, Temp_int)
ans =
22.5000 16.5000
Thus the estimated temperatures at 5 P.M. and 9 P.M. are 22.5
Chapter 7 solutions for problems 9-14,16
9. The calculations can be done using the program like that given in Example 7.2-2.
mu = 8.007; sigma = 0.005;
a = 8.007-0.01; b = 8.007-0.01;
P = (erf(b-mu)/(sigma*sqrt(2)-erf(a-mu)/(sigma*sqrt(2)/2
The result is