Below is a MatLab program that finds all values needed for this problem and

# Below is a matlab program that finds all values

• 10

This preview shows page 5 - 8 out of 10 pages.

Below is a MatLab program that finds all values needed for this problem and creates all the graphs. 1 % von Bertalanffy problem 2 3 c l e a r ; c l c ; 4 5 td = [1 2 3 4 5 6 7 8 9 1 0 ] ; % Age data 6 ld = [ 0 . 7 7 1.3 1.59 1.72 1.8 1.83 1.85 1.86 1.87 1 . 8 7 ] ; % Length data 7 [ p1 , J ] = fminsearch (@sum vonB , [ 1 . 8 8 , 0 . 5 ] , [ ] , td , ld ) % Compute l e a s t SSE

Subscribe to view the full document.

8 tt = l i n s p a c e (0 ,15 ,200) ; 9 l l = p1 (1) * (1 - exp ( - p1 (2) * tt ) ) ; % Fish model 10 plot ( td , ld , ’ bo ’ ) ; % Plot data 11 hold on 12 plot ( tt , l l , ’ r - ) ; grid ; % Plot model 13 t i t l e ( ’ von Bertalanffy Model of Marlin ’ , ’ FontSize ’ ,16 , ’FontName ’ , Times New Roman ’ ) ; 14 xlabel ( ’ \$t\$ ( yrs ) ’ , ’ FontSize ’ ,16 , ’ i n t e r p r e t e r ’ , ’ latex ’ ) ; 15 ylabel ( ’ Length (m) ’ , ’ FontSize ’ ,16 , ’ i n t e r p r e t e r ’ , ’ latex ’ ) ; 16 hold o f f 17 18 print - depsc marl in len gr . eps 19 20 f i g u r e (102) 21 22 Ld = [1 1.11 1.16 1.21 1.28 1.38 1.47 1.53 1.68 1 . 7 7 ] ; 23 Wd = [7 12 15 19 21 31 32 34 52 6 5 ] ; 24 lnLd = log (Ld) ; 25 lnWd = log (Wd) ; 26 coef = p o l y f i t ( lnLd , lnWd , 1 ) %Linear f i t to log of data 27 a = coef (1) ; 28 k = exp ( coef (2) ) ; 29 Ll = l i n s p a c e (0 ,2 ,200) ; 30 Ww = k * Ll .ˆ a ; % Allometric model 31 plot (Ld ,Wd, ’ ro ’ ) ; % Plot data 32 hold on 33 plot ( Ll ,Ww, ’m - ) ; grid ; % Plot model 34 xlim ( [ 0 , 2 ] ) ; 35 ylim ( [ 0 , 1 0 0 ] ) ; 36 t i t l e ( ’ Allometric Model of Marlin ’ , ’ FontSize ’ ,16 , ’FontName ’ , ’ Times New Roman ’ ) ; 37 xlabel ( ’ Length (m) ’ , ’ FontSize ’ ,16 , ’ i n t e r p r e t e r ’ , ’ latex ’ ) ; 38 ylabel ( ’ Weight ( kg ) ’ , ’ FontSize ’ ,16 , ’ i n t e r p r e t e r ’ , ’ latex ’ ) ; 39 hold o f f 40 41 print - depsc m a r l i n a l l o g r . eps 42 43 f i g u r e (103) 44 45 Wt = 82.7983 * (1 - exp ( - .5764 * tt ) ) . ˆ 3 . 6 1 6 6 ; % Composite function 46 plot ( tt ,Wt, ’b - ) ; % Plot composite function 47 grid ; 48 xlim ( [ 0 , 1 5 ] ) ; 49 ylim ( [ 0 , 1 0 0 ] ) ; 50 t i t l e ( ’ Weight of Marlin ’ , ’ FontSize ’ ,16 , ’FontName ’ , ’ Times New Roman ’ ) ; 51 xlabel ( ’Age ( yr ) ’ , ’ FontSize ’ ,16 , ’ i n t e r p r e t e r ’ , ’ latex ’ ) ; 52 ylabel ( ’ Weight ( kg ) ’ , ’ FontSize ’ ,16 , ’ i n t e r p r e t e r ’ , ’ latex ’ ) ;
53 hold o f f 54 55 print - depsc marlin wt gr . eps 56 57 f i g u r e (104) 58 59 % I n s e r t function f o r d e r i v a t i v e /growth of f i s h 60 Wpt = 172.6020184 * (1 - exp ( - .5764 * tt ) ) . ˆ 2 . 6 1 6 6 . * exp ( - .5764 * tt ) ; 61 plot ( tt ,Wpt, - , ’ color ’ , [ 0 , 0 . 6 , 0 ] ) ; %Plot growth 62 grid ; 63 xlim ( [ 0 , 1 5 ] ) ; 64 ylim ( [ 0 , 2 5 ] ) ; 65 t i t l e ( ’Growth of Marlin ’ , ’ FontSize ’ ,16 , ’FontName ’ , ’ Times New Roman ’ ) ; 66 xlabel ( ’Age ( yr ) ’ , ’ FontSize ’ ,16 , ’ i n t e r p r e t e r ’ , ’ latex ’ ) ; 67 ylabel ( ’Growth Rate ( kg/yr ) ’ , ’ FontSize ’ ,16 , ’ i n t e r p r e t e r ’ , ’ latex ’ ) ; 68 hold o f f 69 70 print - depsc marlin wpt gr . eps The L -intercept is L (0) = 0, and the horizontal asymptote is L . b. The graph of the best fitting model using the von Bertalanffy model for the Striped Marlin with the data set is seen below, fitting the model L ( t ) = 1 . 8898 1 - e - 0 . 5764 t . 0

Subscribe to view the full document.

• Fall '08
• staff

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern