dashdotrobot / bike-wheel-calc Goto Github PK
View Code? Open in Web Editor NEWStress analysis of bicycle wheels implemented in Python using NumPy
License: MIT License
Stress analysis of bicycle wheels implemented in Python using NumPy
License: MIT License
The original curved-beam FEM code used a different coordinate system:
The thesis uses the following:
Update BicycleWheel, ModeMatrix, and BicycleWheelFEM to match the standards developed in my PhD thesis.
Spoke and Rim should have a density property. BicycleWheel should be able to calculate its mass and rotational inertia.
Instead of hunting for singular matrix configurations near T_c_theor, the buckling tension should be obtained from the generalized eigenvalue problem:
K_rim_matl + K_spk_matl + T_bar*(K_spk_matl - K_rim_matl) = 0
This should be considerably more robust than iteratively tuning T_bar until the condition number is maximized.
A mutable literal (in this case, the empty dictionary {}) causes problems when used as the default argument. An object is created the first time the function is called, and then the same object is referenced thereafter.
Instead, use sec_params=None
in the argument list and
if sec_params is None:
self.sec_params = {}
else:
self.sec_params = sec_params
There are some examples in the thesis code where tension must be removed, and then re-applied. Functions which depend on tension (such as spoke stiffness or rim stiffness) should include a binary flag, tension=[True|False], and if tension=True the function should use the Spoke.tension property. Tension should always be "applied" to the wheel using BicycleWheel.apply_tension().
Catch illegal values (like zero radius, negative stiffness, or hub offset outside the flange widths) and throw appropriate exceptions.
Dear Matthew,
I got your code to run properly and find the results interesting.
In your example "example_stand_on_spokes.py"
What is the reasoning to add forces to node 1 and 35.
Wouldn't it be closer to "real world" to just put the force on node 0?
FYI, I'm interested in this is because I cannot find any quality reasoning for the spoke count in commercial available bicycle wheels and the information supplied by wheel builders. Wheel builders on their websites have this dropdown box to select front/rear wheel spoke count. Why choose 20/24, 24/28 or 28/32? If you are a heavier rider, put more spokes. Seems logical, but how much exactly? These are the kind of questions I like to find an answer to. Besides that, bicycle wheels are an amazingly complex mechanical structure. It's intriguing :-)
Regards
Bart
bike-wheel-calc/bikewheelcalc/theory.py
Line 108 in 6fc380c
Section properties need to be scaled by a factor of Rs/Rc to account for the the difference in the path integral along the beam axis and centroidal axis, and the use of Rc as the average curvature across the section instead of Rs.
Section properties passed to the Rim constructor (and when accessed as rim.area, rim.I_rad, etc) are assumed to be the straight-beam properties. Therefore, rather than applying the correction in the Rim construction, correction will be applied whenever section properties are used so that the user can change y0 and have the results change in an expected fashion. Thus rims with the same extruded profile but different radii can be easily compared by simply changing R.
Extract from example_stand_on_spokes.py
import bikewheelcalc as bc
wheel.hub = wheel.Hub(diam1=0.04, width1=0.03)
produces: AttributeError: BicycleWheel instance has no attribute 'Hub'
corrected to:
wheel.hub = bc.Hub(diam1=0.04, width1=0.03)
Dear Dashdotrobot,
I came across your code and love the work. Currently I'm trying to fully understand the code, which is quite a challenge. I have completed by BSc. in aerospace engineering and an currently doing a Msc. I'm quite proficient in Matlab but Python is quite new for me. The examples are helpful but I can't get example_stiffness.py to run properly. I get an error:
Traceback (most recent call last):
File "\example_stiffness.py", line 46, in
fem = bc.BicycleWheelFEM(g, r_sec, s_sec)
File "C:\bikewheelfem.py", line 705, in init
offset = geom.lace_offset[e]
IndexError: index 0 is out of bounds for axis 0 with size 0
Could you indicate to as what the issue might be?
Thank you for sharing the code!
Best regards,
Matthijs
The current implementation overestimates the effective structural stiffness when the majority (or all) of the stiffness comes from tension stiffness. The current implementation uses T/L (1 - nn) as the geometric stiffness. The effective torsional stiffness of a planar wheel with radial spokes should be
k_tor = R^2 * ns * T_0*(1/L - 1/R)
The current implementation gives (approximately)
k_tor = R^2 * n_s * T_0*(1/L)
The moment about the wheel center exerted by a spoke is
m = (r_n) x (Tn)
The linearized moment increment has three terms:
dm_0 = r_n x (dT n_0 + T_0 dn) + dr_n x (T_0 n_0)
The first two terms are the original moment crossed with the force increment (given by the force-stiffness matrix). The third term is the spoke force in the prestressed configuration crossed with the increment in the moment arm. The increment in moment arm is exactly equal to du_n.
The solution is the following:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.