# This file is part of the Ascend modeling library to # demonstrate _tests.asc and is released under the GNU # Public License as noted at the beginning of simple_pot.asc. # $Id: simple_pot.s,v 1.10 97/09/22 19:52:53 ballan Exp $ # Load the tcl functions for creating time sample # schedules. The user can create new ones if # uniform (set_int) or lagrange sampling (set_lagrangeint) # is not sufficient. # source $env(ASCENDDIST)/models/set_intervals.tcl # # source /users/eceng/kchittur/ascend/ascendiv-0.8/ascend4/models/set_intervals.tcl DELETE TYPES READ FILE ivpsystem.a4l; READ FILE simple_pot.a4c; COMPILE demo OF boiling_pot; RUN {demo.defaults}; #in the next release, this runs automagically BROWSE demo; RUN {demo.set_ode_id}; RUN {demo.set_obs}; RUN {demo.values}; RUN {demo.specify}; SOLVE {demo.pot} WITH QRSlv; # define a sampling schedule at 1 second # intervals from 0 to 100 sec. set_int 101 1 {s}; # reset time to 0 ASSIGN {demo.x} 0 {s}; INTEGRATE {demo} WITH BLSODE; # plotting the results: #Now, open the ascplot Tool #load y.dat, #select that data set (double click its name), #select all 3 vars (drag) #move right to plot list with the >> button, #hit execute.viewplot #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv # More details on integration and # plotting are available at # http://www.cs.cmu.edu/~ascend in # the documentation for IVPs and ASCPLOT #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #Now get fancy: ASSIGN {demo.x} 0 {s}; RUN {demo.values}; SOLVE demo; INTEGRATE {demo} FROM 0 to 50 WITH BLSODE; ASSIGN {demo.pot.vap_prod.Ftot} 100 {mole/s}; INTEGRATE {demo} FROM 50 TO 100 WITH BLSODE; # At this point we'd like to plot both sets of data # on one graph, but you have to fiddle with the # General Options on the solver to keep the # integrator from overwriting the data log files. # Basically, our plotting ability is too primitive to cope, # but we export really nice data files for other program # to import and plot.