ME 318 Engineering Computational Methods
Midterm Examination
Spring 2014
Instructor: Prof. Ashish D. Deshpande
February 27, 2014
3:305:00 pm
Student Name:_
Student EID:_
Lab Section Number:_
I have neither given nor received any unauthorized aid on this e

ME318MProgrammingandEngineeringComputational
Methods
Homework#4
Assigned:February11h,2015
Due:February18th,2015
Name:_
SectionUniqueNumber:_
UID:_
Please enclose relevant printouts of the code you wrote and the output of the code in
MATLABsworkspace.
The

ME 318M Programming and Engineering Computational
Methods
Homework #5
Assigned: February 20th, 2015
Due: February 26th, 2015
Name: _
Section Unique Number: _
UID: _
Please turn in your answers on paper. No programming is required for this assignment.
Prob

ME 318M Programming and Engineering Computational
Methods
Homework #3
Assigned: February 6th, 2015
Due: February 12th, 2015
Name: _
Section Unique Number: _
UID: _
Please enclose relevant printouts of the code you wrote and the output of the code in
MATLA

Chapter 2
Programming in Matlab
A program is a sequence of step-by-step commands to perform one or multiple tasks. Up until
now you have been entering commands one by one in the COMMAND PROMPT but a program
allows you to enter multiple commands to be run

ME 318M Programming and Engineering
Computational Methods
Lab #1 Solution
Problem 2.1 Construct a statement that will be true if x is equal to 12 or -3.
if(x=12|x=-3)
(commands)
end
Problem 2.2 Write a program to add the first 100 even numbers.
sum=0;
for

ME 318M Programming and Engineering
Computational Methods
Lab #1 Solution
Problem 1.1 For each of the names above, write down why they arent valid in MATLAB
1.
2.
3.
Begins with a number
Uses an invalid character -
Uses an invalid character #
Problem 1.2

Chapter 5
Finding Roots of Nonlinear
Functions of One Variable
5.1
Introduction
Finding the roots of an equation of one variable, f (x), means nding the set of values xi such
that f (xi ) = 0.
There are a number of problems in which this type of calculati

Chapter 3
Functions and Visualizing Data
3.1
Functions and Subroutines
Functions can be thought of independent programs in themselves. They allow the programmer
to dene a specic action that (usually) takes in some data, does some processing, and returns
a

ME318MProgrammingandEngineeringComputational
Methods
Lab#4Solution
Problem 4.1
l=input('Enter lower limit:');
u=input('Enter upper limit:');
choice=0;
while choice~=1&choice~=2
choice=input('Enter 1 to include limits, 2 to exclude:');
end
if choice=1
x=0;

Chapter 4
Algorithms, Programming Logic and
Debugging
4.1
Introduction
In this lab, we will focus on bringing together all the programming skills that we have learned
so far from the previous labs.
4.2
Understanding Algorithms
An algorithm is a step-by-st

ME318MProgrammingandEngineering
ComputationalMethods
Lab#5Solution
Problem 5.1
Functions:
function y=ME318M_Lab5_f(x)
y=(3/500).*(x.^3-18.535*x.^2+25.697*x+28.099);
end
function y=ME318M_Lab5_g(x)
y=2*x.*exp(cos(3*x).*exp(-1*x)+70;
end
Command Window:
> X

Chapter 6
Finding Roots: Newtons Method
and Secant Method
6.1
Introduction
Finding the roots of an equation of one variable, f (x), means nding the set of values xi such
that f (xi ) = 0.
Continuing from last lab, we will discuss two additional more compl

Chapter 8
Solving Systems of Nonlinear
Equations
8.1
Introduction
So far we have learned how to solve nonlinear systems with only one variable and linear systems
with multiple variables. In this lab, we will combine these to skills and learn to nd solutio

Chapter 7
Solving Systems of Linear Equations
7.1
Introduction
Sets of linear equations can arise in many physical applications. They arise directly in various
problems where conservation laws are involved and applied discretely (balance of forces, conser

Chapter 1
Introduction to MATLAB
1.1
Introduction to MATLAB
MATLAB is a powerful graphing/plotting and high-level programming tool. MATLAB is used
widely in mechanical engineering industry and research labs for analysis, simulations and even
real-time con

ME 318 Engineering Computational Methods
Midterm Examination
Spring 2015
Instructors:
Prof. Ashish D. Deshpande
&
Dr. Jeannie Falcon
March 05, 2015
7:309:00 pm
Student Name:_
Student EID:_
Lab Section Number:_
I have neither given nor received any unautho

1
ME 318 Engineering Computational Methods
Midterm Examination
Spring 2014
Instructor: Prof. Ashish D. Deshpande
April 3rd, 2014
3:305:00 pm
Student Name:_
Student EID:_
Lab Section Number:_
Please show at least one or two representative steps to demonstr

ME318MProgrammingandEngineeringComputational
Methods
Homework#3
Assigned:February6th,2015
Due:February12th,2015
Name:_
SectionUniqueNumber:_
UID:_
Please enclose relevant printouts of the code you wrote and the output of the code in
MATLABscommandwindow.

ME 318M Programming and Engineering Computational
Methods
Homework #3
Assigned: February 6th, 2015
Due: February 12th, 2015
Name: _
Section Unique Number: _
UID: _
Please enclose relevant printouts of the code you wrote and the output of the code in
MATLA

Chapter 12
Using the Runge-Kutta Method to
solve ODEs
12.1
Introduction
The Runge-Kutta method is an advanced technique for estimating the solution of initial value
based dierential equations numerically. While Euler and Heuns method estimate the integral

ME 318M Programming and Engineering Computational
Methods
Homework #3
Assigned: February 6th, 2015
Due: February 12th, 2015
Name: _
Section Unique Number: _
UID: _
Please enclose relevant printouts of the code you wrote and the output of the code in
MATLA

ME 318M Programming and Engineering Computational
Methods
Homework #4
Assigned: February 11h, 2015
Due: February 19th, 2015
Name: _
Section Unique Number: _
UID: _
Please enclose relevant printouts of the code you wrote and the output of the code in
MATLA

ME 318M
Programming and Engineering Computational Methods
Spring 2015
Homework # 1
Assigned: January 22th, 2015
Due: January 29th, 2015
Name: _
Section Unique Number:_
UID: _
Please enclose relevant printouts of the code you wrote and MATLABs workspace in