 500 lbf thrustor
 1500 lbm vehicle > 1 lbm "weighs" 1 lbf
 f_friction=29.6 lbf
Back to Basic
Moderator: Mike Everman

 Posts: 3716
 Joined: Tue Dec 07, 2004 6:51 pm
 Antipspambot question: 0
 Location: 41d 1' N 80d 22' W
Re: Back to Basic
The error I found previously was due to a "units" problem.
So, in about 4 minutes time, the vehicle is no longer accelerating and the drag force is 470 lbf, which is 30 lbf "shy" of 500 lbf.
So, in about 4 minutes time, the vehicle is no longer accelerating and the drag force is 470 lbf, which is 30 lbf "shy" of 500 lbf.

 Posts: 3716
 Joined: Tue Dec 07, 2004 6:51 pm
 Antipspambot question: 0
 Location: 41d 1' N 80d 22' W
Re: Back to Basic
From this, at time = 4 min the distance traveled has been 28 miles and the speed has reached its plateau of 570 mi/hr.
This simulation has been done using the Euler method which is not the most accurate unless you use a really small time step. I need to compare these answers with those predicted by another method, perhaps fourthorder RungeKutta.
This simulation has been done using the Euler method which is not the most accurate unless you use a really small time step. I need to compare these answers with those predicted by another method, perhaps fourthorder RungeKutta.

 Posts: 3716
 Joined: Tue Dec 07, 2004 6:51 pm
 Antipspambot question: 0
 Location: 41d 1' N 80d 22' W
Re: Back to Basic
May do this on a spreadsheet first.

 Posts: 3716
 Joined: Tue Dec 07, 2004 6:51 pm
 Antipspambot question: 0
 Location: 41d 1' N 80d 22' W
Re: Back to Basic
See an error in this piece of code?
Code: Select all
REM ***** BASIC *****
REM computes the 1st derivative as a function of x and u(x)
Function uprime(x,y)
uprime=(xy)/sqrt(1+x^2)
End Function
Re: Back to Basic
Hmmm, the first thing that jumps out is "sqrt", both programs I have use SQR.
Admittedly, a little lost in the maths, not sure what context we are seeing y here(is it coordinate?). Whats up with (xy)? Most equations I see SQR(x^2+y^2) instead of SQR(1+x^2).
Well, there are my two shots in the dark. Can I buy a vowel?
Joe
Admittedly, a little lost in the maths, not sure what context we are seeing y here(is it coordinate?). Whats up with (xy)? Most equations I see SQR(x^2+y^2) instead of SQR(1+x^2).
Well, there are my two shots in the dark. Can I buy a vowel?
Joe

 Posts: 3716
 Joined: Tue Dec 07, 2004 6:51 pm
 Antipspambot question: 0
 Location: 41d 1' N 80d 22' W
Re: Back to Basic
Nice try.
It turns out, sqrt is a legitimate function to use in OpenOffice.org's spreadsheet, but is nonexistent for use in a macro. It took me almost 3 hrs to figure that out. I found the error/solution nowheres on the I'net.
The BASIC they use for macro programming is Sun's StarOffice BASIC. See StarOffice 7 Office Suite  Basic Programmer's Guide, English, in particular pg. 38.
It turns out, sqrt is a legitimate function to use in OpenOffice.org's spreadsheet, but is nonexistent for use in a macro. It took me almost 3 hrs to figure that out. I found the error/solution nowheres on the I'net.
The BASIC they use for macro programming is Sun's StarOffice BASIC. See StarOffice 7 Office Suite  Basic Programmer's Guide, English, in particular pg. 38.
So, in my case, I had to substitute ^(0.5) for sqrt in my MACRO and everything started to run as planned.Mathematical Operators
Mathematical operators can be applied to all numbers types, whereas the +
operator can also be used to link strings.
 + Addition of numbers and date values, linking of strings
  Subtraction of numbers and date values
 * Multiplication of numbers
 / Division of numbers
 \ Division of numbers with a whole number result (rounded)
 ^ Raising the power of numbers
 MOD module operation (calculation of the rest of a division)

 Posts: 3716
 Joined: Tue Dec 07, 2004 6:51 pm
 Antipspambot question: 0
 Location: 41d 1' N 80d 22' W
Re: Back to Basic
This is the problem that the programming of the spreadsheet solves:
An Initial Value Ordinary Differential Equation Consider the following firstorder ordinary differential equation:
(1+x²)^(½) · du(x)/dx + u(x) = x, x>0
u(0) = 0
This is an initial value problem because the boundary condition is known at only one location.
An Initial Value Ordinary Differential Equation Consider the following firstorder ordinary differential equation:
(1+x²)^(½) · du(x)/dx + u(x) = x, x>0
u(0) = 0
This is an initial value problem because the boundary condition is known at only one location.
Re: Back to Basic
Hi Forrest,
I am still tinkering, to get a feel for nonuniform acceleration. Here is my latest set of code, far different from the first. Probably still has errors and not accurate, but at least the mph has arced over, and the acceleration is arcing down to zero. I put a limit of .005 on the acceleration (line 210), so the thing wouldn't keep looping as acceleration tapers off towards zero.
The direction your going looks like a highly accurate path.
I am still tinkering, to get a feel for nonuniform acceleration. Here is my latest set of code, far different from the first. Probably still has errors and not accurate, but at least the mph has arced over, and the acceleration is arcing down to zero. I put a limit of .005 on the acceleration (line 210), so the thing wouldn't keep looping as acceleration tapers off towards zero.
The direction your going looks like a highly accurate path.
Code: Select all
10 CLS
20 INPUT "Drag Coefficient Cd 01 "; Cd
30 INPUT "Frontal Area of vehicle in sq. feet "; Frontarea
40 INPUT "Rolling Resistance pounds "; RR
50 INPUT "Total Weight in pounds "; weight
60 INPUT "Thrust of engine in pounds "; thrust
70 LET slugweight = weight / 32.174
100 LET termvel=SQR((thrustRR)/(1/391 * Cd * Frontarea))
110 PRINT "Terminal Velocity=";termvel
120 LET time=0
130 PRINT "time zero print"
140 PRINT "s:"; time; " mph="; mph; " Drag+RR=";dragforce; " accel=";altaccel;" Force=";sumforces;" miles=";miles
150 PRINT " "
160 LET time = 1
170 LET sumforces=thrustRR
180 REM"LOOP starts below here"
200 LET altaccel= sumforces/slugweight
210 IF altaccel<0.005 then goto 400
220 'note that accumvelocity=altaccel*1 second)+prevvelocity
230 LET accumvelocity=(altaccel*1)+prevvelocity
240 LET mph = accumvelocity * .681818
250 LET accumfeet =(accumvelocity*1)/2+prevfeet
260 LET miles = accumfeet / 5280
270 LET dragforce =(Cd * (1/391*mph^2)*Frontarea)+RR
280 LET prevvelocity=accumvelocity
290 LET prevfeet=accumfeet
300 LET sumforces=thrustdragforce
310 PRINT "s:"; time; " mph="; mph; " Drag+RR=";dragforce; " accel=";altaccel;" Force=";sumforces;" miles=";miles
'(for Qbasic)320 SLEEP (seconds0)
330 LET time = time + 1
340 GOTO 200
400 END
Last edited by PyroJoe on Thu Feb 18, 2010 2:56 pm, edited 1 time in total.

 Posts: 3716
 Joined: Tue Dec 07, 2004 6:51 pm
 Antipspambot question: 0
 Location: 41d 1' N 80d 22' W
Re: Back to Basic
If I can get two different methods to come up with the same numbers ... I'll stop.The direction your going looks like a highly accurate path.
Latest output (900 secs) from my spreadsheet calc for a 100 lbf'er propelling a 1500 lbm vehicle. Simple Euler method used.
Code: Select all
# Euler Method
# disp vel accel
# time x i+1 y i+1 dy/dt i+1
# (sec) (ft) (ft/sec) (ft/sec²)
0.00E+000 0.000E+000 0.000E+000 1.511E+000
5.00E+000 1.889E+001 7.556E+000 1.510E+000
1.00E+001 7.555E+001 1.511E+001 1.508E+000
1.50E+001 1.699E+002 2.265E+001 1.504E+000
2.00E+001 3.020E+002 3.017E+001 1.498E+000
2.50E+001 4.715E+002 3.765E+001 1.490E+000
3.00E+001 6.784E+002 4.511E+001 1.481E+000
3.50E+001 9.225E+002 5.251E+001 1.470E+000
4.00E+001 1.203E+003 5.986E+001 1.458E+000
4.50E+001 1.521E+003 6.715E+001 1.444E+000
5.00E+001 1.875E+003 7.437E+001 1.429E+000
5.50E+001 2.264E+003 8.152E+001 1.412E+000
6.00E+001 2.690E+003 8.858E+001 1.395E+000
6.50E+001 3.150E+003 9.555E+001 1.375E+000
7.00E+001 3.645E+003 1.024E+002 1.355E+000
7.50E+001 4.174E+003 1.092E+002 1.334E+000
8.00E+001 4.737E+003 1.159E+002 1.312E+000
8.50E+001 5.333E+003 1.224E+002 1.288E+000
9.00E+001 5.961E+003 1.289E+002 1.264E+000
9.50E+001 6.621E+003 1.352E+002 1.239E+000
1.00E+002 7.312E+003 1.414E+002 1.214E+000
1.05E+002 8.035E+003 1.475E+002 1.188E+000
1.10E+002 8.787E+003 1.534E+002 1.161E+000
1.15E+002 9.568E+003 1.592E+002 1.134E+000
1.20E+002 1.038E+004 1.649E+002 1.107E+000
1.25E+002 1.122E+004 1.704E+002 1.079E+000
1.30E+002 1.208E+004 1.758E+002 1.052E+000
1.35E+002 1.297E+004 1.811E+002 1.024E+000
1.40E+002 1.389E+004 1.862E+002 9.958E001
1.45E+002 1.484E+004 1.912E+002 9.678E001
1.50E+002 1.580E+004 1.960E+002 9.400E001
1.55E+002 1.680E+004 2.007E+002 9.122E001
1.60E+002 1.781E+004 2.053E+002 8.847E001
1.65E+002 1.885E+004 2.097E+002 8.574E001
1.70E+002 1.991E+004 2.140E+002 8.304E001
1.75E+002 2.099E+004 2.181E+002 8.037E001
1.80E+002 2.209E+004 2.222E+002 7.774E001
1.85E+002 2.321E+004 2.260E+002 7.515E001
1.90E+002 2.435E+004 2.298E+002 7.260E001
1.95E+002 2.551E+004 2.334E+002 7.010E001
2.00E+002 2.668E+004 2.369E+002 6.765E001
2.05E+002 2.788E+004 2.403E+002 6.525E001
2.10E+002 2.909E+004 2.436E+002 6.290E001
2.15E+002 3.031E+004 2.467E+002 6.061E001
2.20E+002 3.155E+004 2.498E+002 5.837E001
2.25E+002 3.281E+004 2.527E+002 5.619E001
2.30E+002 3.408E+004 2.555E+002 5.407E001
2.35E+002 3.536E+004 2.582E+002 5.200E001
2.40E+002 3.666E+004 2.608E+002 5.000E001
2.45E+002 3.797E+004 2.633E+002 4.805E001
2.50E+002 3.929E+004 2.657E+002 4.616E001
2.55E+002 4.063E+004 2.680E+002 4.433E001
2.60E+002 4.197E+004 2.702E+002 4.255E001
2.65E+002 4.333E+004 2.723E+002 4.084E001
2.70E+002 4.470E+004 2.744E+002 3.918E001
2.75E+002 4.607E+004 2.763E+002 3.757E001
2.80E+002 4.746E+004 2.782E+002 3.602E001
2.85E+002 4.885E+004 2.800E+002 3.453E001
2.90E+002 5.026E+004 2.817E+002 3.309E001
2.95E+002 5.167E+004 2.834E+002 3.170E001
3.00E+002 5.309E+004 2.850E+002 3.036E001
3.05E+002 5.452E+004 2.865E+002 2.907E001
3.10E+002 5.596E+004 2.880E+002 2.783E001
3.15E+002 5.740E+004 2.893E+002 2.663E001
3.20E+002 5.885E+004 2.907E+002 2.548E001
3.25E+002 6.031E+004 2.920E+002 2.438E001
3.30E+002 6.177E+004 2.932E+002 2.332E001
3.35E+002 6.324E+004 2.943E+002 2.230E001
3.40E+002 6.471E+004 2.955E+002 2.132E001
3.45E+002 6.619E+004 2.965E+002 2.038E001
3.50E+002 6.768E+004 2.975E+002 1.948E001
3.55E+002 6.917E+004 2.985E+002 1.862E001
3.60E+002 7.066E+004 2.994E+002 1.779E001
3.65E+002 7.216E+004 3.003E+002 1.700E001
3.70E+002 7.367E+004 3.012E+002 1.624E001
3.75E+002 7.517E+004 3.020E+002 1.551E001
3.80E+002 7.669E+004 3.028E+002 1.481E001
3.85E+002 7.820E+004 3.035E+002 1.415E001
3.90E+002 7.972E+004 3.042E+002 1.351E001
3.95E+002 8.124E+004 3.049E+002 1.289E001
4.00E+002 8.277E+004 3.055E+002 1.231E001
4.05E+002 8.430E+004 3.062E+002 1.175E001
4.10E+002 8.583E+004 3.067E+002 1.121E001
4.15E+002 8.737E+004 3.073E+002 1.070E001
4.20E+002 8.890E+004 3.078E+002 1.021E001
4.25E+002 9.045E+004 3.083E+002 9.745E002
4.30E+002 9.199E+004 3.088E+002 9.297E002
4.35E+002 9.353E+004 3.093E+002 8.870E002
4.40E+002 9.508E+004 3.097E+002 8.462E002
4.45E+002 9.663E+004 3.102E+002 8.072E002
4.50E+002 9.818E+004 3.106E+002 7.699E002
4.55E+002 9.974E+004 3.110E+002 7.344E002
4.60E+002 1.013E+005 3.113E+002 7.004E002
4.65E+002 1.028E+005 3.117E+002 6.679E002
4.70E+002 1.044E+005 3.120E+002 6.370E002
4.75E+002 1.060E+005 3.123E+002 6.074E002
4.80E+002 1.075E+005 3.126E+002 5.792E002
4.85E+002 1.091E+005 3.129E+002 5.522E002
4.90E+002 1.107E+005 3.132E+002 5.265E002
4.95E+002 1.122E+005 3.135E+002 5.020E002
5.00E+002 1.138E+005 3.137E+002 4.786E002
5.05E+002 1.154E+005 3.139E+002 4.563E002
5.10E+002 1.169E+005 3.142E+002 4.350E002
5.15E+002 1.185E+005 3.144E+002 4.146E002
5.20E+002 1.201E+005 3.146E+002 3.952E002
5.25E+002 1.217E+005 3.148E+002 3.767E002
5.30E+002 1.232E+005 3.150E+002 3.591E002
5.35E+002 1.248E+005 3.152E+002 3.423E002
5.40E+002 1.264E+005 3.153E+002 3.262E002
5.45E+002 1.280E+005 3.155E+002 3.109E002
5.50E+002 1.295E+005 3.157E+002 2.963E002
5.55E+002 1.311E+005 3.158E+002 2.824E002
5.60E+002 1.327E+005 3.159E+002 2.692E002
5.65E+002 1.343E+005 3.161E+002 2.565E002
5.70E+002 1.359E+005 3.162E+002 2.445E002
5.75E+002 1.374E+005 3.163E+002 2.330E002
5.80E+002 1.390E+005 3.164E+002 2.220E002
5.85E+002 1.406E+005 3.166E+002 2.115E002
5.90E+002 1.422E+005 3.167E+002 2.016E002
5.95E+002 1.438E+005 3.168E+002 1.921E002
6.00E+002 1.453E+005 3.169E+002 1.830E002
6.05E+002 1.469E+005 3.170E+002 1.744E002
6.10E+002 1.485E+005 3.170E+002 1.662E002
6.15E+002 1.501E+005 3.171E+002 1.584E002
6.20E+002 1.517E+005 3.172E+002 1.509E002
6.25E+002 1.533E+005 3.173E+002 1.438E002
6.30E+002 1.549E+005 3.173E+002 1.370E002
6.35E+002 1.564E+005 3.174E+002 1.305E002
6.40E+002 1.580E+005 3.175E+002 1.244E002
6.45E+002 1.596E+005 3.175E+002 1.185E002
6.50E+002 1.612E+005 3.176E+002 1.129E002
6.55E+002 1.628E+005 3.177E+002 1.076E002
6.60E+002 1.644E+005 3.177E+002 1.025E002
6.65E+002 1.660E+005 3.178E+002 9.764E003
6.70E+002 1.676E+005 3.178E+002 9.303E003
6.75E+002 1.692E+005 3.179E+002 8.863E003
6.80E+002 1.707E+005 3.179E+002 8.444E003
6.85E+002 1.723E+005 3.179E+002 8.045E003
6.90E+002 1.739E+005 3.180E+002 7.664E003
6.95E+002 1.755E+005 3.180E+002 7.302E003
7.00E+002 1.771E+005 3.181E+002 6.957E003
7.05E+002 1.787E+005 3.181E+002 6.628E003
7.10E+002 1.803E+005 3.181E+002 6.314E003
7.15E+002 1.819E+005 3.182E+002 6.015E003
7.20E+002 1.835E+005 3.182E+002 5.731E003
7.25E+002 1.851E+005 3.182E+002 5.460E003
7.30E+002 1.866E+005 3.182E+002 5.201E003
7.35E+002 1.882E+005 3.183E+002 4.955E003
7.40E+002 1.898E+005 3.183E+002 4.721E003
7.45E+002 1.914E+005 3.183E+002 4.497E003
7.50E+002 1.930E+005 3.183E+002 4.284E003
7.55E+002 1.946E+005 3.184E+002 4.081E003
7.60E+002 1.962E+005 3.184E+002 3.888E003
7.65E+002 1.978E+005 3.184E+002 3.704E003
7.70E+002 1.994E+005 3.184E+002 3.529E003
7.75E+002 2.010E+005 3.184E+002 3.362E003
7.80E+002 2.026E+005 3.185E+002 3.202E003
7.85E+002 2.042E+005 3.185E+002 3.051E003
7.90E+002 2.058E+005 3.185E+002 2.906E003
7.95E+002 2.073E+005 3.185E+002 2.769E003
8.00E+002 2.089E+005 3.185E+002 2.638E003
8.05E+002 2.105E+005 3.185E+002 2.513E003
8.10E+002 2.121E+005 3.185E+002 2.394E003
8.15E+002 2.137E+005 3.186E+002 2.280E003
8.20E+002 2.153E+005 3.186E+002 2.172E003
8.25E+002 2.169E+005 3.186E+002 2.069E003
8.30E+002 2.185E+005 3.186E+002 1.971E003
8.35E+002 2.201E+005 3.186E+002 1.878E003
8.40E+002 2.217E+005 3.186E+002 1.789E003
8.45E+002 2.233E+005 3.186E+002 1.704E003
8.50E+002 2.249E+005 3.186E+002 1.623E003
8.55E+002 2.265E+005 3.186E+002 1.547E003
8.60E+002 2.281E+005 3.186E+002 1.473E003
8.65E+002 2.296E+005 3.186E+002 1.403E003
8.70E+002 2.312E+005 3.187E+002 1.337E003
8.75E+002 2.328E+005 3.187E+002 1.274E003
8.80E+002 2.344E+005 3.187E+002 1.213E003
8.85E+002 2.360E+005 3.187E+002 1.156E003
8.90E+002 2.376E+005 3.187E+002 1.101E003
8.95E+002 2.392E+005 3.187E+002 1.049E003
9.00E+002 2.408E+005 3.187E+002 9.991E004

 Posts: 3716
 Joined: Tue Dec 07, 2004 6:51 pm
 Antipspambot question: 0
 Location: 41d 1' N 80d 22' W
Re: Back to Basic
Working on the comparison of the results from two approximate methods with those of an analytical test experiment. Details soon.

 Posts: 3716
 Joined: Tue Dec 07, 2004 6:51 pm
 Antipspambot question: 0
 Location: 41d 1' N 80d 22' W
Re: Back to Basic
OK, I've two methods that I am comparing.
 Euler
 FeynmanNewton