Docsity

GEEN 1300 Test 4 - Solving Nonlinear Equations & Functions with Matlab, Exams of Engineering

Toggle sidebar
bg1
GEEN 1300 Introduction to Engineering Computing Summer 2005
Section Test #4 โ€“ Practice Test
1. Solve the following set of nonlinear equations using Matlab.
() ()
(
)
() () ()
() () ()
123
123
12 3
s
in x cos x ln x 0
cos x 2 ln x sin x 3
3lnx sinx cos x 2
+
โˆ’=
+โ‹… + =
โ‹…โˆ’ + =
using initial guesses
1
2
3
x
1.0
x
3.0
x
1.0
=
=
=
Write a Matlab script file called SolveNonlinSet.m that does this. Write in your
solution here too:
1
x
=____________
2
x
=____________
3
x
=____________
2. Develop a Matlab script file, called PlotYZW.m, that creates a single plot of the
following 3 functions over the range 0x5
โ‰ค
โ‰ค. Format the plot with different line
styles so the 3 curves can be distinguished on a black-and-white print-out of the
plot. Do not use markers. Add a grid, a title with your name in it, and axes labels x
and Y,Z and W. Add a legend to the plot also which shows the equations in
Matlab syntax (see help legend).
(
)
()
x
ycosx
1
zcosh x
w1e
โˆ’
=
=
=โˆ’
3. Write a Matlab function, called Ellipsoid, that has three arguments, a, b , and c,
the three semi-axes of an ellipsoid, and computes the volume of the ellipsoid. Test
the function with the following values:
a 6000= b 5500= c 6500
The formula for the volume of an ellipsoid is 4abc
3
ฯ€
โ‹…
โ‹…โ‹…
What is the result? __________________
pf3
pf4

Partial preview of the text

Download GEEN 1300 Test 4 - Solving Nonlinear Equations & Functions with Matlab and more Exams Engineering in PDF only on Docsity!

GEEN 1300 Introduction to Engineering Computing Summer 2005

Section Test #4 โ€“ Practice Test

  1. Solve the following set of nonlinear equations using Matlab.

1 2 3

1 2 3

1 2 3

sin x cos x ln x 0

cos x 2 ln x sin x 3

3 ln x sin x cos x 2

using initial guesses

1

2

3

x 1.

x 3.

x 1.

Write a Matlab script file called SolveNonlinSet.m that does this. Write in your solution here too:

x 1 = ____________

x 2 = ____________

x 3 = ____________

  1. Develop a Matlab script file, called PlotYZW.m , that creates a single plot of the

following 3 functions over the range 0 โ‰ค^ x^ โ‰ค^5. Format the plot with different line

styles so the 3 curves can be distinguished on a black-and-white print-out of the plot. Do not use markers. Add a grid, a title with your name in it, and axes labels x and Y,Z and W. Add a legend to the plot also which shows the equations in Matlab syntax (see help legend ).

x

y cos x

z

cosh x

w 1 eโˆ’

3. Write a Matlab function, called Ellipsoid , that has three arguments, a , b , and c ,

the three semi-axes of an ellipsoid, and computes the volume of the ellipsoid. Test the function with the following values:

a = 6000 b = 5500 c = 6500

The formula for the volume of an ellipsoid is

a b c

What is the result? __________________

  1. Solve the following system of linear equations using Matlab.

1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4

3x 5x 47 x 20x 18

11x 16 x 17 x 10x 26

56 x 22x 11x 18x 34

17 x 66 x 12x 7 x 82

Write a Matlab script file, called SolveLinEqs.m , that does this. Write in your answers below.

x 1 = ____________

x 2 = ____________

x 3 = ____________

x 4 = ____________

  1. Write a Matlab script file, called FindMax.m , that finds a maximum of

x^2 sin x + ln x

in the range 1.5 โ‰ค x โ‰ค 3

At what value of x is the minimum located? ____________

What is the value of the formula at the minimum? _____________

  1. Write a Matlab script, called FitData.m , that fits a 3 rd-order polynomial to the following thermocouple data, where the independent variable (x) is e.m.f. and the dependent variable (y), is temp. The script should also generate a plot of the data (markers only) with the model curve presented as a smooth line.

e.m.f. mV

temp ยบC -1.482 - -1.239 - -0.995 - -0.749 - -0.501 - -0.251 - 0 0 0.253 5 0.507 10 0.762 15 1.019 20 1.277 25 1.537 30

Write out the equation for your model on the line below:

__________________________________________________________________