Jump to content

Recommended Posts

Hi,

 

I have written a tire subroutine in FORTRAN, the subroutine having the "Tire Subroutine Arguments" as described in the user guide, and according to 'STI - Standard Tire Interface'.

There is no mention in the user guide how to interface this subroutine from the model file (how to insert all the required inputs, how to inform motionview that this is a tire subroutine with 'Standard Tire Interface', etc..).

A simple model + fortran subroutine as an example would be greatly appreciated!

 

Thank you,

hdrz

Share this post


Link to post
Share on other sites
Guest

HI,

 

To use your own subroutines in MotionSolve, follow these steps:

1.Create a Python, MATLAB, C/C++ or FORTRAN source file that contains the user defined modeling entity.

2.Obtain a Dynamic-Link Library (DLL) or Shared Object (SO) by compiling and linking your user subroutine(s) – only for C/C++ or FORTRAN source code.  No compiling is required for Python or MATLAB source code.  Python routines are automatically compiled, and you can use compiled Python files with MotionSolve without the source files.

3.Modify the corresponding entity in your multi-body model to be "user defined" and to point to your DLL/SO or script file.

4.Run MotionSolve, verifying that it picks up the appropriate DLL/SO or script file during simulation.

 

  To build a Fortran user subroutine using Visual Fortran:
1. Double-click ms_fsubdll.vfproj in <install-path>\hwsolvers\motionsolve\usersub\f_project.

Note: Based on your installation of Microsoft Visual Studio, the project may be converted to a compatible version automatically.

This contains a list of all FORTRAN subroutines that can be called by MotionSolve.  You may remove any from the project that are not needed.  To remove subroutines, simply right-click on one or more subroutines and click Remove.

solution_explorer_remove

2. Edit the FORTRAN subroutine(s).
3. From the Build menu, select Build.

Your subroutine(s) will be compiled and built as ms_fsubdll.dll and placed in the folder
<install-path>\hwsolvers\motionsolve\usersub\f_project\x64\Release

or

<install-path>\hwsolvers\motionsolve\usersub\f_project\x64\Debug

depending on the build settings.

Share this post


Link to post
Share on other sites

Hello Prakash,

 

Thank you for the fast reply and the info. I am aware of all that and my subroutine compiles without any problems.

My question is very specific:  A tire subroutine has a special interface (it is not a simple GFOSUB call) which is dictated by the 'STI - Standard Tire Interface'. How do I tell motionsolve/motionview that this is a tire subroutine and not a simple user defined force (GFOSUB) ?

There is nothing in the user guide or the tutorials that explains how to do this.

 

Thank you,

hdrz

Share this post


Link to post
Share on other sites
Guest

To use a user tyre model first create a model with autoTires. Select a tire file which should have following block:

               [MODEL]

              PROPERTY_FILE_FORMAT    = 'USER'

              FUNCTION_NAME           = '<dll name>::<tire subroutine name>'

On the basis of the above two attributes the autoTire will automatically switch on the control state variables as they are necessary for STI interface. The solver will look for the FUNCTION_NAME and load the dll and tire function dynamically and give a call to tire subroutine at every time step.

 

If you do not want use autoTire then create a model with TNO tyre and just replace the TNO tyre file with your own tyre file.

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...