fiber section stress-strain output through recorder command
Moderators: silvia, selimgunay, Moderators
fiber section stress-strain output through recorder command
Hello, I am a new learner of OpenSees and have started learning it through its Python version. My question is about generating stress-strain outputs for a specific fiber or for a specific location in a given section. I am currently working through the example of 14.2.8, which is available in https://openseespydoc.readthedocs.io/en ... anti2.html . I have added 2 lines of element recorder command to the original code generating stress-strain outputs. I obtained different results at different combination of these two lines of commands. Below I give the commands I tried in generating stress-strain outputs with my own interpretations and the questions I kindly ask you to help me understand. Any help is appreciated.
1) op.recorder('Element', '-file', 'Data-2c/FiberSec1SS.out','-time','-closeOnWrite', '-ele', 1, 'section', '1', 'fiber', '5','stressStrain')
Does this command generate stress-strain values at fiber 5 in section 1? When I take the 5 out of quotes, i.e. (...‘fiber’, 5, stressStrain), it produces different results. What does the command generate when I write it by putting 5 in quotes and with non-quotes? Also, I am wondering what is the ordering of fiber numbers in a patched section? Is it possible to obtain the fiber number that corresponds to a given coordinate pairs in local axis?
2) op.recorder('Element', '-file', 'Data-2c/FiberSec1SS.out','-time','-closeOnWrite', '-ele', 1, 'section', '1', 'fiber', '5','15','stressStrain')
Here I am trying to get stress-strain values for a specific location (5 units in y and 15 units in z). Again, when I remove the quotes from these two coordinate entries, I get different results. I am wondering functioning difference between coding as … 'fiber', '5','15','stressStrain' and as….'fiber', 5,15,'stressStrain'.
1) op.recorder('Element', '-file', 'Data-2c/FiberSec1SS.out','-time','-closeOnWrite', '-ele', 1, 'section', '1', 'fiber', '5','stressStrain')
Does this command generate stress-strain values at fiber 5 in section 1? When I take the 5 out of quotes, i.e. (...‘fiber’, 5, stressStrain), it produces different results. What does the command generate when I write it by putting 5 in quotes and with non-quotes? Also, I am wondering what is the ordering of fiber numbers in a patched section? Is it possible to obtain the fiber number that corresponds to a given coordinate pairs in local axis?
2) op.recorder('Element', '-file', 'Data-2c/FiberSec1SS.out','-time','-closeOnWrite', '-ele', 1, 'section', '1', 'fiber', '5','15','stressStrain')
Here I am trying to get stress-strain values for a specific location (5 units in y and 15 units in z). Again, when I remove the quotes from these two coordinate entries, I get different results. I am wondering functioning difference between coding as … 'fiber', '5','15','stressStrain' and as….'fiber', 5,15,'stressStrain'.
-
- Posts: 4
- Joined: Sat Sep 16, 2017 4:23 pm
- Location: university of auckland
Re: fiber section stress-strain output through recorder command
Hello,
I am not sure about the recorder command (I do not use recorders anymore) but if you are using OpenSeesPy then I would recommend using eleResponse command and not recorders. As recorders take a lot of time to run your analysis(open file -> save data->close file each time it saves data in a loop, it can consume a lot of time if your analysis or structure is big).
The below line of code and approach can give you the stress-strain of a section within an element for a given y and z coordinates within the fiber section (this is the way I plot my stress-strains). If you are not sure which Z and Y (out of 4 quadrants) you max or min fiber is in then write 4 command lines (with (+z,+y), (+z, -y), etc.) and take max or min among them (depending on tension or compression). You can do the same for stresses and strains (4 lines for stresses and 4 lines for strain in that case) for the required length of column i.e. you can try to run a loop where you can run these eleResponse command lines for a given range of length, save the data in a list or dictionary at each section and then use it for plotting stress-strain curves at each section or choose the maximum value of the range if you want to find the maximum strain or stress location, you can do it for every timestep or displacement increment (depending on your analysis).
section_strain = eleResponse(Elementtag, "-section", "based on number of integration points", "-fiber", "y cordinate in section", "z cordinate in section", "material tag", "stressStrain")
I hope this helps you to plot your stress-strain curves now.
Pavan Chigullapally.
I am not sure about the recorder command (I do not use recorders anymore) but if you are using OpenSeesPy then I would recommend using eleResponse command and not recorders. As recorders take a lot of time to run your analysis(open file -> save data->close file each time it saves data in a loop, it can consume a lot of time if your analysis or structure is big).
The below line of code and approach can give you the stress-strain of a section within an element for a given y and z coordinates within the fiber section (this is the way I plot my stress-strains). If you are not sure which Z and Y (out of 4 quadrants) you max or min fiber is in then write 4 command lines (with (+z,+y), (+z, -y), etc.) and take max or min among them (depending on tension or compression). You can do the same for stresses and strains (4 lines for stresses and 4 lines for strain in that case) for the required length of column i.e. you can try to run a loop where you can run these eleResponse command lines for a given range of length, save the data in a list or dictionary at each section and then use it for plotting stress-strain curves at each section or choose the maximum value of the range if you want to find the maximum strain or stress location, you can do it for every timestep or displacement increment (depending on your analysis).
section_strain = eleResponse(Elementtag, "-section", "based on number of integration points", "-fiber", "y cordinate in section", "z cordinate in section", "material tag", "stressStrain")
I hope this helps you to plot your stress-strain curves now.
Pavan Chigullapally.
Re: fiber section stress-strain output through recorder command
Thank you Pavan, your answer has been very helpful.
Re: fiber section stress-strain output through recorder command
The quotes are a bit of a problem with recorders because they were designed for Tcl where everything is a string and the internal implementation of setResponse reflects this. With the conversion of commands to Python there's a problem if you don't pass everything in as strings, i.e., surrounded by ' '.
So, when you pass in 5, the recorder is not finding any fibers and is using the first fiber in the list. When you pass in '5', the recorder is finding the fiber you want. That's why you're getting different results.
This is something we need to fix, but there's not an easy solution.
So, when you pass in 5, the recorder is not finding any fibers and is using the first fiber in the list. When you pass in '5', the recorder is finding the fiber you want. That's why you're getting different results.
This is something we need to fix, but there's not an easy solution.
Re: fiber section stress-strain output through recorder command
Micheal, that is incredibly useful to know about the fibre sections!
I spent my entire masters degree thinking it was not possible to recorder individual fibers in OpenSees.
I'm wondering what the scope is for string arguments?
For example, it seems like for the node recorder, using ints in python works okay. Is it just element commands that are getting tripped up?
For anyone:
My assumption always was that the overhead from recorders in OpenSeesPy was less than the overhead from using Python output commands.
Pavan, it seems like your experience was opposite to this.
I'm curious, has anyone stress tested a model using both methods?
I spent my entire masters degree thinking it was not possible to recorder individual fibers in OpenSees.
I'm wondering what the scope is for string arguments?
For example, it seems like for the node recorder, using ints in python works okay. Is it just element commands that are getting tripped up?
For anyone:
My assumption always was that the overhead from recorders in OpenSeesPy was less than the overhead from using Python output commands.
Pavan, it seems like your experience was opposite to this.
I'm curious, has anyone stress tested a model using both methods?
Re: fiber section stress-strain output through recorder command
I think the recorders have less overhead than the output commands, but I haven't quantified it.
Re: fiber section stress-strain output through recorder command
A better workaround is to cast the numeric values as strings in Python. It is only a problem for numeric values that come after 'section', 'material',or 'fiber'. Not a problem with node recorders as you pointed out.
ops.recorder('Element','-ele',1,'section',str(5),...)
ops.recorder('Element','-ele',1,'section',str(5),...)
Re: fiber section stress-strain output through recorder command
Hi,
I am trying to record 'stressStrain' using the commands mentioned on this post but my output file just shows the time column.
I also tried to record the 'globalForce' for same element and it works perfectly fine.
Could someone please help me identifying the mistake.
I am trying to record 'stressStrain' using the commands mentioned on this post but my output file just shows the time column.
Code: Select all
op.recorder('Element', '-file', 'stress2.txt','-time', '-ele', 201, '-section', '201', '-fiber', '4','4','3001','stressStrain')
I also tried to record the 'globalForce' for same element and it works perfectly fine.
Code: Select all
op.recorder('Element', '-file', "ele_force_H.txt",'-time', '-ele', 201, 'globalForce')
Re: fiber section stress-strain output through recorder command
This will be fixed in the next version of OpenSeesPy. For now, use str() like described here: https://wp.me/pbejzW-Si
Re: fiber section stress-strain output through recorder command
Thank you, it works perfect!