Welcome to the TRNSYS Users Forum.

The forum is a place where people can interact and have discussions about different topics involving the use of the TRNSYS software package. Here you can post topics for discussion or questions on using TRNSYS and get advice from other users or TRNSYS experts. This forum is not intended for detailed technical support. Users should contact their distributor’s hotline for such assistance.

Some tips for success on using the forum:

  • Follow the Forum Rules posted in Forum Administration.
  • There are categories for different types of topics and questions. Post your topic or question into the proper category.
  • Before posting a topic or question search the existing topics  (and the TRNSYS Users listserv archive or Post archive) to see if a similar topic or question has already been answered.
  • Use a descriptive topic name. Don’t use attention getting subjects, they don’t get attention and only annoy people.
  • State the version of TRNSYS and which add-ons your are using.
  • Include enough specific details for your topic of question to be answered. Just posting “Why am I getting an error?” without describing the specific error and what you are trying to do when you get the error will not receive a response that fixes your issue.
  • Remember when people help you, they are doing you a favor. Be patient, help people out by posting good descriptions of what you need help with, and be polite even if a response does not solve your issue.
  • Moderators may edit your post for clarity or move your topic to a more appropriate category.

Notifications
Clear all

Floating point error in TRNSYS

2 Posts
1 Users
0 Reactions
1,310 Views
0
Topic starter

I got the following error in my TRNSYS simulation: Floating point division by zero. I attached a screenshot. What can I do about this error?

2 Answers
0
Topic starter

Floating point errors usually mean the code attempted to perform some invalid mathematical operation. In this case, the error tells you that the code tried to divide by zero at some point. This is a Fortran error message, not a TRNSYS error message, and it means there's a problem somewhere in the source code itself. The problem is best addressed by debugging the code through a Fortran compiler to identify the problem spot, then either fixing the problem or adding better error handling around it and recompiling the code. 

If you are using only standard Types and Types purchased from TRNSYS developers (such as the TESS libraries), you can send your project to your distributor for debugging. Indicate which version of TRNSYS you are running and which version of purchased Types (if any) are in your project. It also helps to send a simplified version of your project that still generates the error, and/or describe what you were building into your project just before the error (e.g. “My project runs fine with no connection between Type A and Type B, but as soon as I connect the flowrate from Type A to Type B, I get this error.”)

If you are using user-written components (or if you are feeling industrious), you can use a Fortran compiler within an integrated development environment (IDE) such as Microsoft Visual Studio to step through the code and find the source of the error yourself. Visual Studio does not come with the TRNSYS package, but it is free to download and is the IDE we use to compile and debug TRNSYS projects. This YouTube video walks through the debugging process, using a floating point error in a simple user-written component:  https://youtu.be/fZ5-zSC094Q

0
Topic starter

Instructions to download Microsoft Visual Studio IDE and Intel Fortran Compiler:

1. Visit https://visualstudio.microsoft.com/vs/older-downloads/ to download the latest version of Visual Studio Community
    a. Launch the installer; check the "Desktop Development with C++" box when prompted

2. Visit https://www.intel.com/content/www/us/en/developer/tools/oneapi/basetoolkit.html#gs.9wlzua to download the Intel oneAPI Base Toolkit
    a. Proceed with the default install
    b. In the Integrate IDE step, check the "Microsoft Visual Studio" box for the version of Studio you just downloaded

3. Visit https://www.intel.com/content/www/us/en/developer/tools/oneapi/fortrancompiler.html#gs.9wmcnq to download the Intel oneAPI HPC Toolkit
    a. Proceed with the default install
    b. In the Integrate IDE step, check the "Microsoft Visual Studio" box for the version of Studio you just downloaded
    c. NOTE: Intel Fortran Compiler has the option to be downloaded without the Intel oneAPI HPC Toolkit, but we have not verified that the TRNSYS type writing and debugging process runs with this setup.

4. Within File Explorer, navigate to TRNSYS18 > Compilers > TRNSYS; open TRNSYS.sln with Visual Studio
    a. Go to File > New > File… and ensure Intel(R) Fortran appears on the left-hand side under the Installed drop down

Share: