[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TRNSYS-users] Invalid floating point operation: strange behaviour



Matteo,

 

To find this kind of problem, the only way is to use the debugger: In the CVF project of your type, make sure you have

\Trnsys16\Exe\TrnEXE.exe

under Project/Settings/Debug/Executable for debug session.

 

Make sure you’re in debug mode (Build/Set active configuration->Debug). If your TRNDll is in release mode (which is the default, make sure your dll is generated to

\Trnsys16\UserDlls\ReleaseDlls (instead of DebugDlls, which is the default). I.e., under Project/settings/Link/Output file name

you should have something like \Trnsys16\UserDlls\ReleaseDlls\MyType.dll)

 

Now hit F5. TRNSYS will start and ask you for the deck file. When it crashes, the line with the problem is displayed, and you can inspect each variable.

(Look at m_acqua*Cp_sonde in your case, if it really stops at this line).

 

Hope this helps,

 

Werner

 

De : Matteo DF [mailto:deframat@gmail.com]
Envoyé : lundi 8 février 2
010 19:05
À : trnsys-users@cae.wisc.edu
Objet : [TRNSYS-users] Invalid floating point operation: strange behaviour

 

Hi everybody,
I'm having some problems with a type I'm developing... I'm using Compaq Visual Fortran 6.6.c.

Here's the problem, I have these simple line of code, some variable's names are in italian but there's no problem I hope...

T_sonde=(T_rit+Q_h*(1-1/COP)/(m_acqua*Cp_sonde))*(fattore_carico)+T_rit*(1-fattore_carico)

The problem is that if I pass the right value to m_acqua (which is a flowrate) I get an "Invalid floating point operation" error. The correct value for m_acqua si 1500 kg/h which I converted in kg/s, 0.416667. If I pass this value I get the error, if i raise to 5-10 kg/s there's no error. If I raise only to 2-3 kg/s the simulation lasts longer but eventually gives an error...

Where can the problem be?

Many thanks,
Matteo.

--
La scoperta è vedere ciò che tutti hanno sempre visto e
pensare ciò che nessuno ha mai pensato.
(Albert Szent-Gyorgyi, scopritore della vitamina C e premio Nobel)