cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Symbolic calc is very slow (MC15)

ifomenko
15-Moonstone

Symbolic calc is very slow (MC15)

Hi, I`m trying to get tangent stiffness matrix of 6 nodes triangular finite element. Beginning part of code contains symbolic calculation and very simple operations such as getting one element of vector or transpose are very very slow. So I can`t to continue.Thanks in advance for any advice. File is attached.

5 REPLIES 5
-MFra-
21-Topaz II
(To:ifomenko)

Hi.

It is not slow for me.

At the beginning of the file - it is better to define the variables and constants in any way - and then reset them all - as shown below -

IFK answer.jpg

ifomenko
15-Moonstone
(To:-MFra-)

It takes 20 sec to recalculate worksheet for N.nd=6

and what`s about you?

Werner_E
25-Diamond I
(To:ifomenko)

You are calling B N.nd times just to pick out one of the six results and transpose it. Its sure more efficient to call B.n just once and work on the result.

This modification should do the job approx. N.nd times faster 😉

Werner_E_0-1581447331814.png

 

ifomenko
15-Moonstone
(To:Werner_E)

Many thanks my dear Werner, I`m so inattentive, I`m sorry.

ifomenko
15-Moonstone
(To:Werner_E)

Ok, but what if I have such situation

Problem2.png

EDIT: How to prevent lazy evaluation and calculate all B.(n) before this procedure?

Announcements

Top Tags