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

Re: [TRNSYS-users] numerical solution in new type with C++



Iris,
I am no expert in writing C++ components (in fact I have never tried it). My guess, however, is that you will need to modify the TRNSYS.h file to make sure that the setNumericalDerivative() and getNumericalSolution() functions are actually defined in there.
Kind regards,
 David


On 8/27/2014 07:52, Iris Reichenbach wrote:
Dear fellow TRNSYS users,
I have the following problem. I'm trying to write a new type for TRNSYS in C++, which involves the numerical solution of differential equations. Usually, SetNumericalDerivative is used to set the numerical derivatives and then GetNumericalSolution is used to obtain the solution of the differential equation. However, when trying to compile my code the compiler gives the following error: "error C3861: "getNumericalSolution": Bezeichner wurde nicht gefunden." That is, it can't find the identifier getNumericalSolution. I also tried to instead use the older form and write dtdt[i] = x, instead of SetNumericalDerivative(i,x), but here I got the error message "error C2109: Index erfordert ein Array oder einen Zeigertyp" (that is index requires an array or a pointer). I use the project CPP-Mvs2003, which is included in TRNSYS/Compilers, so it has access to TRNSYS.h and TRNDll.lib, and I also successfully used my setup to generate another custom type, albeit without any numerical solution. So my question is: how can I solve numerical equations with a type written in C++? How do I set the derivatives and how do I access the solutions? Do GetNumericalSolution/SetNumericalDerivative not work with C++ (I didn't find them in TRNSYS.h) and if so, what do I use instead?
Thanks in advance for any pointers!
Cheers,
Iris
_______________________________________________
TRNSYS-users mailing list
TRNSYS-users@lists.onebuilding.org
http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org


--
***************************
David BRADLEY
Principal
Thermal Energy Systems Specialists, LLC
22 North Carroll Street - suite 370
Madison, WI  53703 USA

P:+1.608.274.2577
F:+1.608.278.1475
d.bradley@tess-inc.com

http://www.tess-inc.com
http://www.trnsys.com