Hello Everyone

My background: Civil/Structural and Mechanical Engineering.
I work as a Structural Engineer designing bridges. I would like to develop a program that analyzes and design structures but do not know much about software development.
I have created a library of spreadsheets that are very powerful and when working together they can be as effective as some of the mid-size programs out there. Each spreadsheet has hundreds of columns and rows. Each cell contains a decent amount of coding: If, count, lookup, etc.. Excel stuff….
Some of my graduate teachers checked them and were very impressed, so they suggested contacting a software engineer. However, I want to do it myself mainly because I want to learn.
I would really appreciate any help.
For those of you who choose to help, please, keep in mind that I do not have any knowledge about programing. I can code in excel and a bit of c++ , but that is it.
I downloaded Visual Express (windows) because it is free, but even that was too much for me. The only thing I got accomplished was creating a status bar (searched it online!)
The main purpose of the program will be to d finite element linear and nonlinear, static and dynamic analysis of structural elements. Basically analyze and design structures (2d and 3d, starting with 2d).

The program should be able to generate mesh and perform numerical integration/ differentiation to determine geometry of element and properties such as moment of inertia, centroid, etc... (Using Automatic differentiation) For example, if the user wants to create an irregularly shaped column, he/she can just draw n the screen and the software is to generate the mesh and calculate the properties.

The design part:

Based on codes, classical analysis etc..., the program will design structures by checking various equations stored in libraries. There will aslo be a library containing commonly used shapes and materials so
that if , for instance, steel beams will be used on a simple bridge, the software will do the analysis based on the equations stored n the libraries and it can select the shape with the needed mechanical properties and so on.....

Analysis:
The program should be able to do matrix analysis. Matrix analysis is very common and effective. So the software should have matrix analysis capabilities. It should not only be able to analyze matrices, but generate them based on loads ,degrees of freedom of the strictures' support, etc...

Software should be able to generate graphs, schedules and reports.

Here's a list of some of the libraries that will be stored in the program:

Properties of materials
Commonly used shapes (Mainly steel W shapes, channels, angles etc..)
Design equations (LOTS!!!)
Mathematical functions and operations and transformations
History of some important structures
History (other)
Codes
And a few more

Which language would be more suitable? C++, C,...?

Do all language communicate with excel? Can I use the code used n my spreadsheets in c++ ?

Sam

Hello Everyone

My background: Civil/Structural and Mechanical Engineering.
I work as a Structural Engineer designing bridges. I would like to develop a program that analyzes and design structures but do not know much about software development.
I have created a library of spreadsheets that are very powerful and when working together they can be as effective as some of the mid-size programs out there. Each spreadsheet has hundreds of columns and rows. Each cell contains a decent amount of coding: If, count, lookup, etc.. Excel stuff….
Some of my graduate teachers checked them and were very impressed, so they suggested contacting a software engineer. However, I want to do it myself mainly because I want to learn.
I would really appreciate any help.
For those of you who choose to help, please, keep in mind that I do not have any knowledge about programing. I can code in excel and a bit of c++ , but that is it.
I downloaded Visual Express (windows) because it is free, but even that was too much for me. The only thing I got accomplished was creating a status bar (searched it online!)
The main purpose of the program will be to d finite element linear and nonlinear, static and dynamic analysis of structural elements. Basically analyze and design structures (2d and 3d, starting with 2d).

The program should be able to generate mesh and perform numerical integration/ differentiation to determine geometry of element and properties such as moment of inertia, centroid, etc... (Using Automatic differentiation) For example, if the user wants to create an irregularly shaped column, he/she can just draw n the screen and the software is to generate the mesh and calculate the properties.

The design part:

Based on codes, classical analysis etc..., the program will design structures by checking various equations stored in libraries. There will aslo be a library containing commonly used shapes and materials so
that if , for instance, steel beams will be used on a simple bridge, the software will do the analysis based on the equations stored n the libraries and it can select the shape with the needed mechanical properties and so on.....

Analysis:
The program should be able to do matrix analysis. Matrix analysis is very common and effective. So the software should have matrix analysis capabilities. It should not only be able to analyze matrices, but generate them based on loads ,degrees of freedom of the strictures' support, etc...

Software should be able to generate graphs, schedules and reports.

Here's a list of some of the libraries that will be stored in the program:

Properties of materials
Commonly used shapes (Mainly steel W shapes, channels, angles etc..)
Design equations (LOTS!!!)
Mathematical functions and operations and transformations
History of some important structures
History (other)
Codes
And a few more

Which language would be more suitable? C++, C,...?

Do all language communicate with excel? Can I use the code used n my spreadsheets in c++ ?

Sam

"generate mesh....[by] drawing on the screen"
-There are many softwares out there specifically designed for this task--and I would recommend using those. It can be done from scratch with graphics libraries such as OpenGL as well, but if you want the program to be very advanced, it will be very time-consuming. A basic mesh drawing program would first involve overlaying a 3-dimensional space with a visible cubic grid of points (you could define the precision or space between each point easily), and then using mouse or keyboard interface to select a point, and draw lines from point to point, all the while recording the polygons into a mesh.

"design structures... do analysis... select shapes...matrix analysis"
-If you can apply your equations and logic to a whole bunch of coordinates (from a mesh) then it's only a matter of coding the equations to work with your meshes.

This sounds very time consuming, just to warn you. Especially if you're learning everything from basically scratch.

Hello Muel12! I'm with Greywolf in that this is one big project you've chosen. My guess is you are looking at several years work.

I'm in a technical speciality field myself, that is, forestry. I write biometric applications. I use both C++ and PowerBASIC. I'd have to say that I would find PowerBASIC more suitable for the types of things you are interested in doing due to advanced support for multi-dimensional arrays of any order, i.e., 3, 4, etc. Also, there is very easy access to COM and Excel in particular. Naturally, since Excel uses VBA, it might be easier to directly utilize your existing code behind your cells in Excel.

However, C++ is good too. There is a more extensive user base and no doubt lots of library code you could use.

I wish you the best!

I also agree with the rest of the posters that this project is pretty huge, you are basically detailing the entire construction of a library for finite-element analysis (and related code).

C++ is certainly a suitable language, and you can probably fairly easily translate your excel code into C++ code if you use a library for efficient matrix algebra (for example, Eigen, uBlas, or MTL).

Have you considered reviewing the Code.Aster project. This is an open-source finite element software suite. If you have special methods to implement beyond the simple FEM algorithms (generating meshes and solving linear sparse systems), then I would suggest that you take a look at that project and see if you cannot just add your methods or codes to that library (the developers of Code.Aster would probably help you get started).

Hi guys
Thank you very much for the quick respond. I really appreciate your time. I know it seems that I am underestimating the difficulties of programming at this level or of programming at any level, but I am not. I do know it's complicated. What if I just start with something very very simple: A few menus, welcome window, window with a few tabs where you can input data, 2d, matrix analysis, etc...Like a beam designer. Believe it or not, there are programs out there that cost thousands of dollars and all they do is analyze beams. They don't even design it. Of course, there is a few that can do most things I previously mentioned, but I cannot compete with that just yet.
This may sound much simpler that what it actually is (A freaking beam!!!) so let me explain a bit (in case you are not familiar with it) I am sorry but I think I have to explain it to you so you can help me. I will also try to explain a possible way a software would analyze it and maybe you can point me in the right direction to design this small program first.
If you have a flexible beam that runs continuously over more than two supports you cannot use statics and basic structural analysis to determine stresses reaction etc... Even if you only have 2 supports, if one of them is what we called "fixed" (support can resist forces n all directions, no translation or rotation) you cannot rely on basic equations. Now, when you get something like 3, 4 supports, 5 etc...You need to use stiffness method (too many eq. so matrix analysis), moment distribution, or remove enough supports to calculate deflection using differential equations (force method), do the processes for each one of the redundant supports and then solve a bunch of equations simultaneously. Then, depending on which method you use, you may have to do more calc to get the actual deflection along the beam. For example, i did 9 supports by hand one time. I had to use 35 pages to get just the forces and maximum moments. So you can imagine how impractical this is if you are running a business. This is just symmetrical loading. If you add torsion then all hell breaks loose...Most software do not account for torsion. There reason for this is that here in the USA we typically use W shaped steel beams. Torsion calculations for circular, square, rectangular sections are very simple, but a w section is quite complicated. The set of equations for simply supported beam are longer than my previous post and this one combined and you have to solve high order derivatives and integrations. There are approximations, but if you want the most economical design it is better to get the exact forces. Most program do not account for temperature variation across the face of the element. They only calculate uniform temperature change which is quite simple. When an element is subject to a temperature difference across its depth (environment you cannot control), the thermal gradient will induce a moment on the element making it rotate and deflect. This can be significant sometimes. For movable loading, you have to develop influence lines.
The program:
Forget temperature and torsion for a minute. A simple programs would have several tabs, one for project information, another to indicate the beam information (basically a thick line) here you indicate how many spans and the type of support (fixed, pinned, etc…) another tab for the loading (you have to specify the coordinates, just the x and y cause 2d) and one to calculate and show results. You can also print simple reports. A way software would do that is to assign certain information (stiffness method) to thousands of points along the beam, generate a matrix for reactions, moments, shear and deflection for each point, read the information from the loading tab and then do the calculations. A simple program would NOT design the beam for you. Is this hard to code???????? I want to start with something like this but include the design.
My spreadsheets
I have created a matrix (with lots of dummies because you cannot alter an array in excel once created), my spreadsheet is set up for 10 support so if you only need 4 supports the dummies take care of this. I did everything a mentioned above by hand, even torsion and it’s been checked. I have hundreds of pages, so I basically coded them into excel. I also included the AISC and AASHTO equations so you can even tell the spreadsheet that you want the beam to meet specific geometry criteria and it designs it for you. It takes everything into account, does just over a hundred check (if all type of loading exist) and gets the lightest beam (heavier means more money) My spreadsheets are based on the force method. To include all type of loadings, I had to create dozens of tabs, so the files are quite big.

Thanks again.
How come I cannot give points to every replier?

>>Believe it or not, there are programs out there that cost thousands of dollars and all they do is analyze beams.

Yes I know, and I've used them (PATRAN/NASTRAN, ANSYS, etc.). But lately I've been using one that is free and fairly feature-rich (thermo-mech, dynamic, multi-physics, etc.). This tool is called Code-Aster (for FEA) and Salomé (for the GUI). This is an open-source project with many university research partners and some industrial partners. I highly recommend that you use that as a basis for your project.


>>so let me explain a bit (in case you are not familiar with it) I am sorry but I think I have to explain it to you so you can help me.

I am quite familiar with the type of software you are describing. I'm not an expert in it (my field is more about multi-body dynamics simulation) but I do have a very good idea of what it entails (and I have studied, written and used finite-elements software before).


>>A simple programs would have several tabs, one for project information, another to indicate the beam information (basically a thick line) here you indicate how many spans and the type of support (fixed, pinned, etc…) another tab for the loading (you have to specify the coordinates, just the x and y cause 2d) and one to calculate and show results.

What you are describing is a GUI (Graphical User Interface) for a FEA / structural analysis software. This is a pretty huge deal by itself. One design pattern for software development that is dominant is a method coined as MVC (Model-View-Controller). The point here is that you will not be able to write such a software without clearly separating the analysis code from the GUI code. And this is what all finite-element software packages do (like Patran as GUI and Nastran as analyzer, or Salomé as GUI and Code-Aster as analyzer). This is definitely something you have to consider doing if you want to go forward with this.


>>Is this hard to code????????

Yes and no. Writing code that is specific to a given case is very simple (for example, writing a piece of code to do FEA on a simple beam with multiple supports like you described can probably amount to just a few hundred lines of code, and I've done that before as part of a simple FEM course assignment). Similarly, taking the code that you have in your excel spreadsheets and translating that into a C/C++ program is probably going to be quite simple, as long as you use a linear algebra and numerical methods library (like those I recommended before, Eigen, MTL, or Boost.uBLAS).

Where things become very complicated is when you want to generalize the code you write. Imagine you want be able to run your code with different types of geometries (from simple 2D/3D primitive shapes to complex 3D models), different types of elements (beam elements, membrane elements, plate elements, etc.), different load sources (from different type of static load distributions to multi-physics loads like thermal loads or fluid-structure interaction loads), different boundary conditions, different variables to solve for (stress / strain, temperature distributions, etc.), and use different analysis methods (linear-static, quadratic, non-linear dynamic, etc.). In this case, beyond the problem of actually implementing each of these features, you also have the problem that you cannot write the software the same way you write case-specific software, you have to write generic software units (libraries). The idea is simple, obviously it is not reasonable (or scalable) to start writing a specific program for each combination (e.g. one software for a beam, with beam elements, 5 fixed supports, a distributed load, etc., and then another software for a slightly different case), so you need to write a software component for handling each individual customization, and then you need a standard way to put them all together (which we call "interfaces" or software abstractions). So, writing a case-specific software like you described is not hard, but it is not hard because it avoids the problem of figuring out how to compose together multiple generic software components (which is the really hard part), and such a case-specific software cannot be used as a basis for creating more general software later (or at least it will be very hard to do so, and not effective). And that's the problem you will face.

So, if your idea is just to create a case-specific software for a very specific problem that you have, then by all means do it, it certainly will be a thousand times better than an Excel-based thingy. But don't expect that case-specific software to be easily scalable to more general cases.

If your idea is to eventually get to a more general software, then it will be a huge task (most FEA software have between 1 and 2 million lines of code). In that case, I _highly_ recommend that you rely heavily on existing software, in this case, Code-Aster is a very good candidate.

Hi mike_2000_17

Thank you for the valuable information. I want to develop the software as a personal goal not because I need it. The company I works for has lots of them, some are as much as 5K per licenses. I understand what you said about creating a more general software in the future and thank you for pointing that out, but if were to create this small program (even if i can use it in the future for something more general) as a start, what do you recommend I do? Books to read, etc...? Now it would not really be a case-specific, it would be general for W shaped beams (same element and geometry [different dimensions though], linear analysis for most practical scenarios) which are very common. Accounting for different loading, boundaries etc... is not too bad by hand so I would imagine it’d be a matter of translating nto code. Do you mean that coding for a matrix generator as supposed to a fixed matrix is very complicated?

This article has been dead for over six months. Start a new discussion instead.