Question: I want to tabulate my function. However, when I do, all my y values are zeros since my numbers are really small from the range
I want to tabulate my function. However, when I do, all my y values are zeros since my numbers are really small from the range of 10^-18 to 10^-14. My prof commented how I should use fprintf instead of disp and that fprintf statement having z(j) and y(j) as the variables print. How can I make a table where my table will show y-values with exponential values.
----------------------------------------------
%script to call Bohr_Model_RJP
%prepare for loop
npts=118;
dz = 118/(npts-1);
disp( 'z' )
n=1;
%loop
for j=1 : npts
z(j) = dz*(j-1);
y(j) = zeff(z(j),n);
disp ([ z(j), y(j) ])
end
function E = zeff(z,n)
%n-value represents an electron circular-orbit around a nucleus; the higher the n-value, the farther the orbit%;
%z-value represents the atomic number of an element, randomly generated from 0 to 118 because there are 118 elements on the periodic table;
R= 2.178*10^-18;
%R-value represents the Rydberg constant which is measured in Joules
E=-(R*z^2/n^2);
% Formula calculating the energy a nucleus exerts on an electron
%value is negative because the nucleus pulls the electron towards it.
end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
