Interpolation on stiffness matrices

Hi all, I have a question regarding the interpolation of matrices (stiffness matrices from a FEM model).
First, i have a 2D grid for 2 different design parameters (geometric, such as thickness of an element in my FEM model) so at each gridpoint I want to calculate a stiffness matrix and store it. Later on, I would like to interpolate in between the pre-computed stiffness matrices. So I actually have two questions:
1) What is the best way to "store" the different matrices ? I don't want to have say n number of variables for n pre-computed matrices. Is it useful to work with cells here ?
2) What is the best way to interpolate here ? So at every coordinate (x,y) or (parameter1, parameter2) I don't have 1 specific z-value but a matrix which corresponds to that coordinate.
(This will later on also be extended to more parameters, about 10)
Thanks!

 採用された回答

KSSV
KSSV 2017 年 6 月 15 日

0 投票

1. If all the matrices are of same size save it as a 3D matrix. If they are of different sizes save as cell.
2. For interpolation f you have spatial info use interp2. If there is no spatial info use imresize.

5 件のコメント

Jeroen
Jeroen 2017 年 6 月 15 日
Thank you for your answer. For saving as a 3D matrix:
For 1 coordinate, say I want to store a 10x10 matrix there, how would that look like ?
KSSV
KSSV 2017 年 6 月 15 日
編集済み: KSSV 2017 年 6 月 16 日
If you want to save p stiffness matrices of order mxn it should be like.
m=10;n=10;p=5;
K=zeros(m,n,p);
for i=1:p
k(:,:,i)=Rand(m,n);
end
Jeroen
Jeroen 2017 年 6 月 16 日
Thanks! That is a nice idea indeed. Later one when I change to more parameters I think I will switch to class definitions again and make an object which will include the data.
About the interpolation I have a last question: I can't figure out an easy way to program an interpolation with data like this. Because the grid is scattered distributed (latin hypercube sampling).
So in 2D my coordinates of the parameter points are (parameter 1, parameter 2) but I don't have one specific z-value for each coordinate but a matrix as "z-value". Can you maybe help me with that as well?
Thanks a lot!
KSSV
KSSV 2017 年 6 月 19 日
The interpolation part is not clear to me....can you elaborate?
Jeroen
Jeroen 2017 年 6 月 19 日
Sure!
So I have a function [K,M] = FEM_model(alpha,beta) which creates for each value of alpha and beta (scalars) a stiffness matrix K and mass matrix M. At a new coordinate alpha,beta I want to find the corresponding stiffness matrix again. So for example by using weighted interpolation .
Hope that is a bit more clear, else let me know :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

質問済み:

2017 年 6 月 15 日

コメント済み:

2017 年 6 月 19 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by