Cat in the Hat - Java to Fast As Light

Just to make it interesting I will play with the process. I often read a book in a lg(n) fashion. It is a type of divide and conquer algorithm that keeps me from being bored. I read the first and last, determine that I am bored with the first and confused by the last. Then I select a topic in the middle and if I am bored, select half of the last and repeat otherwise if I am confused the same is done with the half of the first. It assumes that it is arranged to be sequentially dependent in some rational fashion, which is rarely true.

Since I am lazy, I start with avoiding some typing and do a make or ant XML.


JFLAGS = -g JC = javac .SUFFIXES: .java .class .java.class: $(JC) $(JFLAGS) $*.java CLASSES = $(wildcard *.java) default: classes classes: $(CLASSES:.java=.class) clean: $(RM) *.class

Now I have an easy way to deal with the fact that it takes several tries to get things done when you are impetuous. Now the code. The example is modified from a simple MIT example for beginning java. I use export HTML from the kate editor to produce this.

 

class GravityCalculator { public static void main(String[] arguments) { double gravity = -9.81; // Earth's gravity in m/s^2 double acceleration = 10; // Induced method to be defined double initialVelocity = 0.0; double fallingTime = 0.0; double actionTime = 0.01; double totalTime = 0.0; double initialPosition = 0.0; double finalPosition = 0.0; double newPosition = 0.0; double newVelocity = 0.0; double desiredVelocity = 10.0; double actionSteps = 0.0; newPosition=newPosition+(gravity+acceleration)*actionTime*actionTime*0.5; newVelocity=newVelocity+(gravity+acceleration)*actionTime; totalTime=totalTime+actionTime; actionSteps+=1; while (newVelocity < desiredVelocity){ newPosition=newPosition+(gravity+acceleration)*actionTime*actionTime*0.5; newVelocity=newVelocity+(gravity+acceleration)*actionTime; totalTime=totalTime+actionTime; actionSteps+=1; } System.out.println("The object's position after " + totalTime + " seconds is " + newPosition + " m, Velocity is "+newVelocity +" with "+actionSteps+" steps."); } }

The program output of "java GravityCalculator" is thus:

The object's position after 52.639999999998096 seconds is 0.050008000000004216 m, Velocity is 10.001599999999128 with 5264.0 steps.

The whole thing lead me to an interesting conjecture. Suppose that I could have a device which accelerated the payload which was then accelerated to match velocity by a further mechanism. What I wondered is whether there was a point like the Schwartzchild radius that defined some strange boundary condition which would be entertaining to consider. Since acceleration is in the frame of action, the process would proceed to C in some time. Of course it is not possible in this way as it still requires infinite energy and infinite time. It does have some similarity with possible conditions that might arise in a true singularity. I suppose I will have to let that sink in a bit before it yields any insight. It makes the dull process more able to be tolerated.

In a real situation gravity's effect would vary by altitude and computing this on ever smaller intervals would have a lossy lower limit as well as upper. It makes more sense to have an insertion and extraction point which have known values rather than try to deal with infinities and infinitesimals which tend to bite a person in the ι's , ∞'s and δ's( iotas, infinities and deltas )

0 comments:

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen