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

Thread: Running Abaqus from Matlab script

  1. #1

    Running Abaqus from Matlab script

    I'm trying to run an abaqus model from within a matlab script in order to do a material parameter optimisation. My model has a user-defined material. I can run it outside of matlab with no problems. However, when running it within matlab, the user-subroutine fails to link:

    Begin Linking Single Precision Abaqus/Explicit User Subroutines
    2/25/2009 1:24:59 PM
    LINK : fatal error LNK1104: cannot open file 'LIBIFCOREMD.LIB'
    Abaqus Error: Problem during linking - Single Precision Abaqus/Explicit User Subroutines.
    This error may be due to a mismatch in the Abaqus user subroutine arguments.
    These arguments sometimes change from release to release, so user subroutines
    used with a previous version of Abaqus may need to be adjusted.
    Abaqus/Analysis exited with errors

    Suspecting something is up with the environment variables, I've tried running the IFortVars.bat within the matlab script prior to executing abaqus. The batch file runs ok but the subroutine still fails to link.

    Any help in this matter would be greatly appreciated.

    Regards,
    Cormac

  2. #2
    Join Date
    2000-02
    Location
    Boston, USA
    Posts
    3,280
    I suggest that you create a compiled shared library version of your user subroutine using, for example:

    abaqus make library=[fortran-file-name]

    That way you don't have to worry about environmental variables.

    -Jorgen
    Jorgen Bergstrom, Ph.D.
    PolymerFEM Administrator

  3. #3

    Running Abaqus from Matlab script

    Thanks Jorgen. Works a treat.

    Cormac

  4. #4

    Matlab <--> ABAQUS for optimization

    I want to link Matlab and ABAQUS for optimization, I want to creat input and output file for use in matlab az an optimizer.Could you help me.

  5. #5
    Join Date
    2000-02
    Location
    Boston, USA
    Posts
    3,280
    You can do that if you perform the post processing using the Abaqus python interface.

    -Jorgen
    Jorgen Bergstrom, Ph.D.
    PolymerFEM Administrator

  6. #6
    Hi Cormac

    I want to do exactly the same. I have linked Matlab with Abaqus and it works but I dont know which Optimization algorithm I must use. Because the function is unknown and I just have a couple of experimental points versus the FEM result points. I have heard that Genetic algorithm is suitable for such conditions but I really have no idea about it.
    How do you do that?

    Regards,
    Bio

  7. #7
    Join Date
    2000-02
    Location
    Boston, USA
    Posts
    3,280
    I have used both genetic algorihms and some of the standard minimization algorithms.
    I often use the Nelder-Mead Simplex algorithm since it is easy to use and robust.

    -Jorgen
    Jorgen Bergstrom, Ph.D.
    PolymerFEM Administrator

  8. #8
    I want to integrate matlab and abaqus to solve an optimization problem which needs a no. of iterations. I want to run this in batch mode. Has anyone tried similar thing before. Can anyone please give me some direction on this. I am new to both matlab and abaqus.

  9. % Running regular jobs from within Matlab
    % Note: These commands worked on a Windows Vista 64-bit PC.


    % Running simple INPs - one after the other (2 here) - in batch mode:


    clear all; clc;

    dos('cd "DIR1" & "DIR\temp1.bat" && "C:\WINDOWS\system32\cmd.exe" /k exit')

    dos('cd "DIR2" & "DIR\temp2.bat" && "C:\WINDOWS\system32\cmd.exe" /k exit')


    % ..

    % ..

    % DIR1, DIR2 .. are the locations of the directories in which your INPs, temp1.bat,
    % temp2.bat .. files respectively are placed


    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    % Running simple INPs - simultaneously - with command prompt enabled:

    clear all; clc;

    dos('cd "DIR1" & "DIR\temp1.bat" && "C:\WINDOWS\system32\cmd.exe" &')

    dos('cd "DIR2" & "DIR\temp2.bat" && "C:\WINDOWS\system32\cmd.exe" &')


    % ..

    % ..

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    % Running an INP with a subroutine:

    clear all; clc;

    dos('cd "DIR1" && "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" & "C:\Program Files (x86)\Intel\Compiler\11.0\061\fortran\Bin\intel64\ ifortvars_intel64.bat" & "DIR\temp.bat" && "C:\WINDOWS\system32\cmd.exe" /k exit')

    dos('cd "DIR2" && "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" & "C:\Program Files (x86)\Intel\Compiler\11.0\061\fortran\Bin\intel64\ ifortvars_intel64.bat" & "DIR2\temp.bat" && "C:\WINDOWS\system32\cmd.exe" /k exit')


    % ..

    % ..

    % Locations of vcvars??.bat and ifortvar?????.bat will depend on your own configuration

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Contents of temp.bat:
    {
    abaqus job=JOBNAME user=SUBROUTINE.for interactive
    }
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  10. send email from matlab to gmail

    Source: http://www.mathworks.com/support/sol...data/1-3PRRDV/

    PHP Code:
    Define these variables appropriately:
    mail 'an.example.email.address@gmail.com'; %Your GMail email address
    password 
    'testing1234'; %Your GMail password

    Then this code will set up the preferences properly:
    setpref('Internet','E_mail',mail);
    setpref('Internet','SMTP_Server','smtp.gmail.com');
    setpref('Internet','SMTP_Username',mail);
    setpref('Internet','SMTP_Password',password);
    props java.lang.System.getProperties;
    props.setProperty('mail.smtp.auth','true');
    props.setProperty('mail.smtp.socketFactory.class''javax.net.ssl.SSLSocketFactory');
    props.setProperty('mail.smtp.socketFactory.port','465');

    Send the emailNote that the first input is the address you are sending the email to
    sendmail
    ('an.example.email.address@gmail.com','Test from MATLAB','Hello! This is a test from MATLAB!'

Similar Threads

  1. problem with ABAQUS Python script
    By bulkup in forum Finite Element Modeling
    Replies: 2
    Last Post: 2010-11-03, 03:21
  2. Question about ABAQUS function (Python Script)
    By RenanOzelo in forum Finite Element Modeling
    Replies: 7
    Last Post: 2009-05-20, 19:49
  3. Abaqus data to Fluent or Matlab
    By rockerbox in forum Computer Software
    Replies: 3
    Last Post: 2009-05-04, 14:49
  4. Replies: 7
    Last Post: 2008-09-23, 01:08
  5. Python script for emailing ABAQUS status
    By Jorgen in forum PolymerFEM News
    Replies: 0
    Last Post: 2007-12-29, 13:33

Tags for this Thread

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
  •