Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Importing the MATLAB , FORTRAN or other language script

Please login with a confirmed email address before reporting spam

Can it be possible to import FORTRAN script in initial values? Instead of sine wave as initial condition we want to use random initial wave condition. The random wave initial condition is in FORTRAN language script. Otherwise can we run it as MATLAB code and import it to initial value condition?


1 Reply Last Post 4 sept. 2018, 08:00 UTC−4
Mickaël Barsive COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 4 sept. 2018, 08:00 UTC−4
Updated: 6 years ago 4 sept. 2018, 08:01 UTC−4

Hello,

It seems possible using the "External" function feature in "Global definition">"Function">"External". Note that this feature works for C language but you could use wrapper function for example.
Blog article about external feature: https://www.comsol.fr/blogs/accessing-external-material-models-for-structural-mechanics

Also, you can use a MATLAB function in "Global definition">"Function">"MATLAB" (you need the LiveLink for MATLAB).

For more help, please contact COMSOL technical support.

Note that you can define random function in COMSOL Multiphysics "Definitions">"Function">"Random".

I hope this helps.

Regards,

Mickaël

Hello, It seems possible using the "External" function feature in "Global definition">"Function">"External". Note that this feature works for C language but you could use wrapper function for example. Blog article about external feature: https://www.comsol.fr/blogs/accessing-external-material-models-for-structural-mechanics Also, you can use a MATLAB function in "Global definition">"Function">"MATLAB" (you need the LiveLink for MATLAB). For more help, please contact COMSOL technical support. Note that you can define random function in COMSOL Multiphysics "Definitions">"Function">"Random". I hope this helps. Regards, Mickaël

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.