midterm1a - Introduction to Computational Physics Phy 265...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Introduction to Computational Physics Phy 265 Midterm 1a (In-Class) February 28, 2011 Write and upload the function .m file described below to the class website. In order to receive full credit, your function must have proper formatting, run, and give the correct output. A dipole consists of two equal and opposite charges separated by a distance d. Assume the two charges of the dipole, q1 and q2, reside on the x-axis and are symmetrically placed about the origin. The potential due to the two charges at a point on the x-axis, xp, is given by the equation kq kq V = 1 + 2 x1 x2 2/C where k = 8.988 x 109 Nm 2 and x1 and x2 are the distances between q1 and q2 and xp Write a MATLAB function that will take as input the magnitude of the charge of the dipole and the separation between the charges, and output a plot of the potential V of the dipole as a function of xp, and a table consisting of xp values in column 1 and V values in column 2 to the command window. Put the positive charge to the left of the origin. Important Points: Be sure your function computes V between -3d and +3d with steps sizes of 0.1d. Make sure you are using an appropriate format for working with large and small numbers. Be sure to label the axes and provide a title. Include comments in your function. Your function will be graded on its successful application to the following problem. The lithium-fluoride molecule, LiF, can be approximated as an electric-dipole with an excess charge of q1 = +1.6 x 10-19 C localized near the Li nucleus and an excess charge of q2 = 1.6 x 10-19 C localized near the F nucleus. The separation between the nuclei is d = 1.53 x 10-10 m. Plot V(x) for -3d x +3d with a step size of 0.1d and print a table of x and V to the command window. Be sure to put the Li atom to the left of the nucleus. Check your calculations in the table. What value of V should you have at the origin? ...
View Full Document

Ask a homework question - tutors are online