# MeLa: A Programming Language for a New Multidisciplinary Oceanographic Float
## 2 A Programming Language Based on Models
### Battery Life Time  
The lifetime of the instrument \(LT\) is related to the energy that is contained in the battery \(E_{bat}\), the mean energy consumption of a dive \(E_{dive}\) and the mean duration of a dive \(T_{dive}\):  
\[LT=E_{bat}/E_{dive}*T_{dive} \tag{4}\]  
The energy contained in the battery (i.e., the battery capacity) is known and the computation of the mean duration of a dive has been introduced previously. The mean energy consumption of a dive is equal to the sum of the energy that is consumed during each of the stages (i.e., descent, parking, ascent, and surface).  
For each stage, the energy that is consumed \(E_{stage}\) is the sum of the energy consumed by the actuators, the sensors, the acquisition board, and the satellite communication devices. Naturally, when the float is underwater the satellite communication devices are switched off and do not consume any energy.  
\[E_{stage}=E_{act}+E_{sens}+E_{board}+E_{com} \tag{5}\]  
The energy that is consumed by the actuators \(E_{act}\) depends on the mission step. Most of the energy of the descent is consumed by operating a valve at the surface. Once the float is deep enough, the pressure of the water is high enough to transfer oil from the outer bladder to the inner reservoir with almost no energy required from the pump. Thus, we assume that the energy consumption of the descent is a small constant value. For the parking we consider that the energy consumption is null even if there is occasionally some small depth correction. Most of the energy is consumed during the ascent because the pump has to push oil in the outer bladder where the pressure can reach several hundred of bars. We use a quadratic relation between the power consumption and the depth of the float, and add a constant value for the power that is needed to fill the bladder at the surface. The linear relation is a simplified model, we plan to improve it by taking account of the motor efficiency and behavior of the float during the ascent, and then validate it with experimental data.  
The energy consumed by the sensors \(E_{sens}\) is the product of their activation time with their energy consumption. The activation of a sensor can be intermittent if it is used by a short acquisition mode. Moreover, the same sensor can be used by several applications. Thus, an algorithm computes the activation time of the sensors. For example, if two applications, A and B, use the same sensor, one for  
Figure 6: Mean parking duration in function of the mean number of ascent requests for a default parking duration of 10 d.  
two minutes every five minutes and the other for one minute every three minutes, the algorithms compute the pattern of Table 1 that repeats itself every 15 min. Here, the sensor is used nine minutes over a period of 15 min, which is 60% of the time. If the stage during which this sensor is activated has a mean duration of 10 h, the activation time of the sensor is six hours.  
The energy consumed by the acquisition board \(E_{board}\) is the power consumption of the board multiplied by the mission step duration. This simplified model assumes that the acquisition board power consumption is constant. It is a conservative model, because the sleeping modes, activated when the board does not have any data to process, are not taken into account.  
The energy consumed by satellite communication is the number of bytes to transmit \(Tx_{bytes}\) divided by the average speed of the transmission \(Tx_{speed}\), which gives the duration of the transmission, and multiplied by the power consumption of the transmission device \(P_{sat}\):  
\[E_{sat}=Tx_{bytes}/Tx_{speed}*P_{sat} \tag{6}\]