Thibaut,I think you need to use the storage structures (getStorageVars() and setStorageVars()). I am not sure that I have completely understood what you are trying to do but I think that what you want to do is store 2 values in the global storage structure. One of those values is the final calculated temperature of the last time step and the other one is the calculated temperature of the last iteration. Each time you enter the Type on an iterative call, you can call getStorageVars() and base your calculations on the final temperature of the previous time step. At the end of your calculations during an iterative call, you call setStorageVars() and update ONLY the calculated value of the last (just completed) iteration. Then, after convergence has been reached, you call getStorageVars(), retrieve the value that you calculated at the end of the last iteration and replace the value of the final calculated temperature at the end of the time step. Then call setStorageVars() again. Again, I may be misinterpreting what you are trying to do but hopefully the above is close enough that you can figure out how to make getStorageVars() and setStogageVars() to work appropriately for your situation.
Kind regards, David
Dear Trnsys users,I am modelling a setpoint that is drifting inside a dwelling (17-23°C for instance). So I use an iterative feedback controller, with upper and lower setpoints, which minimize abs(Qheat)+abs(Qcool). It works very weel.Now I am writing a type, that controls (+/-1°C per week for instance) that temperature 's drift. But to get the iterative feedback controller working, I must not limit its output during the iterations, otherwise the results are not consistent. So I thought I couls let the outputs inchanged in the iterative calls (info(13)=0) and change them in the post convergence call.e.g. /Perform any after iteration.../ if(info(13)>0 Tout=Tin+.../ Limitation de la vitesse de dérive/ endif /this is an iterative call.../ if(info(13)=0 Tout=Tin endif out(1)=ToutObviously, this isn't working, I get the input temperature as an output at every call, without any modification at the post-convergence call. Is it possible? Am I getting something wrong?Thanks in advance for your help Thibaut Vitte _______________________________________________ TRNSYS-users mailing list TRNSYS-users@cae.wisc.edu https://www-old.cae.wisc.edu/mailman/listinfo/trnsys-users
-- ***********************************************************************Thermal Energy System Specialists (TESS), LLC David BRADLEY 22 N. Carroll Street - Suite 370 Partner Madison, WI 53703 USA P: +1.608.274.2577 F: +1.608.278.1475 E-mail: bradley@tess-inc.com Web Pages: http://www.tess-inc.com and http://www.trnsys.com
***********************************************************************