Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm trying to create a structures analysis program based on the stiffness method. The program should analyse frames. All the program should be included in the manipulate function. What I want at first to be able to draw the structure using graphics. The problem is the user has to specify some variables in order to draw the figure(spans and floors number) which will be the variables in the manipulate. How can I do this? Since the number of objects to draw is varying how can creat one single function to do this job. I'll will explain it again. If the user chooses one span and one floor the function should draw two vertical lines with one horizontal between them. If he chooses 2 spans 2 floors he should see 3 vertical lines with 2 lines horizontally spaning between them midway and 2 horizontal lines at the top. Thank you.

share|improve this question

closed as unclear what you're asking by Yves Klett, Öskå, m_goldberg, RunnyKine, Mark McClure Aug 3 '14 at 18:24

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

An image is better than a 10 lines, and on here a code would help as well. So please try something, share it, and illustrate your problem without verbose. –  Öskå Aug 3 '14 at 9:48
No horizontal line at the top if only 1 floor/span? –  Michael E2 Aug 3 '14 at 15:57

1 Answer 1

Here's something that does what is indicated at the end of the question, except that it draws a line at the top when n is 1.

$maxFloor = 5;
       Line[{{{0, 1}, {n, 1}}, {{0, 1/2}, {n, 1/2}}}],
       Line[Table[{{x, 0}, {x, 1}}, {x, 0, n}]],
       Point[Table[{x, 1}, {x, 0, n}]],
       Point[Table[{x, 1/2}, {x, 0, n}]]
      PlotRange -> {{0, $maxFloor}, {0, 1}}, PlotRangePadding -> 0.1],
     {{n, 1, "floors/spans"}, 1, $maxFloor, 1}
share|improve this answer
Thank you very much. Wasn't exactly what I asked for but you made me realise how I should do it. –  Mr. Pi Aug 3 '14 at 20:25
@moe Good! That's more or less what I was hoping for. –  Michael E2 Aug 4 '14 at 1:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.