/[ascend]/trunk/base/generic/system/jacobian.h
ViewVC logotype

Contents of /trunk/base/generic/system/jacobian.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1347 - (show annotations) (download) (as text)
Tue Mar 13 06:40:06 2007 UTC (13 years, 2 months ago) by jpye
File MIME type: text/x-chdr
File size: 2359 byte(s)
Added routine for outputting system as a DOT graph.
Changed an 'assert' to an 'asc_assert' in logrelation.c.
Changed logical relation in sequence.a4c (was causing a crash).
Added Simulation::write(FILE,char*) for outputting *stuff* from a simulation.
1 /* ASCEND modelling environment
2 Copyright (C) 2007 Carnegie Mellon University
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18 *//** @file
19 General-purpose jacobian routines that should hopefully be shareable
20 but at this stage are only going to be used by IDA.
21 */
22 #ifndef ASC_SYS_JACOBIAN_H
23 #define ASC_SYS_JACOBIAN_H
24
25 #include "var.h"
26 #include "rel.h"
27
28 #include <linear/mtx.h>
29
30 extern const rel_filter_t system_rfilter_algeb;
31 extern const rel_filter_t system_rfilter_diff;
32 extern const rel_filter_t system_rfilter_all;
33
34 extern const var_filter_t system_vfilter_algeb;
35 extern const var_filter_t system_vfilter_diff;
36 extern const var_filter_t system_vfilter_deriv;
37 extern const var_filter_t system_vfilter_nonderiv;
38
39 /**
40 This mischevious data structure is a quick dodge to avoid having to
41 set some some big complicated slv_system_t structure for the purpose of
42 reporting back on a matrix slice. It seems that the better way to do
43 all this would be using a mtx_matrix_t with rol/col permutations mapping
44 back to the solvers_var/rel_list.
45
46 @DEPRECATED from day one, therefore. Only used by IDA at this stage.
47 */
48 struct SystemJacobianStruct{
49 mtx_matrix_t M;
50 struct rel_relation **rels;
51 struct var_variable **vars;
52 int n_rels, n_vars;
53 };
54
55 /**
56 Create a new matrix and put into it the the derivatives for the rels
57 and vars matching the filter. Return the list of rels and vars.
58
59 This routine uses relman_diff2 to calculate derivatives and
60 mtx_set_value to insert them into the matrix.
61
62 It's not in any way optimised for fast evaluation / mtx updates etc.
63 */
64 int system_jacobian(slv_system_t sys
65 , const rel_filter_t *rfilter, const var_filter_t *vfilter, const int safe
66 , struct SystemJacobianStruct *sysjac
67 );
68
69 #endif

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22