Even More Matrix Computations

Even More Matrix Computations - Сообщения

#1 Опубликовано: 05.12.2021 09:52:56
ianlh

ianlh

0 сообщений из 38 понравились пользователям.

Группа: User

Hi,

Back again with another matrix problem, this time on interpolation and bilinear interpolation.

Below is the matrix and relevant values to use (d.t and d.dd) to find the values in sigma.ct matrix

matrix1.JPG

There is a condition that any value in d.dd that is below vy=20 shall use the value in the first row, and not be interpolated below. e.g. d.t = 500 & d.dd = 2.6637 sigma.ct shall be 58.

I have used the linterp2 function to find the values which meet this criteria, which works on its own, but I cant get it to work in a if condition. I have used the interpBilinear function to get the values when d.dd is above vy=20 and this works within the if loop as it gives only the last two rows of the above requirements.

When combined in the for loop the below happens, the linterp2 still gives all the rows, rather than only giving the first 7 (in this case), but gives the correct number of columns.

Is there any way of correcting this? As a thought do I need to put the condition check d.dd<20 within the linterp2 function. if so where would I put it?

matrix2.JPG

Bilinear Interpolation2.sm (24 КиБ) скачан 33 раз(а).

Thanks in advance
Ian
#2 Опубликовано: 05.12.2021 14:23:09
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Back again with another matrix problem, this time on interpolation and bilinear interpolation.


Sorry, I don't understand the problem.

Bilinear Interpolation2.sm (24 КиБ) скачан 28 раз(а).


#3 Опубликовано: 05.12.2021 16:35:21
ianlh

ianlh

0 сообщений из 38 понравились пользователям.

Группа: User

Wrote

Wrote

Back again with another matrix problem, this time on interpolation and bilinear interpolation.


Sorry, I don't understand the problem.

Bilinear Interpolation2.sm (24 КиБ) скачан 28 раз(а).




Hi,

the result should look like:

matrix3.JPG

#4 Опубликовано: 05.12.2021 18:47:57
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

the result should look like:


... finish the construction.

stack.PNG
#5 Опубликовано: 05.12.2021 19:04:41
overlord

overlord

552 сообщений из 1332 понравились пользователям.

Группа: Moderator

Since your linterp2() function creates arrays,
an index is needed at q inside for_loop calculation.

Regards

2021-12-06_01-02.png
#6 Опубликовано: 06.12.2021 05:36:14
ianlh

ianlh

0 сообщений из 38 понравились пользователям.

Группа: User

Once again so close, thanks for the pointer

Below is corrected:
Bilinear Interpolation2 v1.sm (22 КиБ) скачан 26 раз(а).

Thanks
Ian
#7 Опубликовано: 06.12.2021 08:59:52
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

You can recast the bilinear in preparation to CreateMesh

Bilinear Interpolation2 v1.sm (43 КиБ) скачан 29 раз(а).
#8 Опубликовано: 06.12.2021 10:12:33
ianlh

ianlh

0 сообщений из 38 понравились пользователям.

Группа: User

Nice, thank you Jean
#9 Опубликовано: 06.12.2021 12:44:00
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

You can recast the bilinear in preparation to CreateMesh


... it didn't attach ???

Bilinear Interpolation2 v1 Next.sm (71 КиБ) скачан 35 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений