Spaces:
Sleeping

File size: 3,117 Bytes
39e01c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
  "name": "CUMSUM",
  "description": "Cumulative sum of input signal over time",
  "category": "Math Operations",
  "blockType": "c",
  "tag": "BasicBlock",
  "interfaceFunctionName": "CUMSUM",
  "simulationFunctionName": "cumsum_m",
  "simulationFunctionType": "C_OR_FORTRAN",
  "dependsOnU": 1,
  "dependsOnT": 0,
  "geometry": {
    "x": 0.0,
    "y": -10.0,
    "width": 60.0,
    "height": 40.0
  },
  "style": "CUMSUM",
  "parameters": {
    "exprs": {
      "type": "ScilabString",
      "height": 2,
      "width": 1,
      "values": [
        "1",
        "0"
      ],
      "labels": [
        "direction",
        "reset"
      ],
      "descriptions": [
        "Cumsum direction: 0=row-wise, 1=column-wise",
        "Reset option: 0=no reset, 1=reset on event"
      ]
    },
    "realParameters": {
      "height": 0,
      "width": 0
    },
    "integerParameters": {
      "height": 0,
      "width": 0
    },
    "state": {
      "height": 0,
      "width": 0
    },
    "dState": {
      "height": 0,
      "width": 0
    },
    "nbZerosCrossing": {
      "value": 0
    },
    "nmode": {
      "value": 0
    }
  },
  "ports": {
    "explicitInputs": [
      {
        "ordering": 1,
        "dataType": "REAL_MATRIX",
        "dataColumns": -2,
        "dataLines": -1,
        "initialState": 0.0,
        "style": "ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0",
        "description": "Input signal (auto-dimension matrix)"
      }
    ],
    "explicitOutputs": [
      {
        "ordering": 1,
        "dataType": "REAL_MATRIX",
        "dataColumns": -2,
        "dataLines": -1,
        "initialState": 0.0,
        "style": "ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0",
        "description": "Cumulative sum output (same dimensions as input)"
      }
    ],
    "controls": [],
    "commands": []
  },
  "xmlExample": "<BasicBlock id=\"b1\" parent=\"0:2:0\" interfaceFunctionName=\"CUMSUM\" blockType=\"c\" dependsOnU=\"1\" dependsOnT=\"0\" simulationFunctionName=\"cumsum_m\" simulationFunctionType=\"C_OR_FORTRAN\" style=\"CUMSUM\">\n  <ScilabString as=\"exprs\" height=\"2\" width=\"1\">\n    <data line=\"0\" column=\"0\" value=\"1\"/>\n    <data line=\"1\" column=\"0\" value=\"0\"/>\n  </ScilabString>\n  <mxGeometry as=\"geometry\" x=\"300.0\" y=\"200.0\" width=\"60.0\" height=\"40.0\"/>\n</BasicBlock>",
  "anomalies": [
    "Width=60 (non-standard, wider than typical 40)",
    "dataColumns=-2 AND dataLines=-1 for automatic matrix dimensioning",
    "Empty realParameters and integerParameters",
    "Only 2 parameters - simplest block configuration"
  ],
  "criticalRules": [
    "dataColumns=-2 propagates input dimensions to output",
    "dataLines=-1 allows variable row count",
    "Cumsum direction 1=column-wise (tall matrices)",
    "Reset option for event-triggered accumulation reset"
  ],
  "commonUses": [
    "Signal integration approximation",
    "Running total calculation",
    "Cumulative statistics",
    "Position from velocity (discrete)"
  ],
  "relatedBlocks": ["INTEGRAL_m", "DERIV", "SUMMATION", "INTEGRAL_f"]
}