Why am I only getting 4/24 points on my Truss analysis with Matlab?

Click For Summary
SUMMARY

The discussion focuses on a user's struggle with a Truss analysis problem in MATLAB, specifically receiving only 4 out of 24 points on an autograder. The user employs a custom sign convention in their code, which includes a matrix A and a vector b, but still encounters issues with the output values. Feedback from the autograder indicates that while the output size is correct, the values are incorrect, suggesting potential errors in the input parameters or calculations.

PREREQUISITES
  • Understanding of MATLAB programming and syntax
  • Familiarity with truss analysis concepts and mechanics
  • Knowledge of matrix operations in MATLAB
  • Experience with autograder systems and interpreting feedback
NEXT STEPS
  • Review MATLAB matrix manipulation techniques
  • Learn about truss analysis and load distribution methods
  • Investigate common pitfalls in MATLAB autograder submissions
  • Explore debugging techniques for MATLAB code to identify calculation errors
USEFUL FOR

Students and engineers working on structural analysis, MATLAB users seeking to improve their coding skills, and anyone involved in truss design and analysis.

gfd43tg
Gold Member
Messages
949
Reaction score
48
Hello, I have been working on this Truss problem and have not managed to get it right. I have checked my equations over and over and everything seems to check out, but I only get 4/24 on the autograder.

Here is my paper worked out.

ImageUploadedByPhysics Forums1405563826.908265.jpg


Here is my Code. Because I don't like the opposite sign convention from the problem statement, I just used the normal sign convention and multiplied by -1, -(A\b). Whether I keep it -(A\b) or A\b, I still get 4/24 points.
Code:
function T = trussAnalyze(Px,Pz)
A = [cosd(180),cosd(30),0,cosd(270),cosd(atand(3/4)+180),0; 
    0, cosd(210),cosd(240),0,0,0;
    0,0,cosd(60),cosd(90),0,cosd(180);
    sind(180),sind(30),0,sind(atand(3/4)+180),sind(270),0;
    0,sind(210),sind(240),0,0,0;
    0,0,sind(60),sind(90),0,sind(180)];
b =[0;Px;0;0;Pz;0];
T = -(A\b);

I run the autograder and here is an example of the feedback I get
Code:
In test case 2:
    'Pure downward loading'

*Right size and class, but wrong values (even accounting for roundoff)
Argument 1:
     0

Argument 2:
   100
EDIT: Wrote it on a paper and uploaded as PDF so that my work is easier to see.
 

Attachments

Last edited:
Physics news on Phys.org
my -0.6 and 1 were switched
 

Similar threads

Replies
4
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
3
Views
2K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
5
Views
14K