利用盐度(S)温度(T)压力(P)计算海水密度

def getDensity(S,T,P):'''先算Pw'''a0 = 999.842594a1 = 6.793952 * math.pow(10,-2)a2 = -9.095290 * math.pow(10,-3)a3 = 1.001685 * math.pow(10, -4)a4 = -1.120083 *math.pow(10,-6)a5 = 6.536332 * math.pow(10,-9)Pw = a0 + a1 * T + a2 * T * T + a3 * math.pow(T, 3) + a4 * math.pow(T, 4) + a5 * math.pow(T, 5);'''再算Pst0'''b0 = 8.24493 * math.pow(10, -1);b1 = -4.0899 * math.pow(10, -3);b2 = 7.6438 * math.pow(10, -5);b3 = -8.2467 * math.pow(10, -7);b4 = 5.3875 * math.pow(10, -9);c0 = -5.72466 * math.pow(10, -3);c1 = 1.0227 * math.pow(10, -4);c2 = -1.6546 * math.pow(10, -6);d0 = 4.8314 * math.pow(10, -4);Pst0 = Pw + (b0 + b1 * T + b2 * math.pow(T, 2) + b3 * math.pow(T, 3) + b4 * math.pow(T, 4)) * S + (c0 + c1 * T + c2 * math.pow(T, 2)) * S*math.sqrt(S) + d0 * S * S;'''算K(s,t,p) K(s,t,p)=K(s,t,0) +A*P +B*P*P    设为Kstp'''h0 = 3.239908;h1 = 1.43713 * math.pow(10, -3);h2 = 1.16092 * math.pow(10, -4);h3 = -5.77905 * math.pow(10, -7);Aw = h0 + h1 * T + h2 * T * T + h3 * T * T * T;'''Bw'''k0 = 8.50935*math.pow(10,-5);k1 = -6.12293 * math.pow(10, -6);k2 = 5.2787 * math.pow(10,-8);Bw = k0 + k1 * T + k2 * T * T;'''Kw'''e0 = 19652.21;e1 = 148.4206;e2 = -2.327105;e3 = 1.360477 * math.pow(10, -2);e4 = -5.155288 * math.pow(10,-5);Kw = e0 + e1 * T + e2 * T * T + e3 * math.pow(T, 3) + e4 * math.pow(T, 4);'''B'''m0 = -9.9348 * math.pow(10, -7);m1 = 2.0816 * math.pow(10,-8);m2 = 9.1697 * math.pow(10,-10);B = Bw + (m0 + m1 * T + m2 * T * T) * S;'''A'''i0 = 2.2838 * math.pow(10, -3);i1 = -1.0981 * math.pow(10, -5);i2 = -1.6078 * math.pow(10,-6);j0 = 1.91075 * math.pow(10,-4);A = Aw + (i0 + i1 * T + i2 * T * T) * S + j0* S * math.sqrt(S);'''K(s,t,0)'''f0 = 54.6746;f1 = -0.603459;f2 = 1.09987 * math.pow(10, -2);f3 = -6.1670 * math.pow(10, -5);g0 = 7.944 * math.pow(10,-2);g1 = 1.6483 * math.pow(10,-2);g2 = -5.3009 * math.pow(10,-4);Kst0 = Kw + (f0 + f1 * T + f2 * T * T + f3 * math.pow(T, 3)) * S + (g0 + g1 * T + g2 * T * T) * S * math.sqrt(S);'''Kstp'''Kstp = Kst0 + A * P + B * P * P;'''Pstp //p(s,t,p)=p(s,t,0)/[1-p/k(s,t,p)]'''Pstp = Pst0 /(1-(P/Kstp));return Pstpa=getDensity(35,25,1000)
print(a)

参考网址:
https://blog.csdn.net/weixin_42279616/article/details/111031450

Python计算海水密度(S,T,P)相关推荐

  1. 使用OpenCV和Python计算图像的“彩色度”

    使用OpenCV和Python计算图像"彩色度" 1. 效果图 2. 炫彩度量方法是什么? 3. 源代码 参考 你是否尝试过计算每个图像的炫彩值,并根据炫彩值对自己的图像数据集进行 ...

  2. Python计算训练数据集(测试集)中某个分类变量阴性(阳性)标签样本的不同水平(level)或者分类值的统计个数以及比例

    Python计算训练数据集(测试集)中某个分类变量阴性(阳性)标签样本的不同水平(level)或者分类值的统计个数以及比例 目录

  3. Python计算两个numpy数组的交集(Intersection)实战:两个输入数组的交集并排序、获取交集元素及其索引、如果输入数组不是一维的,它们将被展平(flatten),然后计算交集

    Python计算两个numpy数组的交集(Intersection)实战:两个输入数组的交集并排序.获取交集元素及其索引.如果输入数组不是一维的,它们将被展平(flatten),然后计算交集 目录

  4. Python使用datetime中的timedelta模块实现时间增减:python计算100天后是哪年那月那日?

    Python使用datetime中的timedelta模块实现时间增减:python计算100天后是哪年那月那日? 目录

  5. python计算特征的统计值并文本输出

    python计算特征的统计值并文本输出 # 输出统计分位数 df.describe(percentiles=[0.05, 0.25, 0.5, 0.75, 0.95]) featname:A => ...

  6. python计算特征与目标的相关性并可视化

    python计算特征与目标的相关性并可视化 pandas计算相关性 # 相关性 tips.corr() Out[2]: total_bill tip size total_bill 1.000000 ...

  7. python计算时间差

    python计算时间差 # 使用datetime 和 timedelta import datetime old_time = datetime.datetime.now() print(old_ti ...

  8. python计算两个字典的相同点(从key、value、item角度)

    python计算两个字典的相同点(从key.value.item角度) 字典是由一个一个的 key-value 构成的,key 是找到数据的关键,Python 对字典的操作都是通过 key 来完成的. ...

  9. python计算两个向量之间的欧氏距离

    python计算两个向量之间的欧氏距离 代码: import numpy as np # 向量的值 feature_1 = np.array([1,2,3]) feature_2 = np.array ...

最新文章

  1. numpy的random模块
  2. SqlSugar-事务操作
  3. 今天犯的一个错误,导致method GET must not have a request body
  4. 【转摘】Word中查找与替换的妙用
  5. 文件头_常见文件文件头
  6. Win7中IIS7.0安装及ASP环境配置
  7. 面试题24 二叉搜索树的后序遍历序列
  8. 面试官爱问的10大经典排序算法,20+张图来搞定
  9. Screen命令让Linux shell在后台运行
  10. Initramfs应用问题记录
  11. JSP 语法2 都在百分号里面: 5.@符号加JSP三种指令标签 6
  12. yum与apt-get的区别以及两者更新源(阿里/网易【163】)
  13. HTML5 Web Storage
  14. vs如何包含库文件以及头文件
  15. 能写进简历的Java实战项目飞机大战
  16. 瑞友天翼服务器系统资源不足,瑞友天翼问题处理
  17. 桌面推演技术前沿及发展趋势
  18. presscad排样lisp_PRESSCAD统赢使用技巧(二)
  19. 二分查找--天堂珍珠(珍珠项链)pearl
  20. c语言程序中a表示什么区别,C语言中if(!a)表示什么意思?

热门文章

  1. Windows文件管理:文件共享如何关闭/如何关闭文件共享式
  2. fetch用英语解释_fetch什么意思_fetch是什么意思中文翻译
  3. 计算机感染病毒解决办法,电脑感染了病毒怎么解决,教你解决电脑感染了病毒的方法...
  4. 甲基化系列 3. 甲基化芯片数据分析完整版(ChAMP)
  5. chosen插件引入、初始化、取val、取text、赋值
  6. ubuntu中用python获取GPU温度。push给falcon-agent。
  7. [Win32] 直接读写磁盘扇区(磁盘绝对读写)
  8. 软考系统架构设计师备考
  9. Android应用程序介绍
  10. 【ue】UltraEdit使用技巧