#ifndef lint
static char 
*rcs="$Header: /mit/hst/src/sim/RCS/mkdata.c,v 2.1 90/08/28 14:46:02 tldavis Exp $";
#endif

/* Copyright 1988 Timothy L. Davis
 *$Source: /mit/hst/src/sim/RCS/mkdata.c,v $
 * Writes a block of 10 beats to the file "btdata" in the current directory.
 * To look at this binary data directly, use the companion program "testdata".
 */

#include <fcntl.h>
#include <stdio.h>
#include <signal.h>
#include "CVDefs.h"

extern SIMULATION *getsimulation();
extern double getval();

void SimDataEnq(x)
double x[];
{
  printf("Vl: %lg  Pl: %lg  Cl: %lg  t:%lg i:%d Va: %lg\n",
	 getval(x, LV, VOLUME), x[0], x[7], x[6], (int)x[9], 
	 getval(x,SA,VOLUME));
}

int fpe_in_simulate()
{ perror("FPE!");
}
main()
{
SIMULATION *parameters;
extern modparam_handlr();
extern double xmin, xmax, ymin, ymax;
int i;
double x[10];

parameters =  getsimulation(NORMAL);
initeqnvars(parameters);

estimate(parameters, x);
btconst();

while (x[6] < 10) simulate(x, 100);

printf("simulate: terminated!\n");
fflush(stdout);

}

PostErrorString(s)
     char *s;
{  char ss[256];
   sprintf(ss, "zwrite -q $USER -m %s",s);
   system(ss);
}

SetParamFromSim(p, t, v, fd)
int p, t, fd;
double v;
{
  ;
}

void UpdateParamWindow() 
{
 ;
}