0

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.

http://physicsforidiots.com/wp/wp-content/ql-cache/quicklatex.com-f80733c4cb4c6cb9bdef0e44fe176cab_l3.svg

acceleration formula

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);

double V = hd / ht;
double PL = (V / 299792458) * 100;
double MPH = V * 2.236936;

double A = (2 * (hd - ht * IV)) / (ht * ht);
double PG = (A / 9.8) * 100;

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.

Sample data:

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.

Sample response:

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.

texasman1979
  • 123
  • 5
  • What relationships in particular are you looking to understand better? – John Jun 12 '15 at 18:41
  • Most importantly is the relationship between time and velocity. what i was hoping to do was plot the acceleration over time to give me the distance at various times. this may be contradictory, but a full explanation and examples would be a good thing. – texasman1979 Jun 12 '15 at 18:55
  • This question was answered here:

    http://physics.stackexchange.com/questions/189158/how-do-i-graph-acceleration/189182#189182

    – texasman1979 Jun 13 '15 at 01:40

1 Answers1

0

The equations you have in your code assume constant acceleration.

So, the plot of acceleration $a$ vs. time $t$ will be a horizontal line at $a$.

The plot of velocity $v$ vs. $t$ will be a straight line with slope $a$ and y-intercept of the initial velocity $v_0.$

The plot of displacement $d$ vs. $t$ will be a parabola:

$$d(t) = d_0 + v_0t + \frac{at^2}{2},$$

where $d_0$ is the initial displacement. You used $a = -g = -9.8 \text{ m}/s^2.$

John
  • 26,319
  • can you elaborate further please? – texasman1979 Jun 12 '15 at 22:05
  • Elaborate how?? – John Jun 12 '15 at 22:20
  • You used a=−g=−9.8 m/s2. i am wanting to graph the bell curve, if you will, of the speed going up till midpoint and then the speed reducing to end point. I realize that only half will be realistic but i should be able to get both halves with an accurate half. initial velocity is 3070 m/s as it is starting from geosynchronous orbit. – texasman1979 Jun 12 '15 at 23:54
  • This question was answered here:

    http://physics.stackexchange.com/questions/189158/how-do-i-graph-acceleration/189182#189182

    – texasman1979 Jun 13 '15 at 01:40