summaryrefslogtreecommitdiff
path: root/truss_solver.m
diff options
context:
space:
mode:
Diffstat (limited to 'truss_solver.m')
-rwxr-xr-xtruss_solver.m13
1 files changed, 10 insertions, 3 deletions
diff --git a/truss_solver.m b/truss_solver.m
index 4a7a1aa..50086f3 100755
--- a/truss_solver.m
+++ b/truss_solver.m
@@ -8,6 +8,13 @@ forces(abs(forces) < 0.00001) = 0;
[j, m] = size(C);
Ln = L(L~=0);
+
+D = memberDistances(C, X, Y);
+
+cost = computeTrussCost(C,D);
+weakest = weakestMember(D,forces);
+ml = maxLoad(forces,L,D,weakest);
+
for i = 1:length(Ln)
fprintf('Load: %.3f N\n', abs(Ln(i)));
@@ -21,7 +28,7 @@ for i = 1:length(forces)-m
fprintf('r%d: %.3f\n', i, forces(m+i));
end
-cost = computeTrussCost(C, X, Y);
fprintf('Cost of truss: $%d\n', round(cost));
-
-fprintf('Theoretical max load/cost ratio in N/$: %.4f\n', abs(sum(L))/cost); \ No newline at end of file
+fprintf('Theoretical max load is %.4f\n', ml);
+fprintf('Theoretical max load/cost ratio in N/$: %.4f\n', ml/cost);
+fprintf('First member to break is member %d\n', weakest); \ No newline at end of file