Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Python command to load temperature dependent material properties

Status
Not open for further replies.

Settler

Structural
Joined
May 22, 2010
Messages
88
Location
US
Hello all,

I want to input my material properties through my python script from a tabulated file (Located in C:/Temp/Steel.txt). The command needs a tweak after the table portion of the following command:

mdb.models[Modelname].materials[Steel].Elastic(table=((200000.0, 0.3, 20), ))

however I would need your help on how to solve my issue.

Thank you very much!

 
You have to fill something like this automatically:
mdb.models[Modelname].materials[Steel].Elastic(table=((200000.0, 0.3, 20), (180000, 0.28, 100)))


So you do it by replacing it with a variable:
mdb.models[Modelname].materials[Steel].Elastic(table=(x))

And now you have to create x to fit in there. x can be a list or a tuple. The content is number of tuples. So x looks like this:
x=[(E1,PR1,T1),(E2,PR2,T2)]


To get that you can create a list [E1,PR1,T1] and convert that afterward to a tuple. Now you can add that tuple to the list x.
 
Thanks! Made it work this way... Took some time until I understand how tuples work....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top