水轮机机组工况图形化展示研究

需要解决的问题

  1. 根据(x,y,z) 点集得到其拟合函数
  2. 绘制三维曲面
  3. 在三维曲面上绘制指定的点

解决方案

函数拟合

使用MATLAB fitting curve tool中的多项式拟合解决函数拟合的需求

绘制三维曲面

采用ECharts GL实现B端的绘制,ECharts安装代码如下:

<script src="lib/echarts.min.js"></script>
<script src="lib/echarts-gl.min.js"></script>

使用ECharts提供的series-surface,基础配置代码示例如下:

<script>
option = {
    tooltip: {},
    backgroundColor: '#fff',
    visualMap: {
        show: false,
        min: -1,
        max: 1,
        inRange: {
            color: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']
        }
    },
    xAxis3D: {
        type: 'value',
        min: 1000,
        max: 8000,
    },
    yAxis3D: {
        type: 'value'
        min: 30,
        max: 80,
    },
    zAxis3D: {
        type: 'value'
        min: 0.6,
        max: 1.0,
    },
    grid3D: {
        viewControl: {
            // projection: 'orthographic'
        }
    },
    series: [{
        type: 'surface',
        wireframe: {
            // show: false
        },
        equation: {
            x: {
                step: 500,
		        min: 1000,
		        max: 8000,
            },
            y: {
                step: 50,
				min: 30,
				max: 80,
            },
            z: function (x, y) {
                if (Math.abs(x) < 0.1 && Math.abs(y) < 0.1) {
                    return '-';
                }
                return Math.sin(x * Math.PI) * Math.sin(y * Math.PI);
            }
        }
    }]
}
</script>

在三维曲面上绘制点

使用ECharts GL提供的series-scatter3D,基础配置代码示例如下:

{
 	name: '工况点',
    type: 'scatter3D',
    symbol: 'pin',
    symbolSize: 20,
    zlevel: -9,
    itemStyle: {
        borderWidth: 1,
        borderColor: '#000'
    },
    label: {
        show: true,
        // formatter: '{a}: {c}',
        formatter: function (params) {
            return params.seriesName +
                '\n\nx:\t' + params.data[0] + '\tkW' +
                '\ny:\t'   + params.data[1] + '\tm' +
                '\nz:\t'   + params.data[2];
        },
    },
    data: [[x, y, z]],
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值