Question: 3. You will recall from lecture notes that the equation for arc length is dr dt. Of course, computers cannot handle infinitesimals so one

3. You will recall from lecture notes that the equation for arc

3. You will recall from lecture notes that the equation for arc length is dr dt. Of course, computers cannot handle infinitesimals so one method to caleulating the are length is to break the arc/curve into small chunks of interval t which take the place of dt. The integral then becomes the sum over each of these small intervals. That is, Nist 1=Er(ti+1) - r(t,)|. i=1 where t = t;41 - ti, t = a, tN = b and Nint is the number of desired straight line intervals that are desired to approximate the arc/curve. Using this computational method, a code that may be used to approximate the arc length of curve C given in Question 3(a) is the following SInitialiae the discretination of the curve a - 0: Stree paranetor atart b = 1 free paranster end Nint = 100, inunber of intervals along curvo Npoints - Nint + 1i inunber of points along curve tvals - linspace (a,b, Npoints); tvalues of the free paraneter along the curve points p - zeros (Npoints, 3): Bsince this curve in in 3D we need 3 coords (x y and z) for each point in p. 2- toet a funetion to eanily caleulate the point coordinatea 10- t_to coord 8 (t) [t, t2, t-31 11 12 Sdeternina all the pointe in the curve from tmin to tmax 13- for i = l1Npointa 14- Pli, 1) -t_to_coord (tvals (i)) 15- end 16 17 plot to inspect the curve looka right 18 plot3 (p(:,1).p(:,2),p(:,3)) 19 20 Sinitialise the interval distances 21 - intervaldists zeron (Nint, 1) 22 23 calculate all the interval distancen 24 - Bfor i - 1:Nint intervaldista (1) - FINISH THIS LINE 25- 26- end 27 curvelength = sun (intervaldists) 28- (a) Finish the missing line 25. (b) Change this code to evaluate the 2D arc length of a curve known as an inverted cycloid between the points (0,0) and (T,2). The curve is given parametrically as r(t) = t - sin(t). y(t) = 1- cos(t) Note: You do not need to upload your full code, just write out the all of the changed lines of codes and the lines from the previous code they refer to. An answer which is stated without indicating the code changes will be marked as incorrect. Note added: Previously, the given parametrisation was wrong r(t) = 2(t sin(t)), y(t) = 2(1 - cos(t)). We have corrected this. We noticed that parametrization wasn't good because the end point was not on the eurve %3D [5 marks]

Step by Step Solution

3.43 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

SCREENSHOTS OUTPUT MATLAB CODE a0 b1 Nint100 NpointsNint1 tvals linspaceabNpoint... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!