<html>
<body>
At 10:52 AM 1/26/2006, Jocelyn.Pacquelet@UTBM.fr wrote:<br><br>
<blockquote type=cite class=cite cite="">Also we'd like to know if
anybody has already try to solve a differential<br>
equation with the function called Differential_EQN() (manual programmer's
guide<br>
8.4.4.3) as the example provided in the manual is not very
clear.</blockquote><br>
"Could you please send me an example of differential equation of the
same type as<br>
: dT/dt=(hs/m*cp)*(T-T2). Where hs,m,cp are constant."<br><br>
Actually the formulation would be: dT/dt=(hs/m*cp)*(T2-T); and that's the
version I coded (m Cp dT/dt = Qin - Qout)<br><br>
As promised a week or so ago, here is a simple TRNSYS 16 source code
file, input file, and output results demonstrating the use of the
Differental_eqn subroutine. Let me know if you have any
questions.<br><br>
<img src="cid:.0" width=794 height=490 alt="Emacs!"><br><br>
INPUT FILE:<br><br>
<font face="Courier New, Courier">VERSION 16<br><br>
CONSTANTS 3<br>
START=0<br>
STOP=168<br>
STEP=1<br><br>
SIMULATION START STOP
STEP<x-tab> </x-tab>! Start
time<x-tab> </x-tab>End
time<x-tab> </x-tab>Time
step<br>
TOLERANCES 0.001
0.001<x-tab> </x-tab><x-tab>
</x-tab>!
Integration<x-tab> </x-tab> Convergence<br>
LIMITS 100 1000
100<x-tab> </x-tab><x-tab>
</x-tab>! Max
iterations<x-tab> </x-tab>
Max warnings<x-tab> </x-tab>Trace limit<br>
DFQ
1<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>! TRNSYS
numerical integration solver method<br>
WIDTH
80<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>! TRNSYS output
file width, number of characters<br>
LIST
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>! NOLIST
statement<br>
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab><br>
SOLVER 0 1
1<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab>! Solver
statement<x-tab> </x-tab>Minimum
relaxation
factor<x-tab> </x-tab>Maximum
relaxation factor<br>
NAN_CHECK
0<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab>! Nan DEBUG
statement<br>
OVERWRITE_CHECK
0<x-tab> </x-tab><x-tab>
</x-tab>! Overwrite DEBUG
statement<br>
EQSOLVER
0<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>! EQUATION SOLVER
statement<br><br>
EQUATIONS 1<br>
T_2=30+30*SIN(TIME*3)<br><br>
UNIT 1 TYPE 998 Sample DiffEq<br>
PARAMETERS 4<br>
*Mass Hs Cp Ti<br>
100.0 15.0 4.19 10.0<br>
INPUTS 1<br>
T_2<br>
30.<br><br>
UNIT 65 TYPE 65<br>
PARAMETERS 12<br>
2 1 -20 80 -1000 1000 1 7
1 0 -1 -1<br>
INPUTS 3<br>
T_2 1,1 1,2<br>
T_2 T_average Q_out<br><br>
END<br><br>
<br>
</font>
______________________________________________________________________________________________<br>
<br>
Source code file attached.<br><br>
Jeff<br><br>
<br>
<x-sigsep><p></x-sigsep>
*********************************************************************************<br>
Thermal Energy System Specialists (TESS)<br>
Jeff
Thornton<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>2916 Marketplace
Drive<br>
Principal<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>Suite 104<br>
Phone: (608)
274-2577<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab>Madison WI
53719<br>
Fax: (608)
278-1475<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>USA<br>
E-mail: thornton@tess-inc.com
<x-tab> </x-tab><x-tab>
</x-tab><br>
Web
Page:<x-tab> </x-tab>
<a href="http://www.tess-inc.com/" eudora="autourl">www.tess-inc.com<br>
<br>
</a>"Providing software solutions for today's energy engineering
projects"<br>
*********************************************************************************<br>
</body>
</html>