01: /*
02: * JScience - Java(TM) Tools and Libraries for the Advancement of Sciences.
03: * Copyright (C) 2006 - JScience (http://jscience.org/)
04: * All rights reserved.
05: *
06: * Permission to use, copy, modify, and distribute this software is
07: * freely granted, provided that this notice is preserved.
08: */
09: package org.jscience.physics.model;
10:
11: import javax.measure.converter.RationalConverter;
12: import javax.measure.converter.UnitConverter;
13: import javax.measure.unit.BaseUnit;
14: import javax.measure.unit.Dimension;
15: import javax.measure.unit.SI;
16:
17: /**
18: * This class represents the natural model.
19: *
20: * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
21: * @version 3.0, February 13, 2006
22: * @see <a href="http://en.wikipedia.org/wiki/Planck_units">
23: * Wikipedia: Planck units</a>
24: */
25: public class NaturalModel extends PhysicalModel {
26:
27: /**
28: * Holds the single instance of this class.
29: */
30: final static NaturalModel INSTANCE = new NaturalModel();
31:
32: /**
33: * Holds the meter to time transform.
34: */
35: private static RationalConverter METRE_TO_TIME = new RationalConverter(
36: 1, 299792458);
37:
38: /**
39: * Selects the relativistic model as the current model.
40: */
41: public static void select() {
42: throw new UnsupportedOperationException("Not implemented");
43: }
44:
45: // Implements Dimension.Model
46: public Dimension getDimension(BaseUnit<?> unit) {
47: if (unit.equals(SI.METRE))
48: return Dimension.TIME;
49: return Dimension.Model.STANDARD.getDimension(unit);
50: }
51:
52: // Implements Dimension.Model
53: public UnitConverter getTransform(BaseUnit<?> unit) {
54: if (unit.equals(SI.METRE))
55: return METRE_TO_TIME;
56: return Dimension.Model.STANDARD.getTransform(unit);
57: }
58: // // H_BAR (SECOND * JOULE = SECOND * (KILOGRAM / C^2 )) = 1
59: // // SPEED_OF_LIGHT (METRE / SECOND) = 1
60: // // BOLTZMANN (JOULE / KELVIN = (KILOGRAM / C^2 ) / KELVIN) = 1
61: // // MAGNETIC CONSTANT (NEWTON / AMPERE^2) = 1
62: // // GRAVITATIONAL CONSTANT (METRE^3 / KILOGRAM / SECOND^2) = 1
63: // SI.SECOND.setDimension(NONE, new MultiplyConverter((c * c)
64: // * MathLib.sqrt(c / (hBar * G))));
65: // SI.METRE.setDimension(NONE, new MultiplyConverter(c
66: // * MathLib.sqrt(c / (hBar * G))));
67: // SI.KILOGRAM.setDimension(NONE, new MultiplyConverter(MathLib.sqrt(G
68: // / (hBar * c))));
69: // SI.KELVIN.setDimension(NONE, new MultiplyConverter(k
70: // * MathLib.sqrt(G / (hBar * c)) / (c * c)));
71: // SI.AMPERE.setDimension(NONE, new MultiplyConverter(MathLib.sqrt(ยต0 * G)
72: // / (c * c)));
73: // SI.MOLE.setDimension(AMOUNT_OF_SUBSTANCE, Converter.IDENTITY);
74: // SI.CANDELA.setDimension(LUMINOUS_INTENSITY, Converter.IDENTITY);
75: }
|