用2个变量和1个相关值插值矩阵

问题描述 投票:1回答:1

我正在分析感应电动机,改变定子电流的频率和绝对值。由于FEM-Tool仅适用于电流输入,因此我需要在频率上改变电流,以获得每个频率的恒定转矩的电流值。

为了生成网格,我使用2个for循环:外部循环设置当前。内环通过所述电流改变频率,获得机器的扭矩,最后,附加矩阵,将每个定子电流,频率和扭矩分别添加到单独的矩阵中。绘制它看起来像这样:Example of the plot using the raw data对于绘图我使用更小,更不精确的矩阵和相当任意的值:

I_S = [ 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 ];
fre = [ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 ];
tor = [ 0 0.1 0.3 0.5 0.7 1 1.5 2 2.6 3.3 0 1.1 1.3 1.5 1.7 2 2.5 3 3.6 4.3 0 2.1 2.3 2.5 2.7 3 3.5 4 4.6 5.3 ];

tor在情节中显示为色彩图。每个矩阵的长度为30。

一次模拟需要大约20-30秒。因此,为了获得精确的网格,FEM工具需要几个小时来生成。

我想在已知的空间之间插入空格。

似乎无论是创建矩阵的方式是问题还是interp * ......- Octave / MATLAB的函数根本不适用于这种插值。

有没有办法从这种类型的矩阵实现网格/网格状插值?我发现很多例子用x,y作为变量,z作为数学函数,但很少有3个线性/非线性矩阵。

matlab octave interpolation
1个回答
0
投票

您的数据需要采用网格形式,即2D:

// Known data
current = [0:2];
frequency = [0:9];
[current2D, frequency2D] = meshgrid(current,frequency);
torque2D = [ 0 0.1 0.3; 0.5 0.7 1; 1.5 2 2.6; 3.3 0 1.1; 1.3 1.5 1.7; 2 2.5 3; 3.6 4.3 0; 2.1 2.3 2.5; 2.7 3 3.5; 4 4.6 5.3 ];

// Interpolated data
currentToInterpolate = [0.5 1.5];
frequncyToInterpolate = [0.5 : 8.5];
[currentToInterpolate2D, frequencyToInterpolate2D] = meshgrid(currentToInterpolate,frequncyToInterpolate);
interpolatedTorque2D = interp2(current2D,frequency2D,torque2D,currentToInterpolate2D,frequencyToInterpolate2D);
© www.soinside.com 2019 - 2024. All rights reserved.