-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvehicle.sysml
58 lines (45 loc) · 1.41 KB
/
vehicle.sysml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package VehicleSystem {
import ScalarValues::*;
part def Vehicle {
// Attributes
attribute mass : Real;
attribute speed : Real;
attribute position : Real;
// Parts
part engine : Engine;
part transmission : Transmission;
part wheels : Wheel[4];
// Ports
port powerPort : PowerPort;
// Constraint
assert constraint acceleration {
acceleration = power/(mass*speed)
}
// Interface connections
interface enginePower connect engine.powerOut to transmission.powerIn;
interface wheelDrive connect transmission.powerOut to wheels.powerIn;
}
part def Engine {
attribute power : Real;
attribute rpm : Real;
attribute fuelConsumption : Real;
port powerOut : PowerPort;
port fuelIn : ~FuelPort; // Conjugated port
}
part def Transmission {
attribute gearRatio : Real;
attribute efficiency : Real;
port powerIn : ~PowerPort;
port powerOut : PowerPort[4];
}
part def Wheel {
attribute diameter : Real;
attribute friction : Real;
port powerIn : ~PowerPort;
}
port def PowerPort {
attribute torque : Real;
attribute speed : Real;
in item flow power;
}
}