要实现的功能:
1. Enable users to enter the inlet flow (0-100 m3/hour).
2. Enable users to enter the outlet flow (0-100 m3/hour).
3. Dynamically display the value of the current liquid level in the
   water tank (0-100 %).
4. Animate the changing of the liquid level.
5. Sound an alarm only when the tank is empty or has overflowed.Mathematic model 算法例子 waterL: water level
 Fin: inlet flowrate
 Fout : outlet flowrate
 0.1 is a parameter (you can choose different value for this para meter)
   WaterL= waterL+0.1*(Fin-Fout)
 Initial value of waterL is equal to zero
 If waterL>100 waterL =100
 If waterL <0 waterL=0public class tankModel
{
  double waterL;
  tankModel() {
  waterL=0;
  }  public double currentLevel(int Fin, int Fout) {
   waterL=waterL + 0.1*(Fin – Fout);
    if (waterL>100.0)
         waterL =100.0;
    else if (waterL<0.0)
       waterL = 0; 
    return (waterL );
    }
}
图的样子是一个水罐  上面一个入水龙头 下面一个出水龙头  通过改变两个龙头的水流量 动态的改变罐内 水平面高度  并在水溢出的时候发出警告 第一次用JAVA碰到这个 实在头疼  请高手帮忙我的QQ:93965968   多谢