Parent Directory | Revision Log

Revision **534** -
(**show annotations**)
(**download**)
(**as text**)

*Tue Apr 25 13:25:04 2006 UTC*
(16 years, 3 months ago)
by *johnpye*

File MIME type: text/x-ascend

File size: 1951 byte(s)

File MIME type: text/x-ascend

File size: 1951 byte(s)

Working on platform-independent pathnames for the IMPORT command. Added 'ospath.c' to base/generic/general for this purpose. Patched kvalues and sensitivity to use the 'IMPORT "libname";' syntax instead of 'IMPORT registerfn FROM libname;'. Fixed pathnames in create.nsi. Added GPL header to coupla files. Added quoting to 'IMPORT' syntax in ascParse.y. Removed 'PackageOption' from Tcl/Tk related Scons options so that missing Tcl/Tk doesn't cause breakage.

1 | (*********************************************************************\ |

2 | sensitivity_test.asc |

3 | by Ben Allan |

4 | Part of the Ascend Library |

5 | |

6 | This file is part of the Ascend modeling library. |

7 | |

8 | Copyright (C) 1996 |

9 | |

10 | The Ascend modeling library is free software; you can redistribute |

11 | it and/or modify it under the terms of the GNU General Public License as |

12 | published by the Free Software Foundation; either version 2 of the |

13 | License, or (at your option) any later version. |

14 | |

15 | The Ascend Language Interpreter is distributed in hope that it will be |

16 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |

17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |

18 | General Public License for more details. |

19 | |

20 | You should have received a copy of the GNU General Public License along with |

21 | the program; if not, write to the Free Software Foundation, Inc., 675 |

22 | Mass Ave, Cambridge, MA 02139 USA. Check the file named COPYING. |

23 | |

24 | This module is used to calculate the sensitity matrix dX/dU where |

25 | X is a vector OF vapor compositions and U is a vector OF liquid |

26 | compositions. This sensitivity matrix is THEN used to calculate |

27 | J, the Jacobian, as described IN Fidkowski et al. (1995). |

28 | |

29 | \*********************************************************************) |

30 | |

31 | REQUIRE "system.a4l"; |

32 | |

33 | IMPORT "sensitivity"; |

34 | |

35 | MODEL sensitivity_test; |

36 | nc IS_A integer_constant; |

37 | X[1..nc] IS_A solver_var; |

38 | U[1..nc], Unew[1..nc] IS_A solver_var; |

39 | dx_du[1..nc][1..nc] IS_A solver_var; |

40 | (* system *) |

41 | k,x,y,u IS_A solver_var; |

42 | k*x - y = 7; |

43 | y = u^2; |

44 | (* dx/du = 2*u/k *) |

45 | nc:==1; |

46 | u,U[1] ARE_THE_SAME; |

47 | x,X[1] ARE_THE_SAME; |

48 | |

49 | METHODS |

50 | |

51 | METHOD values; |

52 | END values; |

53 | |

54 | METHOD clear; |

55 | END clear; |

56 | |

57 | METHOD specify; |

58 | FIX u, k; |

59 | END specify; |

60 | |

61 | METHOD reset; |

62 | RUN clear; |

63 | RUN specify; |

64 | END reset; |

65 | |

66 | METHOD analyze; |

67 | EXTERNAL do_sensitivity(SELF,U[1..nc],X[1..nc],dx_du[1..nc][1..nc]); |

68 | END analyze; |

69 | |

70 | END sensitivity_test; |

john.pye@anu.edu.au | ViewVC Help |

Powered by ViewVC 1.1.22 |