This is a wrong forum to ask such questions its not even math realted, try flight gear or jbssim files for that i am pretty sure i saw 737 specifications there
 Home
 » Viewing Profile: Posts: WiredCat
Banner advertising on our site currently available from just $5!
1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!
WiredCat
Member Since 09 Apr 2011Online Last Active Today, 02:25 AM
Community Stats
 Group Members
 Active Posts 300
 Profile Views 5,665
 Submitted Links 0
 Member Title Member
 Age 27 years old
 Birthday August 8, 1987

Gender
Not Telling
Posts I've Made
In Topic: Drag Curve for airliners
23 February 2015  06:30 AM
In Topic: 2D Flight Simulator
22 February 2015  05:40 AM
i believe thats not how this game works, i see there basic lift, drag equations (along with thrust and weight forces) they produce linear acceleration and angular acceleration which you will need to calculate.
maybe this code will give you some light:
double l; timin>stopTimer(); l = timin>getElapsedTime(); double dt = double(l); //get elapsed time in seconds timin>startTimer(); if (dt <=0 ) return; lastDeltaTime = dt; dt = 0.0330; double V = VectorLength(vel); double squareSpeed = V*V; t3dpoint<double> pitch_vec = t3dpoint<double>(YPRangle.AIR_MATRIX[8], YPRangle.AIR_MATRIX[9], YPRangle.AIR_MATRIX[10]); ThrustForce_vec = pitch_vec * Throttle_to_force( Throttle ); //double AngleOfAttack = 0.0;// AngleBetweenVectors(vel,ThrustForce_vec); //tmpangle = 180.0RadToDeg(AngleOfAttack); result_force = t3dpoint<double>(0.0, 0.0, 0.0); angularity = t3dpoint<double>(0.0, 0.0, 0.0); int i; for (i=0; i<elcnt1; i++) { t3dpoint<double> ELEMENT_FORCE = t3dpoint<double>(0.0, 0.0, 0.0); double DynPressure = (0.5*squareSpeed*dens*ELEMENTS[i]>area); double r = VectorLength(ELEMENTS[i]>center_of_pressure); double EMOI = (ELEMENTS[i]>mass*r*r); double defk = 1.0 * absnf(ELEMENTS[i]>GetAngle()); t3dpoint<double> EDragForce = //flat square at 90 = 1.1 => 17.5 deg * 5.14 ELEMENTS[i]>ReturnDeflectionNormal(YPRangle.AIR_MATRIX) * defk * DynPressure; double AOA = ELEMENTS[i]>GetAngle()*17.5;//RadToDeg(AngleBetweenVectors(ELEMENTS[i]>ReturnDeflectionFront(YPRangle.AIR_MATRIX), Normalize(vel))); t3dpoint<double> ELiftForce = ELEMENTS[i]>ReturnDeflectionNormal(YPRangle.AIR_MATRIX) * LiftCoefficient(AOA,0) * DynPressure; t3dpoint<double> EGravityForce = Normalize(pos)*eGForce*ELEMENTS[i]>mass; ELEMENT_FORCE = EDragForce + ELiftForce + EGravityForce; double kamikadze = VectorLength(ELiftForce)  VectorLength(EGravityForce); Matrix44<double> BASE_ROT_MAT; BASE_ROT_MAT.LoadGLMatrix(YPRangle.AIR_MATRIX); t4dpoint<double> rotcoord = BASE_ROT_MAT * ELEMENTS[i]>center_of_pressure; t3dpoint<double> ELEMENT_R = t3dpoint<double>(rotcoord.x, rotcoord.y, rotcoord.z); t3dpoint<double> ETorque = ELEMENT_R * ELEMENT_FORCE; // R x F t3dpoint<double> EAngAcc = ETorque / EMOI; t3dpoint<double> EAngVel = EAngAcc*dt; t3dpoint<double> EAngMov = EAngVel*dt; angularity = angularity + EAngMov; result_force = result_force + ELEMENT_FORCE; } //fuselage has different approach because we subtract fuselage drag length from overall lift value result_force = result_force + Normalize(vel) * (0.5*0.270*squareSpeed*dens*FUSELAGE>area) + ThrustForce_vec + Normalize(pos)*eGForce*FUSELAGE>mass; YPRangle.pitch(cos(angularity.x*imopi),sin(angularity.x*imopi)); YPRangle.DoRotation(); YPRangle.yaw(cos(angularity.y*imopi),sin(angularity.y*imopi)); YPRangle.DoRotation(); YPRangle.roll(cos(angularity.z*imopi),sin(angularity.z*imopi)); YPRangle.DoRotation(); //add skin friction drag skin friction coeff for f18 maybe 0.0031 Acceleration = result_force / mass; vel = vel + (Acceleration * dt); pos = pos + (vel * dt);
In Topic: From AngularAcc from torque to angles : )
20 February 2015  11:24 AM
;]
In Topic: From AngularAcc from torque to angles : )
20 February 2015  10:19 AM
ok i get your point however your first post was totally in 100% correct i just was using one airlieron to determine the rotation which obvious produce yaw moment too.
i added second airlieron to the code and it produces now correct roll without yaw,
math was good. code was good too
I ignored your code,
HOW COULD YOU ?
In Topic: From AngularAcc from torque to angles : )
20 February 2015  05:37 AM
buck the multiplication you posted is actual a vector cross, because when multiplying two vectors * operator returns vector cross product.
By actual numbers do you mean calculate everything with a proper mass proper inertia moment and distances, and proper forces?
a pad and pencil or calculator
thats why i used that script to speed up the calculations.
As you provide no other information,
i would really like to know what do else you want me to show.
every function sets up different D and F (to calculate Torque = D x F;)
in this case elevator should change pitch
airlieron roll
rudder yaw.
everything except airlieron returns one rotation.
you know
i set airlieron at 10, 0 ,0 from the center of gravity so the R vector is 10, 0, 0
i apply a force to it which is 0, 2, 2 a force that is directed in up front direction uhm uhm now i see that it can produce two rotations but since i did something similar for elevator how could i achieve one rotation on airlieron