Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help with this. It is a Matlab Problem. Problem 1.1 In numerical methods, there are often many ways to make a calculation that gives
Please help with this. It is a Matlab Problem.
Problem 1.1 In numerical methods, there are often many ways to make a calculation that gives the same answer but at very different efficiencies (i.e., one method is faster than another). In this problem we will consider one such calculation. In molecular dynamics we often need to compute the so-called Lenard-Jones Potential: a mathematically simply model approximating the interactions strength between two neutral (uncharged) particles. If the Euclidean distance between the two particles is r then LJ = r-+ ,T Let us assume that two particles are located one at (1, 0, 3) and another at (2,-1, -1) and that two methods are available for the calculation of LJ, namely Method 1 (1) Calculate r--Jax2 + + 2 (2) Calculate LJ = Methods.2 (1) Calculate r2-Ax2 + Ay2 + Az2 (2) Calculate -2 (4) Calculate r12 (5) Calculate LJ =-+r12 You would like to figure out which of the two methods is faster. >>> PAUSE HERE AND TRY TO GUESS WITHOUT DOING ANY CALCULATIONS elapsedTime 0.0176 which gives you the time it took do perform the loop in seconds. Finally, produce a log-log plot showing the time that is required to perform the calculations for the two methods versus the number of calculations. Use the Publish command to generate a report, save it as a pdf file and submit the pdf file Problem 1.2 Consider the sum S1n Write a Matlab function file that computes the sum and makes a semi-x plot of the values of this sum as a function of k for k-1,2,., 1000. Your numerical answer should suggest what the value of this sum approaches as k -> oo Use the Publish command to generate a report, save it as a pdf file and submit the pdf fileStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started