Giter VIP home page Giter VIP logo

Comments (3)

amcc1996 avatar amcc1996 commented on June 2, 2024

I believe there is no designed feature to do that. The data structures do exist but are somewhat hidden from the user. You can access the list of segments and each segment contains the shear_force and bending_moment among others. For instance, in example 1:

import matplotlib.pyplot as plt

from symbeam import beam


test_beam = beam("l", x0=0)
test_beam.add_support(0, "roller")
test_beam.add_support("l", "pin")
test_beam.add_distributed_load(0, "l/2", "-2 * q / l * x")
test_beam.add_distributed_load("l/2", "l", "-q")
test_beam.solve()
fig, ax = test_beam.plot()

plt.savefig(__file__.split(".py")[0] + ".svg")

# Accessing the symbolic expressions of the shear force and bending moment
print(test_beam.segments[0].shear_force)
print(test_beam.segments[0].bending_moment)

# Evaluate in the target point, x0
x0 = 1.0
print(test_beam.segments[0].shear_force.subs({'x': x0}))
print(test_beam.segments[0].bending_moment.subs({'x': x0}))

In the future, one could add new functions, evaluate_shear_force(x) and evaluate_bending_moment to retrieve this information more easily.

from symbeam.

amcc1996 avatar amcc1996 commented on June 2, 2024

@Juulpy if this suffices for you at this moment, it will be fine for me. Otherwise, I can create a new release with the new feature.

from symbeam.

amcc1996 avatar amcc1996 commented on June 2, 2024

Since the code allows doing what has been initially proposed in the issue, and a possible solution has been demonstrated, I will consider this issue closed.

from symbeam.

Related Issues (10)

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.