In January 1999, when OpenSees was known as G3, Prof. Fenves created G2 for teaching nonlinear structural analysis in CE 221 at UC Berkeley. G2 was written in MATLAB with an architecture similar to G3.

I took CE 221 and used G2 for the homework assignments, but after a few years I lost the code. Oh well, these things happened in the days before cloud-based storage.

I wrote G2 off as G3’s long lost sibling, reminiscent of the 1988 film Twins starring Arnold Schwarzenegger and Danny DeVito as twins separated at birth after a genetic experiment yielded unexpected results.

Fast forward to October 2019. One of my good graduate school friends invited me to give a seminar at his university. After the seminar, we got to talking about OpenSees, then the conversation turned to CE 221 and G2. I asked my friend if he kept the G2 source code and he said “Yes, it’s right here on my laptop.” After wiping away my amazement at his archiving skills, I offered up a memory stick and he dragged and dropped.

After I returned home, I took a trip down memory lane. G2 includes linear-elastic, small displacement truss and beam-column elements and there are a couple of material nonlinear truss elements. The material nonlinear beam-column elements include the two-component model and displacement-based and force-based distributed plasticity formulations. Fiber-discretized cross-sections are implemented for wide-flange shapes with bilinear stress-strain response. There is also a geometrically nonlinear elastic truss element.

Newton-Raphson and Modified Newton are the available solution algorithms. These can be used with a variable step load-control static integrator. It’s MATLAB, so the solver is the ‘slash’ operator–no need for options there.

Considering G2 was written for MATLAB v5.0, I was a little surprised it ran so smoothly on MATLAB v9.5 (R2018b). The only hiccup was adding the G2 directory to the MATLAB path.

To ensure I don’t lose the G2 code again, I created a repository on GitHub after securing the appropriate permissions. You can read more about the element formulations and solution strategies in the source files. Clone it, fork it, give it a try–it may be useful for your research. I’ll accept pull requests if you would like to share examples or contribute new functionality.

The title of this post is taken from the tagline of Twins. Here is the scene where the twins see each other for the first time since birth.

I have been involved in the development, maintenance, and growth of OpenSees since its early days. I am interested in learning Python and improving my academic writing.
View all posts by Michael H. Scott

Published

7 thoughts on “Only Their Mother Can Tell Them Apart”

Hello,
I had thought the meaning of the twins is that not only the two persons are similar in the face (face look-alike) but also either of two children born to the same mother on the same occasion.
MATLAB software is costly. It is good that you have developed OpenSees, and it’s not software based on MATLAB. Most students can not afford to buy.

Hello MSB,
Yes, OpenSees and G2 are like fraternal twins, but it’s probably more accurate to say they are siblings born in different years. Poetic license!
Good point on MATLAB. I tried running G2 through Octave today and there were some issues. I’ll see if I can fix those.

Do you think G2 has a potential to be developed to the level of OpenSees now? Will Matlab allow us that modularity? Because now they have the JIT compiler, the compilation speed also increased. More over we have a lot of solution algorithms developed all over the world – can we take to the level of OpenSees ? What difficulties you see we would confront ?

Dear sir,
Can we develop G2 to the level of OpenSees with all it’s comprehensive models – we will have the advantage of Matlab’s JIT compiler and OOP features, pre and post processing… We can even create a GUI also? What problems do you foresee in a Matlab implementation? Now I think Matlab is fast enough with all it’s optimized built in functions ? Can we try ? What’s your opinion ?

Hello Ashok,
I’m not familiar with the newer features of Matlab’s compilers. It would not be worth re-developing in G2 all the models from OpenSees. I would recommend using the OpenSees Python module instead.
Michael

Hello,

I had thought the meaning of the twins is that not only the two persons are similar in the face (face look-alike) but also either of two children born to the same mother on the same occasion.

MATLAB software is costly. It is good that you have developed OpenSees, and it’s not software based on MATLAB. Most students can not afford to buy.

LikeLike

Hello MSB,

Yes, OpenSees and G2 are like fraternal twins, but it’s probably more accurate to say they are siblings born in different years. Poetic license!

Good point on MATLAB. I tried running G2 through Octave today and there were some issues. I’ll see if I can fix those.

LikeLike

Do you think G2 has a potential to be developed to the level of OpenSees now? Will Matlab allow us that modularity? Because now they have the JIT compiler, the compilation speed also increased. More over we have a lot of solution algorithms developed all over the world – can we take to the level of OpenSees ? What difficulties you see we would confront ?

LikeLike

Dear sir,

Can we develop G2 to the level of OpenSees with all it’s comprehensive models – we will have the advantage of Matlab’s JIT compiler and OOP features, pre and post processing… We can even create a GUI also? What problems do you foresee in a Matlab implementation? Now I think Matlab is fast enough with all it’s optimized built in functions ? Can we try ? What’s your opinion ?

LikeLike

Hello Ashok,

I’m not familiar with the newer features of Matlab’s compilers. It would not be worth re-developing in G2 all the models from OpenSees. I would recommend using the OpenSees Python module instead.

Michael

LikeLike

Yeah, I was just taking your opinion… We should not reinvent the wheel.

Thank you.

LikeLike