TGC Codebase Backup



aerodynamics by Anonymous Coder

16th Aug 2004 9:16
Summary

it uses the main equation of aerodynamics. it's solved for any of those parameters.



Description

i'm unable to add a 3d simulation envirnment
i'm about to add some more features into this program
please feel free to do anything you want with the source code
there is an executable in a zip attachment file
please post any tool you've made for/DarkBasic Professional
Game Creators wrote once

"It if possible to provide extra commands in DLL form using the plug-in
system. There are many already available - most for free, and some for
a small fee."

1.Is there anyone willing to help me of how to develop such tools?
2.Is there anyone willing to join the competition as a group?

May i please be forgiven for any grammatical mistakes.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    global AirFlowResistance#
global ObjectShapeFactorResistance#
global PerpendicularObjectSurface#
global AirDensity#
global AirOrAndObjectSpeed#
`global maxx
`global maxy
`global halfx
`global halfy
`maxy=screen height()
`maxx=screen width()
`halfx=maxx/2
`halfy=maxy/2
AirFlowResistance#=0.0
ObjectShapeFactorResistance#=0.0
PerpendicularObjectSurface#=0.0
VerticalObjectSurface#=0.0
AirDensity#=-1.0
AirOrAndObjectSpeed#=0.0

do
cls
print "Please select the result you want to obtain."
print "1.Air Flow/Force Resistance."
print "2.Object Shape Factor Resistance."
print "3.Vertical Object Area."
print "4.Air Density."
print "5.Air Speed Object."
print "6.Quit."
print ""
print ""
print "May i please be forgiven, for grammatical mistakes,as well as miscalculations."
print ""
input "Give me the selection.",option$
if (option$="1") then:case_air_force_resistance()
if (option$="2") then:object_shape_factor_resistance()
if (option$="3") then:vertical_flow_object_area()
if (option$="4") then:air_density()
if (option$="5") then:airobject_speed()
if (option$="6") then:exit
loop
end


function case_air_force_resistance()
cls
print "This is the case that estimates the air force, in the Newton metric system, applied on the object by the air."
simple_aerodynamic_explaination()
print "AirFlowResistance# =( ObjectShapeFactorResistance# * PerpendicularObjectSurface# * AirDensity# * AirOrAndObjectSpeed# ) /2"
print ""
input_data()
AirFlowResistance# =( ObjectShapeFactorResistance# * PerpendicularObjectSurface# * AirDensity# * AirOrAndObjectSpeed# ) /2
print ""
print_data()
print ""
print "Press any key to resume to menu."
wait key
endfunction

function object_shape_factor_resistance()
cls
print "This is the case of the object shape factor resistance."
simple_aerodynamic_explaination()
print "ObjectShapeFactorResistance# = 2*AirFlowResistance# / ( AirOrAndObjectSpeed#^2 * VerticalObjectSurface# * AirDensity# )"
print ""
input_data()
ObjectShapeFactorResistance#=2*AirFlowResistance# /(AirOrAndObjectSpeed#^2 *PerpendicularObjectSurface# * AirDensity# )
print ""
print_data()
print ""
print "Press any key to resume to menu."
wait key
endfunction

function vertical_flow_object_area()
cls
print "This is the case of the vertical flow object area."
simple_aerodynamic_explaination()
print "VerticalObjectSurface# = 2 * AirFlowResistance# / ( AirOrAndObjectSpeed#^2 * AirDensity# * ObjectShapeFactorResistance# )"
print ""
input_data()
VerticalObjectSurface# = 2 * AirFlowResistance# / ( AirOrAndObjectSpeed#^2 * AirDensity# * ObjectShapeFactorResistance# )
print ""
print_data()
print ""
print "Press any key to resume to menu."
wait key
endfunction

function air_density()
cls
print "This is the case of the air density."
simple_aerodynamic_explaination()
print "AirDensity# =( 2 * AirFlowResistance# ) / ( VerticalObjectSurface# * ObjectShapeFactorResistance# * AirOrAndObjectSpeed#^2)"
print ""
input_data()
AirDensity# =( 2 * AirFlowResistance# ) / ( PerpendicularObjectSurface# * ObjectShapeFactorResistance# * AirOrAndObjectSpeed#^2)
print ""
print_data()
print ""
print "Press any key to resume to menu."
wait key
endfunction

function airobject_speed()
cls
print "This is the case of the air or object speed."
simple_aerodynamic_explaination()
print "AirOrAndObjectSpeed# = sqrt( (2*AirFlowResistance#)/(ObjectShapeFactorResistance# * VerticalObjectSurface# * AirDensity#))"
print ""
input_data()
AirOrAndObjectSpeed# = sqrt( (2*AirFlowResistance#)/(ObjectShapeFactorResistance# * PerpendicularObjectSurface# * AirDensity#))
print ""
print_data()
print ""
print "Press any key to resume to menu."
wait key
endfunction

function print_xy_message(x,y,message$)
set cursor x,y
print message$
endfunction

function input_data()
input "Air Flow Resistance: ",AirFlowResistance#
input "Object Shape Factor Resistance: ",ObjectShapeFactorResistance#
input "Perpendicular Object Surface: ",PerpendicularObjectSurface#
input "Air Density: ",AirDensity#
input "Air Or And Object Speed: ",AirOrAndObjectSpeed#
endfunction

function print_data()
print "Air Flow Resistance: ",AirFlowResistance#
print "Object Shape Factor Resistance: ",ObjectShapeFactorResistance#
print "Perpendicular Object Surface: ",PerpendicularObjectSurface#
print "Air Density: ",AirDensity#
print "Air Or And Object Speed: ",AirOrAndObjectSpeed#
endfunction

function simple_aerodynamic_explaination()
print ""
print "Higher/lower density of air, higher/lower force."
print "Higher/lower speed, greately higher/lower force."
print "Higher/lower air flow resistance, higher/lower force."
print "Higher/lower vertical object surface,higher/lower force."
print ""
print "The Object Factor Resistance depends on how aerodynamic the object is."
print "Meaning, imagine the flow of air as if it was water, some water mass will just being draged into space if it's not exposed/"
print "get clearence in a way it will obtained gain from it."
print "So a shapes must have some constants. And here they are."
print "Wing like shape=0.5"
print "Less aerodynamic wing like shape=1"
print "Sport car=0.35 but that can't be true,or can it?"
print "Sphere=8.0"
print "Flat plane=20.0"
print "Half circle/sphere mass/volume confined plane=24"
print "By the way, try to find some on your own."
print "All you need is a fan, and force/mass meter and the construction."
print "Gain for a sport car is downforce, and for a plane upforce."
print "You can estimate those using function as sin, cos tan and more so ever."
print "Because of the intersection air flow is more or less half of the object,specially when object is symmetrically identical and"
print "direction of air the same, that's half of everything/or just of the object area"
print ""
endfunction