/**
* @file ALGO_Density_ATY.c
*
* @param Project ALGO_Algorithm_ATY_LIB
*
* @author ATY
*
* @copyright
* - Copyright 2017 - 2025 MZ-ATY
* - This code follows:
* - MZ-ATY Various Contents Joint Statement -
*
* https://mengze.top/MZ-ATY_VCJS
* - CC 4.0 BY-NC-SA -
*
* https://creativecommons.org/licenses/by-nc-sa/4.0/
* - Your use will be deemed to have accepted the terms of this statement.
*
* @brief Familiar functions of MilkContent algorithm
*
* @version
* - 1_01_221217 > ATY
* -# Preliminary version, first Release
********************************************************************************
*/
#ifndef __ALGO_Density_ATY_H
#define __ALGO_Density_ATY_H
#include "INCLUDE_ATY.h"
/******************************* For user *************************************/
// #define __DEBUG_ALGO_Density_ATY
/******************************************************************************/
#define C_WATER 1
#define C_ALCOHOL 2
#define C_MAX 2
extern uint8_t detectContent_Density;
extern float speedAtRefT_Density;
/**
* @brief Calc pure water us speed at specified T
* @param T Temperature
* @note y = 0.0002x^3 - 0.0564x^2 - 5.1226x + 1401.4
*/
#define PureWaterSpeed(T) (1401.4 + 5.1226 * T - 0.0564 * T * T + 0.0002 * T * T * T)
/**
* @brief Calc pure water density at specified T
* @param T Temperature
* @note y = -0.0038x^2 - 0.0475x + 1000.5
*/
#define PureWaterDensity(T) (1000.5 - 0.0475 * T -0.0038 * T * T)
#endif /* __ALGO_Density_ATY_H */
/******************************** End Of File *********************************/