Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: How to creat a data file of abaqus which can be readed by Matlab

  1. #1

    How to creat a data file of abaqus which can be readed by Matlab


    Hi,
    I am doing optimization with abaqus and matlab. And I have force and displacement data, both experimental and numerical data which come from abaqus simulation, compare the experimental and numerical data to get optimal parameter with matlab optimization tool. But now I have a problem how to output the force-displacement of a node set in abaqus to a file which can be readed by matlab?
    Can anyone give me some help?
    Thank you for your attention!

  2. #2
    Hi,all
    Thank you for your attention. Under the help of biofriend, I used the odbreport command in abaqus to report the displacement-force data into a .rep file. As the following:
    -----------------------------------------------------------
    Step name 'Load'
    description :
    number : 1
    domain : TIME
    procedure : *STATIC
    timePeriod : 1.0
    totalTime : 0.0
    previousStep : Initial
    nlgeom : Yes

    Number of history regions = 1

    History Region 'Node CONICAL-1.1'
    description : Output at instance CONICAL-1 node 1
    History Point
    position : NODAL
    instance : CONICAL-1
    node : 1

    History Output 'RF2'
    description : Reaction force
    type : SCALAR
    Frame value Data
    0.0 0.0
    0.001 -0.000589552
    0.002 -0.00117862
    0.0035 -0.0020613
    0.00575 -0.00338319
    0.009125 -0.00536105
    0.0141875 -0.00831677
    0.0217813 -0.0127225
    0.0331719 -0.0192631
    0.0502578 -0.0289014
    0.0758867 -0.110891
    0.11433 -0.271967
    0.16433 -0.515706
    0.21433 -0.928407
    0.26433 -1.36514
    0.31433 -1.99691
    0.36433 -2.62109
    0.41433 -3.45311
    0.46433 -4.30737
    0.51433 -5.3008
    0.56433 -6.39789
    0.61433 -7.51737
    0.66433 -8.86923
    0.71433 -10.2136
    0.76433 -11.7104
    0.81433 -13.3232
    0.86433 -14.928
    0.91433 -16.7865
    0.96433 -18.6739
    1.0 -20.015

    History Output 'U2'
    description : Spatial displacement
    type : SCALAR
    Frame value Data
    0.0 0.0
    0.001 -0.005
    0.002 -0.01
    0.0035 -0.0175
    0.00575 -0.02875
    0.009125 -0.045625
    0.0141875 -0.0709375
    0.0217813 -0.108906
    0.0331719 -0.165859
    0.0502578 -0.251289
    0.0758867 -0.379434
    0.11433 -0.57165
    0.16433 -0.82165
    0.21433 -1.07165
    0.26433 -1.32165
    0.31433 -1.57165
    0.36433 -1.82165
    0.41433 -2.07165
    0.46433 -2.32165
    0.51433 -2.57165
    0.56433 -2.82165
    0.61433 -3.07165
    0.66433 -3.32165
    0.71433 -3.57165
    0.76433 -3.82165
    0.81433 -4.07165
    0.86433 -4.32165
    0.91433 -4.57165
    0.96433 -4.82165
    1.0 -5.0

    End of ODB Report.

    Which I need to load into matlab is only the numerical data in red. I am a new user of Matlab.
    Are there anyone can help me how can I write a matlab file to load the numerical data into matlab?

  3. #3
    Yeap, its pretty straight forward. If you're new to matlab, its probably easiest to just use the import wizard.

    Change the file extension from .rep to .txt. Then open matlab and go to File - Import wizard and open the file. You can then create arrays/matrices from your data.

    Once you're more accustomed to matlab you can write an mfile that will do it automatically using a function like textread. There are several others either.

  4. #4

    How to change .rep to .txt

    Quote Originally Posted by creanea View Post
    Yeap, its pretty straight forward. If you're new to matlab, its probably easiest to just use the import wizard.

    Change the file extension from .rep to .txt. Then open matlab and go to File - Import wizard and open the file. You can then create arrays/matrices from your data.

    Once you're more accustomed to matlab you can write an mfile that will do it automatically using a function like textread. There are several others either.
    Hi,creanea,
    thank you for the answer.
    Can you tell me more details:
    1. How can I change .rep to .txt
    2. How can I creat arrays/matrices? Is the created arrays/matrices is the data I need?
    3. Can you give me a example matlab file?
    Thank you

  5. #5
    1. Right click and rename it with .txt at the end. It mightn't even be necessary.

    2. Open the import wirard, click on the file. Your data will automatically but into arrays. You can select any data in the file, similar to excel.

    3. Loads of examples in the Matlab help.

  6. #6
    Quote Originally Posted by creanea View Post
    1. Right click and rename it with .txt at the end. It mightn't even be necessary.

    2. Open the import wirard, click on the file. Your data will automatically but into arrays. You can select any data in the file, similar to excel.

    3. Loads of examples in the Matlab help.
    Hi,creanea,
    thank you for your quickly help. It really gives me inspiration.
    But I still have problems:
    1.I want to ask Matlab change .rep to .txt automatically, because I will do many times calculation, I can not do it by hand every time. So I look for a matlab command to change .rep to .txt
    2. The same problem like 1. I want to write a matlab procedure to make matlab select the data(red ones) automatically, to fill this data into a new file as a 2*n matrics.
    3. In my .rep there a lot other characters, and that I feel it is difficult to deal with. And the examples in matlab help I see only for simple number data or with a few headers. I don't know if there is example file similer to my problem.

  7. #7
    You should see look for the functions textscan and str2double in the matlab help then, although there may be better ones I'm not sure.

    I've attached an mfile I used to read from .odb files and write to .inp files. I can't remember exactly how it works but it shouldn't take long to understand and may give you ideas on where to start for on your own code.

    You will need to search for the first and last line of the data you want to extract - this is done using the nested loops starting on line 45. Maybe ignore the first half of the mfile as it involves using a python script to take stress results from abaqus.

    Forget about changing the file type, its not needed, textscan will read any type of text file.
    Attached Files Attached Files

  8. #8

    How can I write the red and blue numeric data into a txt file with two column respect

    Thank creanea's useful advise. Now I read the data to a 94*1 cell array.
    But I still have a problem:
    How can I write the red and blue numeric data into a txt file with two column respectively?
    Now I can only write all of the data into one column.
    'Report:'
    'ODB'
    ':'
    ':'
    ':'
    ':'
    ''
    'number'
    ''
    'name'
    ':'
    ':'
    ':'
    ':'
    ':'
    ':'
    ':'
    ':'
    'of'
    'Region'
    ':'
    'Point'
    ':'
    ':'
    ':'
    'Output'
    ':'
    ':'
    'value'
    '0.0'
    '-0.005'
    '-0.01'
    '-0.0175'
    '-0.02875'
    '-0.045625'
    '-0.0709375'
    '-0.108906'
    '-0.165859'
    '-0.251289'
    '-0.379434'
    '-0.57165'
    '-0.82165'
    '-1.07165'
    '-1.32165'
    '-1.57165'
    '-1.82165'
    '-2.07165'
    '-2.32165'
    '-2.57165'
    '-2.82165'
    '-3.07165'
    '-3.32165'
    '-3.57165'
    '-3.82165'
    '-4.07165'
    '-4.32165'
    '-4.57165'
    '-4.82165'
    '-5.0'

    'Output'
    ':'
    ':'
    'value'
    '0.0'
    '-0.000589552'
    '-0.00117862'
    '-0.0020613'
    '-0.00338319'
    '-0.00536105'
    '-0.00831677'
    '-0.0127225'
    '-0.0192631'
    '-0.0289014'
    '-0.110891'
    '-0.271967'
    '-0.515706'
    '-0.928407'
    '-1.36514'
    '-1.99691'
    '-2.62109'
    '-3.45311'
    '-4.30737'
    '-5.3008'
    '-6.39789'
    '-7.51737'
    '-8.86923'
    '-10.2136'
    '-11.7104'
    '-13.3232'
    '-14.928'
    '-16.7865'
    '-18.6739'
    '-20.015'

    'of'

  9. #9
    The unloaded file will read the first set of data you posted and put it in a 2 by n matrix. You'll need to adjust it for the next one. I think you can simply replace 'data' and 'history' with 'value' and 'output'.

    There's definitely better and more efficient ways to do this but it will work.

    Arthur
    Attached Files Attached Files

  10. #10
    Hi,creanea,
    thank you so much.
    My problem solved with the help from you.
    chen

Similar Threads

  1. extract data from abaqus .odb file
    By tomo in forum Finite Element Modeling
    Replies: 6
    Last Post: 2011-02-20, 10:48
  2. How to creat Berkovich indenter with Abaqus/CAE
    By lanfeng in forum Finite Element Modeling
    Replies: 6
    Last Post: 2010-05-05, 06:28
  3. Matlab Integration w Abaqus
    By IceBreaker in forum Computer Software
    Replies: 1
    Last Post: 2010-02-28, 19:41
  4. access odb file data in subroutine UEXTERNALDB (using c++ api)‏
    By lyk99424311 in forum Finite Element Modeling
    Replies: 0
    Last Post: 2010-02-25, 04:38
  5. Abaqus data to Fluent or Matlab
    By rockerbox in forum Computer Software
    Replies: 3
    Last Post: 2009-05-04, 14:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •