Professional Documents
Culture Documents
Aditya Kumar
Mechanical Engineering
23 February 2016
Question 1
(a)
for n=200
the minimum value for x is 1.7539.
The total time for the solution is 3.1838 seconds.
The percentage of time, spent in making the decomposition against the total time is as follows
Question 2
(a)
The geometry turns out to be
Figure 4: Geometry
(b)
lu(a,thresh)..proceed in this direction .
(c)
The sparsity patterns of the matrices are
LU Decomposition
Reverse Cuthill-Mckee
Minimum-Degree Reordering
1.1873
1.7724
0.4129
Question 3
Solution
x = 4.923;
(1)
y = 1.3846;
(2)
z = 0;
(3)
The solution is not unique, because the rank of the matrix is lesser than the number of rows.
Question 4
(a)
(4)
c = 0.3708
The commands used to generate the Matrix A and implementation of c are as follows
1
2
3
4
n=39;
c=o n e s ( 1 , n ) ;
A=g a l l e r y ( t r i d i a g , n ) ( 0 . 5 / ( 0 . 0 5 0 . 0 5 ) ) ( 1) ;
cnew=mtimes ( expm (A. 1 ) , c ) ;
(b)
(c)
Question 5
Solution
The vital parts of the code are as follows.
The main function is as follows
1
2
3
4
5
6
7
8
9
%%BNM1
%%%1: c y l i n d e r
%%%%2: h e m i s p h e r e
clear all ;
close all ;
lb =[2 ,0];
ub=[6 4 0 ] ;
o p t i o n s=o p t i m s e t ( MaxFunEvals , 5 0 0 0 , MaxIter , 1 0 0 0 ) ;
[ x , f v a l , e x i t f l a g , output ]= fmincon ( @objfun , [ 6 , 6 ] , [ ] , [ ] , [ ] , [ ] , lb , ub , @cofun ,
options ) ;
The Sub-Functions listed in the optimization routine are as follows
The objfun and cofun in the optimzation routine are as follows.
objfun
1
2
3
4
5
f u n c t i o n o=o b j f u n ( x )
a1=2 p i x ( 1 ) x ( 2 )+p i x ( 1 ) x ( 1 ) ; %%x ( 1 ) i s r a d i u s x ( 2 ) i s h e i g h t
a2=2 p i x ( 1 ) x ( 1 ) ;
o=300 a1 +400 a2 ;
end
cofun
1
2
3
4
5
f u n c t i o n [ c , ceq ]= c o f u n ( x )
v1=p i x ( 1 ) x ( 1 ) x ( 2 ) ;
v2=2 p i power ( x ( 1 ) , 3 ) / 3 ;
ceq=v1+v2 500;
c =[];
6
7
end
The Motivation for the choices of r0 and h0 are taken from the graph presented in the question.
(b)
For r0 = 5,
r = 4.0858
(5)
h = 6.8097
(6)
(7)
10