Sunteți pe pagina 1din 2

MATLAB Programming for Numerical Computations

JanMarch 2016

Assignment for Module5


Due on: Sunday, Feb 21st
INSTRUCTIONS

Submit your work on the course website ( https://onlinecourses.nptel.ac.in/noc16_ch01/ )

Please submit your results before the deadline.

You are required to use the template file, rocketFun.m, for Problem 4.

You do not need to upload your MATLAB files.

1. NEWTON-RAPHSON

(2 points)

Write a MATLAB code for solving nonlinear equation = 0 using Newton-Raphson


method. The function and derivative are given below:
= 40 &.( 875 + 35000
/ = 60 1.( 875
Start with an initial guess of

and perform four iterations of Newton-Raphson method. Also

calculate the relative approximation error:

(Important: The new iteration value,


5

=
3

34&

is in the denominator above.)

obtained after 4th iteration, starting with

1.

Report the value of

2.

Report the relative error

= 20.

obtained after 4th iteration, starting with

2. MULTI-VARIABLE fsolve

= 5.

(2 point)

Use MATLAB command fsolve to solve the following nonlinear equations:

=0
+

0.75 + 1.4 60
=0
+
12 100

Typical values of parameters are = 3.6 and = 60. Use fsolve to find the values of
; using initial guess of
34.

= 5 and

= 9.

Please report the values of and .

[Application Note: Model of the type above is for sewage treatment, taken from book by Nazaroff and Alvarez]

MATLAB Programming for Numerical Computations

JanMarch 2016

3. FIXED POINT ITERATION

(2 points)

In our high school, we have learnt the ideal gas law. However, for LPG gas in our cooking
gas cylinders, this law is not applicable. In this problem, we have rearranged the PengRobinson equation of state in the form required for fixed point iteration:
=


+
D

D + 2

In the above equations, = 0.364 and = 3104( are constants for LPG; and = 8.314 is
also constant. Use fixed point iteration (method of successive substitution) to find the value of
at room temperature = 300 for two different values of pressure: = 10F and = 56
Pascals. Also compute the absolute approximation error,

34&

Use ideal gas law ( = /) as initial guess in both cases.


&1

5.

Report the value of

6.

Report the value of such that the error falls below 104F for T=300 and P=5e6.

after 10 iterations, for T=300 and P=1e7

4. VELOCITY OF A ROCKET

(2 points)

A template file rocketFun.m is uploaded. Use this file for this problem. Please
start editing only after line 15 in this file.
The upward velocity of a rocket can be computed by the following formula:

= ln


where, = 1800 m/s is velocity at which fuel is expelled, = 160,000 kg is the initial
amount of fuel carried by the rocket, = 2600 kg/s is fuel consumption rate and =
9.81 m/s D is the gravitational acceleration.
Compute the time at which the rocket reaches velocity of 750 m/s using fzero.
Since lies between 10 and 50, you will use the command:
tValue=fzero(@(t) rocketFun(t), 10,50);
Also upload function value obtained at = 10 after running the command:
fval=rocketFun(10);
7.

Please report the time at which rocket reaches velocity of 750 m/s using fzero.

8.

Please report the function value at = 10 by running rocketFun(10).

S-ar putea să vă placă și