Все ответы об инженерном анализе

Перед началом работы настоятельно рекомендуем ознакомиться с правилами форума.

Использование subroutine в Mechanical APDL

marvov
Аватар пользователя marvov

Здравствуйте, уважаемые эксперты!

В макросе я получаю матрицу жёсткости 6х6, и мне нужно из неё получить матрицу податливости, чтобы потом вычислить технические упругие постоянные. То есть нужно использовать обращение матриц.

Нашёл в Help для этого сабрутину symeqn. help/ans_prog/Hlp_P_UPF3_4.html#a3BN4r25dlcd

*deck,symeqn
      function symeqn (a,nd,n,nc,defFlag)
c
c primary function:  solve a set of simultaneous linear equations 
c
c secondary functions: invert a matrix
c
c          NOTE:  this routine assumes that the matrix to be solved or
c                 inverted is positive or negative definite.  This routine
c                 also assumes that the diagonals are all non-zero. If
c                 this assumption is not true, use isimeq.F.
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c  input arguments:
c     variable (typ,siz,intent)    description
c     a        (dp,ar(nd,*),inout) - matrix to be solved or inverted
c                                      second dimension must be at least:
c                                                               n + abs(nc)
c     nd       (int,sc,in)         - first dimension of the a matrix
c     n        (int,sc,in)         - number of equations
c     nc       (int,sc,in)         - number of additional columns.
c                                      if nc = +n or -n, invert n x n matrix and
c                                      put result in the n+1 to 2xn columns.
c                                      if nc is 0 or negative, nc will be reset to
c                                      n and then symeqn will set up identity
c                                      matrix after the input matrix, where the
c                                      result of the inversion will be put.
c                                      if nc is positive and less than n, do a
c                                      partial inversion. see example 1 below.
c     defFlag  (int,sc,in)         - flag indicating that incoming matrix MUST be:
c                                      -1 - negative definite
c                                       0 - positive or negative definite
c                                       1 - positive definite
c
c  output arguments:
c     variable (typ,siz,intent)    description
c     symeqn   (in,sc,out)         - 0 - non-singular matrix
c                                    1 - singular matrix
c                                    2 - near-singular matrix
c     a        (dp,ar(nd,*),inout) - results or inverted matrix.
c                                      starts in column n+1.
c                                      note:  original information is destroyed.
c
c   example 1:   Solve three simultaneous linear equations:
c                      i = symeqn (a(1,1),3,3,1)
c                   calling routine has a dimensioned as a(3,4)
c                   each equation has its 3 coefficents in the first 3 columns,
c                    and the constant term is in the fourth column.
c                   solution is in fourth column.

Никогда не сталкивался с написанием и использованием сабрутин, а изучение хелпа мне не сильно помогло - всё равно не могу разобраться в сути.

Подскажите, пожалуйста, каким образом добавить с помощью этой сабрутины операцию инвертирование матрицы в свой APDL макрос.

Zagrebelny
Аватар пользователя Zagrebelny

Добрый день.

Увы, но тут придётся углубиться в изучение соответствующего раздела help. Потребуется навык программирования на C или фортране, кстати.

marvov
Аватар пользователя marvov

Здравствуйте!

Спасибо за Ваш ответ!

В общем, обошёлся я без сабрутин просто средствами матричных операций, циклов и условий в APDL, используя формулу Гаусса для обращения матриц. Помогло то, что в матрице жёсткости 4, 5 и 6 строки и столбцы нулевые, кроме главной диагонали, иначе посчитать определители матриц 6х6 было бы очень проблематично (к слову, функции вычисление определителя в APDL тоже нет).

lebesgue
Аватар пользователя lebesgue

А команда *MOPER, ParR, Par1, INVERT  не подошла бы для обращения матрицы?

Добавить комментарий

Войдите или зарегистрируйтесь, чтобы отправлять комментарии
Приложить файл

Максимальный размер файла: 999 МБ.
Допустимые типы файлов: txt doc docx xls xlsx pdf rar zip 7zip tar.