1 | #*--------------------------------------------------------------------- |
---|

2 | * This file is property of the author and cannot be used, copyed |
---|

3 | * or modified without permission. |
---|

4 | * |
---|

5 | * Copyright (C) 2002-2004 the author |
---|

6 | *---------------------------------------------------------------------- |
---|

7 | * Author: Rafael de Pelegrini Soares |
---|

8 | * $Id: sample_pend.mso 46 2006-11-07 16:47:55Z paula $ |
---|

9 | *---------------------------------------------------------------------- |
---|

10 | * |
---|

11 | * EMSO sample file. |
---|

12 | * |
---|

13 | * FlowSheet with the Model for the index three pendulum |
---|

14 | * in Cartesian coordinates. |
---|

15 | * |
---|

16 | *--------------------------------------------------------------------*# |
---|

17 | |
---|

18 | using "types.mso"; |
---|

19 | |
---|

20 | FlowSheet pend |
---|

21 | PARAMETERS |
---|

22 | g as acceleration (Brief = "Gravity acceleration"); |
---|

23 | L as length (Brief = "Pendulum cable length"); |
---|

24 | |
---|

25 | VARIABLES |
---|

26 | x as length_delta(Brief="Position x"); |
---|

27 | y as length_delta(Brief="Position y"); |
---|

28 | w as velocity(Brief = "Velocity for x"); |
---|

29 | z as velocity(Brief = "Velocity for y"); |
---|

30 | T as Real(Brief = "Tension on cable",Default=10,Unit="1/s^2"); |
---|

31 | |
---|

32 | EQUATIONS |
---|

33 | "Velocity on x" |
---|

34 | diff(x)=w; |
---|

35 | |
---|

36 | "Velocity on y" |
---|

37 | diff(y)=z; |
---|

38 | |
---|

39 | "Tension on x" |
---|

40 | diff(w)=T*x; |
---|

41 | |
---|

42 | "Tension on y" |
---|

43 | diff(z)=T*y-g; |
---|

44 | |
---|

45 | "Position Constraint" |
---|

46 | x^2+y^2=L^2; |
---|

47 | |
---|

48 | SET |
---|

49 | g = 9.8 * "m/s^2"; |
---|

50 | L = 1 * "m"; |
---|

51 | |
---|

52 | INITIAL |
---|

53 | "Initial Position x" |
---|

54 | x = -1 * "m"; |
---|

55 | |
---|

56 | "Initial x Velocity" |
---|

57 | w = 0 * "m/s"; |
---|

58 | |
---|

59 | #"Initial Position y" y = 0 * "m"; |
---|

60 | #"Initial y Velocity" z = 0 * "m/s"; |
---|

61 | |
---|

62 | OPTIONS |
---|

63 | |
---|

64 | time = [0:0.1:30]; |
---|

65 | integration = "original"; # original, index0 or index1 |
---|

66 | relativeAccuracy = 1e-8; |
---|

67 | absoluteAccuracy = 1e-9; |
---|

68 | indVarAccuracy = 1e-3; |
---|

69 | LASolver = "dense"; # dense or sparse |
---|

70 | DAESolver = "mebdf"; # mebdf, dasslc, dassl, or sundials |
---|

71 | end |
---|