cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

3d truss plot need help

marcelofsilva
4-Participant

3d truss plot need help

Hello everyone,

 

I need your help converting or perhaps coding a new routine to plot a 3D truss.

 

Yesterday after the help of some of you guys, I was able to get my hands on a solution for a similar problem here in this forum but solution was done in PRIME.

I tried the whole day yesterday to convert the code to the old V15 mathcad without success. So now I am asking y'all for help once again.

 

Thanks!

 

6 REPLIES 6

There were some errors in your attempt to convert my routine to real Mathcad.

The data structure necessary to plot a number of points in Mathcads 3D plot is nested vector. A 3 x 1 vector whose elements are n x 1 vectors consisting of the x, y and z coordinates of the points to be plotted.

A possible conversion would be this

B1.PNG

But unfortunately the result will not work in Mathcads 3D plot component because good old Mathcad has a severe limitation here. The 3D plot does not accepts NaN's and throws an error. I had uses NaN two separate line segments. Its one of the very few advantages of Prime that its 3D plot accepts NaN's the same way as Mathcads 2D plot does. Otherwise Primes plotting capabilities are mediocre up to useless.

You could omit those NaN's but now ALL points will be connected. The end of a line segment will be connected to the start of the next one. usually this will mean quite a lot of unwanted line segments being plotted.

At the time I can't think of a solution other than arranging the input data in such a way that the end of a segment is the start of the next one - maybe by drawing some segments multiple times. I guess this will not be possible in every case. Here is a routine which omits the NaN's and you can see the additional line segments if you compare with the Prime version.

B2.PNG

Thanks Werner.

 

much appreciated for the alternative solution and your explanation regarding your coding.

yes, I started to realize that the main issue was not really the coding but the limitation of old mathcad. it certainly became a bit more obvious after reading the help and to realize that NaN was only acceptable in 2D plots 😞

 

Though, here is my take on your solution.

 

Instead of using the NaN, I replace it with a coordinate located at "INFINITY". This forces the unwanted lines to go to infinity and back to start the next line. Further if we change the plotting limit to the magnitude of your real X,Y,Z values. The unwanted lines will be shown cut-off thus making the 3D truss plot to look a bit more like the real thing.

3d truss.png

Additionally we can use the artifice of OPTICAL ILLUSION by rotating the plot so that the unwanted lines are along our line of sight, thus making the unwanted lines looks as a POINT.

This can be achieved ether by either change the ANGLE (variable "ang") to match the plot rotation, keeping the angle constant and rotating the plot or a combination of both.

 

3d truss angle.png

 

Cheers!

 

 

Use the NaN inbuilt varibale. I have managed to plot complex 3D wireframe in MathCAD perfectly successfully icluding meshes in a mannr one would expect with terminaiton of lines.

Hi,

The most valuable lesson to learn here is how best to spend your time.

 

"I tried the whole day yesterday to convert the code to the old V15 mathcad without success".

 

In academia what you are doing is necessary to learn how modern software suites do their work.

 

In engineering practice this is a waste of time as most engineering offices would use a ready made software package to do this like SAP, STAAD_Pro, SpaceGASS, Microstran, ANSYS, Strand (Strauss) 7,.. etc.  These provide not only the ability to plot the structure but also plot the results on the plot as force diagrams or deflection contours.  It is not a good idea to spend the client's money on re-inventing the wheel.

 

Whole analysis to design main members only takes one hour plus the rest of the day for the detailing of the joints and foundations.  There is usually a number of discrete load cases to examine, not just one.  The enclosed graphic took about 15 minutes to make.

 

The lesson to learn is when is it appropriate to use MathCad to solve a problem or do something in an engineering office.  It is a wonderful program.   For instance getting Mathcad to write input files to the engineering suites based on parameters to do a multi run parametric study is powerful.

Thank you and no thank you!

 

The truss I used was merrily an example from previous post. Also, I was just trying to put some "dramatic" emphasis to the issue and oh boy ... that works like a charm .. didn't it?

 

BTW very nice skills using strand7. it has been awhile I have used.

 

Anyways, just to give you some insight on what I am trying to do. It is exactly what those software listed are not capable of doing it. I literally need customization because am designing multiples foundation/drilled shaft cap using "strut and tie model" which as you might know, the truss model changes based on the load condition, hence the need to create my own customizable program.

 

The 3D graphic, which was the main reason I posted the question, it is a very important peace in the puzzle in trying to determine (visualize) the "ideal" strut and tie model. As we all know "A picture is worth a thousand words"

 

Thanks to others for their helpful contributions. I am finally pleased with the results.

 

Regards


@terryhendicott wrote:

Hi,

The most valuable lesson to learn here is how best to spend your time.

 

"I tried the whole day yesterday to convert the code to the old V15 mathcad without success".

 

In academia what you are doing is necessary to learn how modern software suites do their work.

 

In engineering practice this is a waste of time as most engineering offices would use a ready made software package to do this like SAP, STAAD_Pro, SpaceGASS, Microstran, ANSYS, Strand (Strauss) 7,.. etc.  These provide not only the ability to plot the structure but also plot the results on the plot as force diagrams or deflection contours.  It is not a good idea to spend the client's money on re-inventing the wheel.

 

Whole analysis to design main members only takes one hour plus the rest of the day for the detailing of the joints and foundations.  There is usually a number of discrete load cases to examine, not just one.  The enclosed graphic took about 15 minutes to make.

 

The lesson to learn is when is it appropriate to use MathCad to solve a problem or do something in an engineering office.  It is a wonderful program.   For instance getting Mathcad to write input files to the engineering suites based on parameters to do a multi run parametric study is powerful.


Biggest impact with Mathcad is use of units and being able to process and docuemnt masses of data form these analysis programs. Ability to plot in 3d results in mathcad for the data is also extremly powerful and has taken me a long time to develop fucntions to do this. I woudl argue visualizing the model in teh calcualtion mathcad dcocument is very valuable 

Top Tags