I have written some java code for the calculation of some various acceleration and etc. type data. I am now trying to graph that data so I can pull specific data over a time line. The values I have received via my math program are purely accurate with several different means of error checking. I do not need assistance for the java programming. What I need is a accurate graphing techniques so I can get the appropriate data.
The x axis in that is the time variable. The y axis should be distance, but I'm getting totally bogus numbers. I know I may be off on my understanding of how it would graph.
double D = Double.parseDouble(txtDistance.getText()); double T = Double.parseDouble(txtTime.getText()); double IV = Double.parseDouble(txtIVelocity.getText()); double M = Double.parseDouble(txtMass.getText()); double hd = Distance(D); double ht = Time(T); //2.0*(xt/th-v_i)/th //double A = (2 * (hd - ht * IV)) / (ht * ht); double A = 2 * (hd/ht - IV)/ht; double PG = (A / 9.8) * 100; //IV + A * ht //double V = hd / ht; double V = IV + A * ht; double PL = (V / 299792458) * 100; double MPH = V * 2.236936; double F = M * A; double LBT = F * 0.224809; DecimalFormat df = new DecimalFormat("####0.0000"); txtVelocity.setText(String.valueOf(df.format(V))); txtPLight.setText(String.valueOf(df.format(PL))); txtMph.setText(String.valueOf(df.format(MPH))); txtAcceleration.setText(String.valueOf(df.format(A))); txtPGForce.setText(String.valueOf(df.format(PG))); txtThrust.setText(String.valueOf(df.format(F))); txtLBThrust.setText(String.valueOf(df.format(LBT)));
As you can see by that, I am inputting distance, time, initial velocity, and mass. And in return, it calculates and displays final velocity, percent light speed, miles per hour, acceleration, percent G-force, trust in newton's, and lbs of thrust.
Distance: 160934400 Km (just over an AU) Time: 40 hrs Initial velocity: 3070 m/s (geosynchronous earth orbit) Mass: 54431 Kg
The craft starts in earth orbit and accelerates for 50% of the distance and decelerates for 50% of the distance. This is figured with 72000 seconds, and 80467200000 meters.
Final velocity: 1117600.0000 m/s Percent light: 0.3728 % Miles per hour: 2499999.6736 mph (for human understanding of speed for reader) Acceleration: 30.9592 m/s^2 Percent G-force: 315.9099 % Thrust: 315.9099 N Lbs Thrust: 378834.2788 Lbs (again for human understanding)
I know these numbers are as accurate as they can be utilizing the constant acceleration equations posted above. I know these numbers are extreme, but it is a science fiction novel.
The purpose of all this is I am writing a science fiction novel and I have a story line and a time line. I am needing various speeds, based on time and acceleration, etc. I have an additional program that will take this data and graph it so I can click on points to get the appropriate data I need at the given time in the story.
What is the appropriate means of graphing that so I can get accurate numbers that will make sense for my story when you, potential reader read the book?
As an aside for even more accurate numbers, I need to know how to modify my equations to account for gravitational interference in acceleration, etc.
I have spent the last week, upwards to 80 hours working on this so my book can be as accurate as it can be. With that being said, it would be near impossible for me to include all my work on this subject. Any assistance you are willing to offer so I can move forward with this novel would be extremely appreciated.