Jump to content
Sign in to follow this  
Novak

TCL script

Recommended Posts

Hello Everyone

 

Can anyone please tell me how to find the all the eigenvalues of a matrix using TCL command in hyperview?

Thanks in advance

Share this post


Link to post
Share on other sites

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

 

final final stress_XX_YY_ZZ.tcl

failure stress.tcl

Share this post


Link to post
Share on other sites

B)

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"

Share this post


Link to post
Share on other sites

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

 

failure stress.tcl

Share this post


Link to post
Share on other sites

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

final final stress_XX_YY_ZZ.tcl

failure stress.tcl

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...