10.12.2012 Views

Κεφάλαιο 1 - Nemertes

Κεφάλαιο 1 - Nemertes

Κεφάλαιο 1 - Nemertes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ΑΝΑΠΤΥΞΗ ΚΩ∆ΙΚΑ ΜΟΡΙΑΚΗΣ ∆ΥΝΑΜΙΚΗΣ<br />

Η συνάρτηση 66 που παρουσιάστηκε παραπάνω υλοποιείται εδώ:<br />

/**<br />

* Eq. 66<br />

* @param coordinates<br />

* @return<br />

*/<br />

public double getEnergyForPosition(double[] coordinates)<br />

{<br />

double numberOfAbsorbedPhotons;<br />

double rz = r(coordinates[2]);<br />

double x = coordinates[0];<br />

double y = coordinates[1];<br />

//Calculate the Number of photons at this depth using the Beer - Lambert Law<br />

double firstTerm = getLaserEnergy() *<br />

MDParameters.timeStep;//*getΛ()/(Constants.h*Constants.c);<br />

numberOfAbsorbedPhotons = firstTerm;<br />

//commented out - maybe will be added again<br />

// double secondTerm = (rz * rz) / (rf0 * rf0);<br />

// numberOfAbsorbedPhotons *= secondTerm;<br />

double thirdTerm = Math.exp(-β * coordinates[2]);<br />

numberOfAbsorbedPhotons *= thirdTerm;<br />

//apply the bivariate gaussian distribution<br />

double probability;<br />

double d = ac * (x + material.particleRadius) / (2 * radius);<br />

double e = ac * (x - material.particleRadius) / (2 * radius);<br />

probability = Φ(d) - Φ(e);<br />

double e2 = ac * (y + material.particleRadius) / (2 * radius);<br />

double f = ac * (y - material.particleRadius) / (2 * radius);<br />

probability *= Φ(e2) - Φ(f);<br />

numberOfAbsorbedPhotons *= probability;<br />

numberOfAbsorbedPhotons *= material.reflectivity;<br />

if (("" + numberOfAbsorbedPhotons).equals("NaN"))<br />

{<br />

System.out.println("Energy is NaN!!!");<br />

System.out.println("Coordinates: ( " + coordinates[0] + " , " + coordinates[1] + " , "<br />

+ coordinates[2] + " )");<br />

System.out.println("Rz = " + rz);<br />

System.out.println("Probability: " + probability);<br />

System.out.println("d = " + d);<br />

System.out.println("e = " + e);<br />

System.out.println("e2 = " + e2);<br />

System.out.println("f = " + f);<br />

}<br />

//multiply with the energy of one photon hc/λ<br />

//we don't have to multiply with the energy of one photon,<br />

//as we have removed it from the initial calculation of the Beer Lambert Law<br />

return numberOfAbsorbedPhotons;<br />

}<br />

238

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!