Answered step by step
Verified Expert Solution
Question
1 Approved Answer
write line that contains error AND write corrected line below it. Do not rewrite entire code (3) The following data represents the coordinates (xJ, ,
write line that contains error AND
write
corrected line
below it. Do not rewrite entire code
(3) The following data represents the coordinates (xJ, , in meters, and corresponding electrostatic charges , in Coulombs, of the constituent atoms of water (each row contains atom xJ, g data). Each row, therefore, represents this information for the atoms O, H, H, respectively 7.5695E-11 5.8588-11 0.00002+00 6.68E-19 .56952-11 5.8588E-11 0.0000+00 6.68E-19 The following MATI ABTM function (called dipak monm) was written to determine the dipole moment (magnitude) for any molecule (with N atoms) using the following equation i-1 where the magnitude of the dipole moment is the magnitude of the rector . Here, is the dipole moment (rector), gi-atom charge and -(z,y, z.) is the rector for the position of each atom. However, there are FIVE (5) mistakes in the code. Find and correct these mistakes. Calculate , the magnitude of the dipole moment for water function [dipm] dipole mom(XYZ, q) % This function receives the following data from the calling program % XYZ : a 3 x N array, where each row contains 9% x-coordinate (in meters) 96 y-ooordinate (in meters) 96 z-coordinate (in meters) 9% where 'N' is the number of atoms % q : vector of atom charges in molecule (in Coulombs) Conversion factor to convert answer to units of Debyes de 3.34e-30 x XYZ(1) y XYZ( 2) muz-sum(z.q) mux2 mux mux: muy2-muy"muy; muz2 muz*mux dipm sqrt(mux2 muy2+muz2)/do endStep 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