cslotboom / planesections

A lightweight FEM beam bending library.
Apache License 2.0
78 stars 10 forks source link

Some queries #6

Open AlexGriffiths526 opened 1 year ago

AlexGriffiths526 commented 1 year ago

Hello, Firstly I really like your library. The simplicity of doing simple hand calculations is perfect. I am relatively new to python so I apologise if the queries are simple.

  1. Is it possible to output key (peak) values from the bending moment/shear force diagrams as numerical values? I have read through the documentation but could not see an option of extracting, for example, the peak. It may also be good to have these as a label on the plot outputs.
  2. I noticed in the documentation there is a parameter 'scale' I presumed this was to change the size of the plot but on testing different values I can't seem to change the size of the output plot. Can you clarify what the scale parameter is used for and how one would change the size of the plot output?
cslotboom commented 1 year ago

Hey Alex! Thanks for your comment, glad it's been useful. Yes you can - you can use Mmax and Vmax to return the values. See example below. Agreed about the labels, it would be great to have local peak information on the plot. I'll see what I can do there.

The scale parameter is used to scale the "y" values of the plot - basically the vertical scale. I may need to document this better. Right now the best way to change the size of the plot would be to modify the matplotlib fig/ax returned by the plot functions. See below. I will think about if there is a 'cleaner' way of doing this, perhaps by passing in kwargs to the plot functions..

beam = ps.EulerBeam()
beam.addVerticalLoad(0, -5)
analysis = ps.OpenSeesAnalyzer2D(beam)
analysis.runAnalysis()

#max Moment/Shear values
beam.Mmax
beam.Vmax

# different size plots
fig, ax, _ = ps.plotMoment(beam, scale = -1/kN, yunit = 'kNm')
fig.set_size_inches(8.5, 5.5)
cslotboom commented 7 months ago

@AlexGriffiths526 I believe this is closed, but let me know if this solution worked for you or is still ongoing.

akkypat commented 1 month ago

Hello! I am writing a calculator for solving problems in mechanics. I want to compare your values with mine. I can't find the information in the documentation information. 1)Can you tell me how to display the values on the graph and how to output the y values for the values of some x ? 2) Is it possible to shade the area under the graph? An example is attached. 3) How to plot the result of the reactions of the supports Ra and Rb Example1

cslotboom commented 1 month ago

Hey @akkypat

I'm going to move this conversation to the discussion page to keep things more focused here!