{
- if((Flap_handle != lastFlapHandle) && (dt > 0))
+ if((Flap_handle != lastFlapHandle) && (dt > 0)) {
Flaps_In_Transit=1;
- else if(dt <= 0)
+ } else if(dt <= 0) {
Flap_Position=Flap_handle;
+ }
lastFlapHandle=Flap_handle;
if((Flaps_In_Transit) && (dt > 0))
$Header$
$Log$
+Revision 1.10 1999/11/03 16:46:24 curt
+Patches from Tony to enable brakes.
+
Revision 1.9 1999/11/01 18:17:16 curt
c172 updates from Tony. Fix extra yaw when using ailerons. Flaps and elevator
tweaks.
* Put aircraft specific executable code here
*/
- percent_brake[1] = 0.; /* replace with cockpit brake handle connection code */
+ percent_brake[1] = Brake_pct; /* replace with cockpit brake handle connection code */
percent_brake[2] = percent_brake[1];
caster_angle_rad[0] = 0.03*Rudder_pedal;
SCALAR *control[7];
SCALAR *state[7];
float old_state,effectiveness,tol,delta_state,lctrim;
+ float newcm,lastcm,cmalpha;
if(argc < 6)
{
printf("\nLong_control: %g\n\n",Long_control);
- IC.altitude=1000;
- setIC(IC);
- ls_loop(0.0,-1);
- IC.flap_handle=10;
- setIC(IC);
- ls_loop(0.0,-1);
- IC.flap_handle=20;
- setIC(IC);
- ls_loop(0.0,-1);
- IC.flap_handle=30;
- setIC(IC);
- ls_loop(0.0,-1);
-
+ IC.cg=0.155;
+ IC.alpha=-5;
+ setIC(IC);ls_loop(0.0,-1);
+ newcm=CLwbh*(IC.cg - 0.557);
+ lastcm=newcm;
+ out=fopen("cmcl.out","w");
+ while(IC.alpha < 22)
+ {
+ IC.alpha+=1;
+ setIC(IC);ls_loop(0.0,-1);
+ newcm=CLwbh*(IC.cg - 0.557);
+ cmalpha=newcm-lastcm;
+ printf("alpha: %4.0f, CL: %5.2f, Cm: %5.2f, Cma: %7.4f\n",Alpha*RAD_TO_DEG,CLwbh,newcm,cmalpha);
+ fprintf(out,"%g %g\n",newcm,CLwbh);
+ lastcm=newcm;
+ }
+ fclose(out);
/* find_trim_stall(200,out,IC);
IC.vc=120;