Giter Site home page Giter Site logo

Comments (16)

nithinvl avatar nithinvl commented on June 18, 2024 1

Hi

I found the problem. In the command,
plot '<paste "Dynamic_python/node(2)_disp.txt" "Dynamic_tcl/node(2)_disp.txt"' u 1:($2-$6) w l
when difference between values of column 2 and column 6 is calculated (paste command combines multiple files, so here, the two data files are combined to get 4+4=8 columns), values in same row is considered for the calculation of a single difference. But the time column in the nodal displacement output file of OpenSees Tcl and OpenSeesPy are different. Upto some time, they are same. This is the reason when the displacement results are plotted with respect to time, they were looking same. But when they are plotted with respect to row number of data, difference can be seen (You can zoom into the figure below to see the difference after some time).
disp_row_data

I then calculated displacements for constant timestep of 0.02s from 0.02s to 134.96 for both the results by interpolation in matlab (to make the time column of both the results to be same). Then I calculated the difference between the interpolated data of both the results. The difference is very small (shown below).

disp_diff_1

from openseespydoc.

u-anurag avatar u-anurag commented on June 18, 2024

The difference may be because you are using wine to run opensees.exe on Linux machine. I ran your model.tcl script on my Linux machine using a compiled opensees (without using wine) and got the same period as your Python script. I haven't tried the cyclic analysis. I don't know why it happens with wine. I hope it helps.
tcl_linux

from openseespydoc.

nithinvl avatar nithinvl commented on June 18, 2024

It is not because of wine. My results from running in windows and linux are exactly matching (not only time period, but also pushover curve and other recorder outputs) for tcl version. So the matching problem is between tcl version and python version.

from openseespydoc.

zhuminjie avatar zhuminjie commented on June 18, 2024

You should wipeAnalysis before changing some analysis options. Just add wipeAnalysis() and redefine all analysis options.

I try to run the cyclic analysis, it failed many times and try different algorithms. I am not sure what is running. But when you want to compare tcl and python results, better use simple analysis, like the push over analysis. In your screenshots, it shows the test failed to converge. I wonder how results are obtained.

The point is you always can compare tcl and python results. But the test domain should be well defined. For a complex example, there are too many factors and variables to cause the differences.

from openseespydoc.

nithinvl avatar nithinvl commented on June 18, 2024

My doubt is, isn't openseespy developed from the same base source codes as that of opensees tcl ? If yes, then why does the results from both the opensees differ for the same model whether it is simple or complex ? Shouldn't both produce exact results ?
Here I am modelling a simple cantilever and I have used every commands exactly same in both the scripts. I have ensured this by first creating the model in tcl and making a copy of this file and then converting each commands into their python counterpart. Both the codes are exactly same in the inputs to opensees, but differing in their coding syntax only.

from openseespydoc.

zhuminjie avatar zhuminjie commented on June 18, 2024

Yes, they are based on the same source codes. The only differences are from the inputs. Tcl and Python are different in handling numbers and internal storage. Tcl always saves everything in string format and convert back and forth between strings and numbers, but Python has different value types. It's not surprise that there is slight difference for inputs.

Your model is simple, but the analysis process is very complicated. It has many failures and tries different algorithms. The analysis may just diverge at some point, when one analysis slightly larger than the tolerance, and another lower than it. Than the two analyses go to different analysis paths.

from openseespydoc.

nithinvl avatar nithinvl commented on June 18, 2024

You have mentioned the analysis process is very complicated. Are you referring to my script using different algorithms for analysis or are you saying in general for any type of nonlinear analyses in OpenSees ?

If the source codes are same for both the OpenSees, shouldn't the path of analyses for both the cases be exactly same ? If not, why they are taking different paths for analyses ?

from openseespydoc.

zhuminjie avatar zhuminjie commented on June 18, 2024

Yes,

and yes,
and that is what I mentioned, there is slight differences between tcl and python due to the way they handle numbers internally. If you are interested, you can track both analyses to see at what point the analyses diverge. Please send me what you find if you have chance to do so. Thank you!

from openseespydoc.

nithinvl avatar nithinvl commented on June 18, 2024

Hi
I was doing dynamic analysis of this model using a ground motion record in OpenSeesPy and OpenSees Tcl. The difference is significant. I am attaching figures of displacement time-history from both OpenSees and the ground motion input.
motion
disp_hist
disp_diff

from openseespydoc.

zhuminjie avatar zhuminjie commented on June 18, 2024

OK, is that from the same model. Can you please attach the script with plotting?

In the second figure, are they displacements for Tcl and Python. They look no difference. Where is the difference in 3rd comes from? Thank you!

from openseespydoc.

nithinvl avatar nithinvl commented on June 18, 2024

Hi
Yes they are from same model.

You can plot the results in gnuplot to see the difference :
plot '<paste "Dynamic_python/node(2)_disp.txt" "Dynamic_tcl/node(2)_disp.txt"' u 1:($2-$6) w l

I am attaching tcl and python scripts of model files :
dynamic.zip

from openseespydoc.

zhuminjie avatar zhuminjie commented on June 18, 2024

image

image

image

Above are the results I ran from your scripts.

1st figure: There are a lot "UniaxialMaterial::setTrial() - material failed in setTrialStraine()", and "CTestNormUnbalance::test() - failed to converge but going on". I kinda hesitate to compare tcl and python results with an analysis having a lot failures.

2nd figure: the command in gnuplot. Honestly, I know nothing about gnuplot. Maybe matplotlib in python is better.

3rd figure: the plot generated from gnuplot. I can't see the difference and am not sure if the plot is correct.

Sorry, I really want to find the problem in this analysis, but it looks a little difficult for me to go on. Maybe a cleaner script and plot? Let me know.

from openseespydoc.

zhuminjie avatar zhuminjie commented on June 18, 2024

Thank you for your updates! That sounds a good progress.

from openseespydoc.

mhscott avatar mhscott commented on June 18, 2024

from openseespydoc.

mhscott avatar mhscott commented on June 18, 2024

from openseespydoc.

mhscott avatar mhscott commented on June 18, 2024

Please post further modeling issues to the OpenSees message board.

from openseespydoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.