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

[TRNSYS-users] DTDT and T arrays in C++



Dear TRNSYS users,

I am creating a new Type using C++ where I need to solve several
differential equations numerically. For this I plan to use the DTDT and T
arrays managed by the TRNSYS solver. I would like to write dtdt[n] =
F(t[n]) for equation n,  where F is a non-linear function and t[n] is
automatically retrieved from the previous TRNSYS iteration. This should be
possible in FORTRAN. In C++, however, dtdt and t are declared as double&,
which means that I can store only one differential and corresponding
integration result at a time. Does this mean that in order to solve more
than one equation, I will have to integrate them one at a time, copy the
result from t into another variable, save the results manually (by using
setStorageVars) and retrieve them in the next iteration using
getStorageVars? This is of course a posibility, but I would like to know if
anyone has a better solution to the problem.

Kind regards,
Knut Erik



----------------------------------------------------------------------------------------------------------------------
NIVAs hovedkontor har flyttet til nye lokaler i CIENS - Forskningssenter
for miljø og samfunn; Gaustadalléen 21, 0349 Oslo. Meld deg på vårt
nyhetsbrev på www.niva.no