lign="justify">}
} if (side == RIGHT)
{(front == INCREASING) {Umin=arr [N-frontlength - 1]; Umax=arr [N -
]; } if (front == DECREASING) {Umin=arr [N - 1]; Umax=arr [N-]; }
}=Umin + 0.9 * (Umax-Umin);=Umin + 0.1 * (Umax-Umin); fronttime=0; (side == LEFT)
{(int i=0; i lt; frontlength; i ++)
{(arr [i] gt;=UL amp; amp; arr [i] lt;=UH) fronttime +=timedelta;
}
} if (side == RIGHT)
{(int i=N - 1; i gt; N-frontlength; i -)
{(arr [i] gt;=UL amp; amp; arr [i] lt;=UH) fronttime +=timedelta;
}
} * frontside=(side == LEFT? Forward raquo ;: Back ); * fronttype=(front == DECREASING? decreasing raquo ;: increasing ); ( front == NOFRONT)
{( There is no% s front. n raquo ;, frontside) ;;
}
{(% s front is% s, duration is% 20.15lf steps% d n raquo ;, frontside,, fronttime, frontlength);
}
}
File_io.cpp
# include mainheader.h namespace std; skipchars (FILE * f, int number)
{(int i=0; i lt;=number; i ++)
{(f);
}
} read_data ()
{* f; dummy [70]; _ s ( amp; f, data.txt raquo ;, r ); (f, % s% lf raquo ;, amp; dummy , amp; t_begin); (f, % s% lf raquo ;, amp; dummy, amp; t_end); (f, % s% lf raquo ;, amp; dummy, amp; t_1); (f, laquo ;% s% lf raquo ;, amp; dummy, amp; a); (f, % s% lf raquo ;, amp; dummy, amp; b); (f, % s% lf raquo ;, amp; dummy , amp; c); (f, % s% lf raquo ;, amp; dummy, amp; U1); (f, % s% lf raquo ;, amp; dummy, amp; U2); temp [255] ; (temp, 255, f); (temp, 255, f);
//fgets (temp, 255, f); (int i=0; i lt; N; i ++)
{(f, 16); _ s (f, % lf raquo ;, amp; (time [i])); _ s (f, % * c% lf raquo ;, amp; (Uvx [i])); _ s (f, % * c% lf% * c raquo ;, amp; (Uvix [i])); (temp, 255, f);
} (f);
} write_data ()
{* f; _s ( amp; f, data.txt raquo ;, w ); (f, tbegin% 14.5lf n raquo ;, t_begin); (f, tend% 14.5lf n raquo ;, t_end); (f, t1% 14.5lf n raquo ;, t_1); (f, a% 14.5lf n raquo ;, a); (f, b% 14.5lf n raquo ;, b); (f, c% 14.5lf n raquo ;, c); (f, U1% 14.5lf n raquo ;, U1); (f, U28% 14.5lf n raquo ;, U2); (f, ------------------------------------------------------------- ); (f, | # | time | Uvx | Uvix | n ); (f , ------------------------------------------------------------- ); (int i=0; i lt; N; i ++)
{(f, |% 14d | , i + 1); (f, % 14.2lf | , time [i]); (f, % 14.5lf | , Uvx [i]); (f, % 14.5lf | , Uvix [i]); (f, n );
} (f);
} output_arrays ()
{*f1,*f2,*f3;_s(amp;f1,laquo;array_time.txtraquo;,laquo;wraquo;);_s(amp;f2,laquo;array_Uvx.txtraquo;, w ); _ s ( amp; f3, array_Uvix.txt raquo ;, w ); (int i=0; i lt; N; i ++)
{(f1, % 20.7f n , time [i]); (f2, % 20.7f n raquo ;, Uvx [i]); (f3, % 20.7f n raquo ;, Uvix [i]);
} (f1); (f2); (f3);
}