Run
every
ms
Original truss, highlight applied forces
58
59
Deflected truss - Reddish is tension, blueish is compression
60
61
62
63
64
65
Fixed points
66
67
68
Stiffness matrix parameters for each member
69
70
71
"spring constant" for each member
72
73
displacement to force transform
74
75
76
77
Conjugate gradient solver
78
https://en.wikipedia.org/wiki/Conjugate_gradient_method Implemented using a counter. To make it fast on Desmos, do stuff in as few "clock cycles" as possible (1 in this case).
79
80
81
82
83
Initialization
84
85
86
87
Stiffness-vector product
88
89
90
91
92
Iteration step
93
94
95
96
97
Looping and stopping criteria
98
99
100
101
102
103
104
[DON'T OPEN] Variables for conjugate gradient
105
109
Get node deflection and member forces
110
deflection - zero at fixed nodes, solver result at free nodes
111
112
member force: projection of deflection on unit direction, normalized by member length
113
114
115
Helper functions
116
linear time prefix sum by @fad
117
118
119
120
powered by
powered by
New Blank Graph
Examples