Computational Methods - Project 1 | MCEN 3030, Study Guides, Projects, Research of Mechanical Engineering

Material Type: Project; Class: COMPUTATIONAL METHODS; Subject: Mechanical Engineering; University: University of Colorado - Boulder; Term: Unknown 1989;

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 02/13/2009

koofers-user-edy
koofers-user-edy šŸ‡ŗšŸ‡ø

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Computational Project # 1
Due January 26
1. Develop, debug, and test a program (MATLAB m-file) that for arbitrary m and n
(input parameters):
a) Defines vector
(
)
1
11 cos , 1,
2 1
i
i
x i m
m
Ļ€
 
āˆ’ļ£« 
= āˆ’ =
 
 
 
āˆ’
 
 
…
using single loop.
b) Define vector
(
)
( )
1
sin , 1,
2 1
j
j
y j n
n
Ļ€
 
āˆ’
= =
 
 
āˆ’
 
…
using Matlab vector
operations instead of using loop.
c) Define two-dimensional array
2 2
1 1
, 1, , 1,
2 3
ij i j
a x y i m j n
   
= āˆ’ + āˆ’ = =
   
   
using double loop.
d) Define two-dimensional array
2 3
1 2 , 1, , 1,
4 3
ij i j
b x y i m j n
   
= āˆ’ + āˆ’ = =
   
   
… …
using ā€œmeshgridā€ Matlab
command instead of using double loop.
e) Plot y vs. x. Define the names for the axes using on-line commands. Create
legends.
f) Plot two-dimensional array aij as 3-dimensional surface. Use two different
styles for the surface: ā€œshading interpā€ and ā€œshading facetedā€.
g) Create a filled contour plot of two-dimensional array bij. Use jet as a
colormap.
For items (a)-(g) create a single function that performs all the tasks with n and m as
input parameters. Run and test the program for (n,m)=(11,6), (51,26) .
2. Using the Symbolic Math Toolbox create, debug, and test another program
(MATLAB m-file) that
a) finds first 7 terms of Taylor series expansion for
( )
2
sin
x
x e
about x=0.
b) differentiates the function
(
)
4 cos
sin
x
x e
P.S. Email your code to [email protected]. The program that you send should be
a working program All the codes will be checked whether they run or not. . If they are
erroneous, but run, points will be taken for the errors. If the code is not running (it has
some syntax errors), an additional 25% will be taken out. The goal of this class is for
you to be comfortable solving engineering problems. Please take your time and learn
how to trust the computer.

Partial preview of the text

Download Computational Methods - Project 1 | MCEN 3030 and more Study Guides, Projects, Research Mechanical Engineering in PDF only on Docsity!

Computational Project # 1

Due January 26

  1. Develop, debug, and test a program (MATLAB m-file) that for arbitrary m and n (input parameters):

a) Defines vector

1 cos , 1, 2 1 i

i x i m m

 ^ āˆ’ 

… using single loop.

b) Define vector

sin , 1, 2 1 j

j y j n n

… using Matlab vector

operations instead of using loop. c) Define two-dimensional array 2 2 1 1 , 1, , 1, 2 3

a ij xi y (^) j i m j n = ^ āˆ’ ^ + ^ āˆ’  = =        

… … using double loop.

d) Define two-dimensional array 2 3 1 2 , 1, , 1, 4 3

b ij xi y (^) j i m j n

… … using ā€œmeshgridā€ Matlab

command instead of using double loop. e) Plot y vs. x. Define the names for the axes using on-line commands. Create legends. f) Plot two-dimensional array aij as 3-dimensional surface. Use two different styles for the surface: ā€œ shading interp ā€ and ā€œ shading faceted ā€. g) Create a filled contour plot of two-dimensional array bij. Use jet as a colormap. For items (a)-(g) create a single function that performs all the tasks with n and m as input parameters. Run and test the program for ( n,m )=( 11,6 ), ( 51,26 ).

  1. Using the Symbolic Math Toolbox create, debug, and test another program (MATLAB m-file) that

a) finds first 7 terms of Taylor series expansion for ( )

2 sin x e x about x=.

b) differentiates the function sin ( x^4 ) e cos x

P.S. Email your code to [email protected]. The program that you send should be a working program All the codes will be checked whether they run or not.. If they are erroneous, but run, points will be taken for the errors. If the code is not running (it has some syntax errors), an additional 25% will be taken out. The goal of this class is for you to be comfortable solving engineering problems. Please take your time and learn how to trust the computer.