Sie sind auf Seite 1von 12

National University of Singapore Department of Mathematics Semester II, Instructions (i) This assignment is due on 27th March 2009

5:00pm. (ii) This assignment counts towards 5% of your nal grade. (iii) Assignments should be typed and submitted on A4 sized writing paper. (Handwritten assignments with the required printouts are also accepted.) (iv) Include the following declaration together with your name, matriculation number, lecture group and signature on the rst page of your assignment. I certify that the work submitted here represents solely my own efforts. I am aware of the Universitys regulations about, and penalties for, plagiarism. (v) Late assignments or those without the above declaration will not be graded. (vi) Plagiarism is a serious oence. Any student found guilty of plagiarism will be accorded zero marks. (vii) Students should use either MATLAB or scilab (but not both) to answer their assignments. (viii) Submission of assignment Each lecture group has been assigned a grader, students must submit their assignments to the designated grader according to their ocial lecture group: Group A B C D SL Grader Tang Qinglin Shao Dongxu Cheng Yong Zhu Huiling Cheng Yong Email g0800880@nus.edu.sg g0700506@nus.edu.sg g0800886@nus.edu.sg g0700512@nus.edu.sg g0800886@nus.edu.sg Collection at LT LT7A (Wed) Mar 25th 9.45 am LT7A (Fri) Mar 27th 9.45am LT6 (Wed) Mar 25th 1.45pm LT7A (Tue) Mar 24th 3.45pm see below 2008/2009 MA1506 Mathematics II Assignment

To facilitate submission for engineering students, the grader will be present at the above times to collect the assignments after lecture. For SL lecture group, early submissions, and students who missed the above time slot, assignments 1

should be placed in pigeonholes located at the ground oor of S14. The pigeonholes are clearly labelled. (ix) Assignments submitted to the wrong person/grader runs the risk of being misplaced. (x) Students should contact their graders directly for issues concerning grading. Questions: Total Marks: 20.

Q1) (4 Marks) The motion of a damped oscillator system is governed by x + 2bx + x = 0, x(0) = 10, x(0) = 0.

3 (a) Find the equation of motion for each of b = 2, 1 and 5 . Show all necessary workings.

(b) Print or write down the MATLAB or scilab code that will plot all three curves, you obtained from (a), on the same graph over the interval [0, 20]. (c) Run your code to plot the graph. Include your own name as the title of this graph. In the Figure or graphic window, use File Export, to save the graph as a jpeg or gif. Print out this graph and submit it together with your other answers. Q2) (4 Marks) The motion of a forced undamped oscillator system is governed by x + kx = F cos t, x(0) = 0, x(0) = 0.

(a) For k = 9, F = 80 and = 5. Plot the solution x(t) from t = 0 to eight times the period of the natural frequency. Include your own name as the title of this graph and submit your graph. (b) For k = 2500, F = 30 and = 45. Plot the solution x(t) from t = 0 to four times the period of the beat frequency. Include your own name as the title of this graph and submit your graph. Remark: You may use the solution for x(t) from your lecture notes. Do not use the numerical solvers in MATLAB or scilab. 2

Q3) (4 Marks) Let N (t), measured in kilotons be the total mass of a certain species of shrimp in the Pacic Ocean. We use the logistic model to model the change in shrimp population, with B = 0.71 per year and the carrying capacity N = 71 kilotons. Using t = 0 to represent 2009, the initial mass N (0) = 0.3N . (a) If harvesting of 12 kilotons per year is allowed. Plot the direction eld of dN = sN 2 + BN E. dt (Hint: You can try to use 0 t, N 80. Adjust the interval values of t and N until the equilibriums can be seen clearly from your direction eld.) (b) Identify the equilibriums (if any) and their stability and plot the equilibrium lines into your direction eld graph. For this question, you should submit i) your answer about the equilibriums, ii) a graph of the direction eld together with the equilibrium lines in dierent colours, iii) the code you used. If you are submitting black and white printouts, you may manually draw the equilibrium lines and you will be graded based on the code you submitted. Q4) (2 Marks) Solve the following IVP with a numerical solver. dx = dt t + x2 , x x(1) = 2.

Find the value of x(2). Submit your code together with your answer, graphs are not required for this question.

Q5) (4 Marks) The motion of a physical system is governed by the initial-value problem t2 x + tx + 25x = 0, x(0.01) = 1, x(0.01) = 50.

(a) Use the numerical ode solvers of MATLAB or scilab to approximate the solution of x(t) for t ranging from 0.01 to 1. (Scilab users should specify t in intervals of 0.01.) (b) What is the value of x(1)? (c) Plot the graph of x(t) and submit this graph and the code that you used for all the parts of this question. (Hint: We only want the curve of x(t) and not x(t).) Q6) (2 Marks) A study has determined that the occupation of a young hobbit, as an adult, depends upon the profession of his father and is given by the following stochastic matrix ordered by the professions: 1) chef, 2) gardener, 3) adventurer, 4) farmer and 5) blacksmith. 0.71 0.2 0.5 0.31 0.14 0.12 0.2 0.1 0.15 0.05 M = 0.05 0.2 0.07 0 0.41 . 0.12 0.2 0.23 0.22 0.25 0 0.2 0.1 0.32 0.15 So the probability of the son of a chef also becoming a chef is 0.71 and a gardeners son has 0.20 probability of taking on any of the ve professions. (a) Write down the matrix M 5 , giving your answer accurate up to at least 4 decimal places. (b) What is the probability that the fth generation descendent of a gardener becomes a farmer? (Your answer should be accurate up to 4 decimal places.)

Suggested Answers: Question 1a) Aux Eq: 2 + 2b + 1 = 0 = ( + b)2 = b2 1. Hence = b b2 1.


For b = 2, we have x(t) = c1 e(2+

3)t

+ c2 e(2

3)t

x(0) = 10 = 10 = c1 + c2 . x(0) = 0 = 0 = c1 (2 + 3) + c2 (2 3). Hence,


10 10 x(t) = (5 + )e(2+ 3)t + (5 )e(2 3)t . 3 3

For b = 1, we have x(t) = (c1 t + c2 )et . x(0) = 10 = 10 = c2 . x(0) = 0 = 0 = c1 c2 = c1 = 10. Hence, x(t) = 10(t + 1)et .
3 For b = 5 , we have x(t) = e 5 (c1 cos 4 t + c2 sin 4 t). 5 5 x(0) = 10 = 10 = c1 . x(0) = 0 = 0 = 3c1 + 4c2 = c2 = 15 . Hence, 5 5 2
3t 4 15 4 sin t). x(t) = e 5 (10 cos t + 5 2 5 3t

Question 1b) Sample Code: For both MATLAB and scilab t=0:0.1:20; x1 = (5+10/sqrt(3))*exp((-2+sqrt(3))*t) + (5-10/sqrt(3))*exp((-2-sqrt(3))*t); x2 = 10*(t+1).*exp(-t); x3 = exp(-3*t/5).*(10*cos((4/5)*t) +15/2*sin((4/5)*t)); plot(t,x1,b-); hold on %this line is not required in scilab plot(t,x2,r--); plot(t,x3,k-.); >> title(BenjaminButton); Question 1c)

Question 2a) 8 times period should be 16/3 16.8 w =sqrt(9); F=80; a=5; p = 8*(2*pi)/w; t = 0:0.05:p; x = 2*F/(a^2-w^2) *sin((a-w)*t/2).*sin((a+w)*t/2); plot(t,x) title(HeathLedger)

Question 2b) 4 times period should be (4 2)/( 1 | |) 10 2 w =50; F=30; a=45; p = 8*(2*pi)/abs(a-w); t = 0:0.01:p; x = 2*F/(a^2-w^2) *sin((a-w)*t/2).*sin((a+w)*t/2); plot(t,x) title(HeathLedger)

Question 3) Unstable equilibrium at e2 27.74 and stable equilibirum at e1 43.26. Sample Code: MATLAB [T, N] = meshgrid(0:2:80,0:2:80); B=0.71; s=B/(71); S = -s*N.^2 +B*N -12; L = sqrt(1+S.^2); quiver(T, N, 1./L, S./L , 0.5) xlabel(t) ylabel(N) title(Direction Field of dN/dt = -sN^2+BN-E) f = inline(-0.01*N^2 +0.71*N-12,N) e1=fzero(f,0) e2=fzero(f,71) hold on t=0:0.1:80; plot(t,e1,r) plot(t,e2,g) hold off

Question 3) Sample Code: scilab x= 0: 2:80; B=0.71; s=B/(71); deff([Ndot]=f(a,N), Ndot=[ 1; -s*N(2)^2+B*N(2)-12 ] ) fchamp(f,0,x,0:2:80,2) function ftmp = f(N) ftmp = -0.01*N^2 + 0.71*N -12 endfunction e1=fsolve(0,f) e2=fsolve(71,f) plot(x,e1,r) plot(x,e2,g)

10

Question 4) Ans: 5.568897 Sample Code: MATLAB >> f=inline(sqrt(t/x +x^2),t,x); >> [t, fa]=ode45(f,[1 2], 2); >> fa(end) Sample Code: scilab function xdot = myfunction(t,x) xdot = sqrt(t/x +x^2) //change the function endfunction sol=ode(2, 1, 2, myfunction);

Question 6)

M^5= 0.5012506 0.1263204 0.0984408 0.1703927 0.1035954 Answer = 0.1745.

0.4874827 0.1250699 0.1032534 0.1744712 0.1097227

0.4949960 0.1257537 0.1006091 0.1722383 0.1064029

0.4880156 0.1251114 0.1031477 0.1742791 0.1094462

0.4892584 0.1252149 0.1025599 0.1739914 0.1089754

11

Question 5) Answer: x(1) 0.42. Sample Code: MATLAB function xdot = myfunction(t,x) xdot = zeros (2,1); xdot(1) = x(2); xdot(2) = -x(2)/t -25*x(1)/(t^2); >> [ta, xa] =ode45(myfunction, [0.01 1], [-1 50]); >> plot(ta,xa(:,1)) >> xa(end,1) Sample Code: scilab function xdot = myfunction(t,x) xdot = [x(2) ; -x(2)/t - 25*x(1)/(t^2)] endfunction t=0.01:0.01:1; x0 = [-1; 50]; sol=ode(x0, 0.01, t, myfunction); plot(t,sol(1,:) sol(1,$)

the graph on the left is what we want, the graph on the right contains x (t), as a result the oscillations in x(t) are not clearly visible.

12

Das könnte Ihnen auch gefallen