TCL script
Answers
-
Hello Everyone
So actually the question is:
The first script attached which is '(final final XX_YY_ZZ.tcl)' tell me the values of stress in 'XX, YY, ZZ, XY, YZ, XZ' direction. I want to use this values to compute the eigenvalues (which can be calculated using eigenvalues), however I am not sure the command for eigenvalue.
The second script (failure stress.tcl) calculates the failure stress. In this script, 'sigma_1', 'sigma_2', 'sigma_3' are the three principal stresses which should be obtained from the previous script. I just want to integrate the two scripts, so that when I select a node, it tell me what is the failure stress for that particular node.
Would really appreciate if someone can help me with it.
Thanks
0 -
https://core.tcl.tk/tcllib/doc/trunk/embedded/www/tcllib/files/modules/math/linalg.html
I don't know if Altair's TCL distribution contains this library.
0 -
Thanks for sharing this link Q.Nguyen.
Do you have any idea how to integrate the above two scripts though?
0 -
Also, the command doesn't work in hyperview! It just says 'Invalid command name'
0 -
You need tcllib package
0 -
actually you can use hyperwork templex to calculate, example
proc get_eigen_values {matrix} {
set Home 'C:/Program Files/Altair/2017'
set Templex [glob [file join $Home hw bin win?? templex.exe]]
set TplFile geteigenval.tpl
set fpt [open $TplFile w]
puts $fpt '{eigvalreal($matrix)}'
close $fpt
exec $Templex $TplFile
}
now invoke in hyperview:
get_eigen_values '{{0,1},{-2,-3}}'
return eigen values '-1, -2'
0 -
Hey Tinh
Thanks a lot for the reply. The eigenvalue things work perferct. I have added the above code in my second script.
Could you please help me now with the integration of both the scripts. Attached you will find the modified version of second script 'failure stress.tcl'
Thanks again
0 -
0
-
why do you have to calculate principle stresses? because i am sure that hyperview can output them
0 -
Yes. You are right. But my aim is that once the user selects the node, it tells user what exactly is the failure stress of that particular node.
The first script 'final_final_XX_YY_ZZ' gives the values of stress in XX, YY, ZZ, XY, YZ, XZ directions. I tried to output the principal stresses by directly modifying the first script, but I couldn't. So I thought to use the stress values in 'XX, YY; ZZ, XY, YZ, XZ ' direction to calculate the principal stresses using eigenvalues.
The eigenvalues or the principal stresses are then used in subsequent formulas as depicted in script 2('failure stress.tcl') to calculate the failure stress.
My problem is I don't know how to integrate the two script. I have attached both the files again
Thanks for the help. Really appreciate it
0