source: mso/sample/miscellaneous/sample_car.mso @ 13

Last change on this file since 13 was 13, checked in by Rafael de Pelegrini Soares, 16 years ago

Added more samples

File size: 2.0 KB
Line 
1#*---------------------------------------------------------------------
2* This file is property of the author and cannot be used, copyed
3* or modified without permission.
4*
5* Copyright (C) 2003-2005  the author
6*----------------------------------------------------------------------
7* Author: Rafael de Pelegrini Soares
8* $Id: sample_car.mso 6 2005-01-11 17:06:06Z paula $
9*----------------------------------------------------------------------
10*
11* The car axis problem
12*
13* The problem is a stiff DAE of index 3, consisting of 8
14* differential and 2 algebraic equations.
15*
16*--------------------------------------------------------------------*#
17 
18FlowSheet CarAxis
19
20        PARAMETERS
21        l as Real(Default=1);
22        l0 as Real(Default=1/2);
23        eps as Real(Default=1e-2);
24        M as Real(Default=10);
25        h as Real(Default=1/5);
26        tau as Real(Default=3.1514/5);
27        w as Real(Default=10);
28        r as Real(Default=0.1);
29
30
31        VARIABLES
32        xl as Real(Default = 0, Lower=-1, Upper = 1);
33        yl as Real(Default = 0.5, Lower=-1, Upper = 1);
34        xr as Real(Default = 1, Lower=-1, Upper = 1);
35        yr as Real(Default = 0.5, Lower=-1, Upper = 1);
36        q(4) as Real(Default = -1);
37        lambda(2) as Real(Default = 0);
38        xb as Real(Default = 1);
39        yb as Real(Default = 0);
40        ll as Real(Default = 0.5, Brief="Left spring length");
41        lr as Real(Default = 0.5, Brief="Right spring length");
42
43        EQUATIONS
44        diff([xl, yl, xr, yr]) = q;
45       
46        eps^2*M/2 * diff(q(1)) = (l0-ll)*xl/ll
47                +lambda(1)*xb +2*lambda(1)*(xl-xr);
48       
49        eps^2*M/2 * diff(q(2)) = (l0-ll)*yl/ll
50                +lambda(1)*yb +2*lambda(2)*(yr-yl) - eps^2*M/2;
51
52       
53        eps^2*M/2 * diff(q(3)) = (l0-lr)*(xr-xb)/lr
54                -2*lambda(2)*(xl-xr);
55       
56        eps^2*M/2 * diff(q(4)) = (l0-lr)*(yr-yb)/lr
57                -2*lambda(2)*(yl-yr) - eps^2*M/2;
58       
59        xl*xb + yl*yb = 0;
60       
61        (xl-xr)^2 + (yl-yr)^2 = l^2;
62       
63        xb = sqrt(l^2-yb^2);
64       
65        yb = r*sin(w*time);
66       
67        ll = sqrt(xl^2 + yl^2);
68       
69        lr = sqrt((xr-xb)^2 + (yr-yb)^2);
70
71        INITIAL
72        yl = 0.5;
73        xr = 1;
74        q(3) = -0.5;
75        q(4) = 0;
76       
77        OPTIONS
78        time = [0:0.01:3];
79        outputLevel = "high";
80        integration = "original";
81        DAESolver = "mebdf";
82
83        relativeAccuracy = 1e-5;
84        absoluteAccuracy = 1e-5;
85        indVarAccuracy = 1e-3;
86end
Note: See TracBrowser for help on using the repository browser.