微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 fsolve() 求解具有 4 个未知数的 4 个方程的任何指导

如何解决使用 fsolve() 求解具有 4 个未知数的 4 个方程的任何指导

编写一个程序,使用 fsolve() 解决滚动车轮动力学问题 - 显示即将发生的滑动问题。

您必须使用 fsolve() 的“args”功能来传达车轮参数。使用张贴的所有车轮参数,静摩擦系数和斜坡角 theta 除外。为即将发生的滑移生成斜坡角与摩擦系数的关系图,摩擦值为 0.1、0.15、0.2、0.25 至 0.85。

17-94:
The tire has a weight of 30lb and aradius of gyration kG = 0.6 ft.

If the coefficients of static and kinetic friction between the wheel
and the plane are mu_s = 0.2 and mu_k = 0.15,determine the tire's angular
acceleration as it rolls down the incline. set theta = 12 degrees,radius = r = 1.25 ft.

The set of eqns from this problem are:
Sum_Fx = m*(aG) = W*sin(theta) = (W/gc)*aG
Sum_Fy = m*(aG) = N - W*cos(theta) = 0
Sum_Mg = Ig*alpha = F*r = [(W/gc) * (kG)**2 ] * alpha

Assume the wheel does not slip: aG = r*alpha

请注意,我是 python 新手,所以我完全迷失了。任何带有解释/提示/指导来启动此问题的代码都会非常有帮助

这是我目前所拥有的(顺便说一句,我知道这是不对的):

from scipy.optimize import fsolve
from scipy import sin,cos,radians
from scipy import linspace
from matplotlib import pyplot as plt

def set_of_eqns(vals):
    """
    1. Rolling Wheel Dynamics - impending slip problem.
    2. Wheel parameters: w = 30 lb,theta = 12 degrees,F,N,aG,alpha,kG =    0.6 ft,g = 32.2,mu = 
       0.2,r = 1.25
    3. We must use FSOLVE() to solve the problem.
    4. We must use "args" feature of Fsolve to communicate wheel parameters
    5. Generating a plot "Ramp angle vs Coefficient of friction for impending slip
            5.1. Using friction values: 0.1,0.15,0.2... up to 0.85
    :param vals:
    :return:
    """
    F,alpha = vals # unpacking the unkNown values
    W,theta,gc,r,k_G = 30,32.2,0.21,1.25,0.6 # kNown wheel parameters
    
    # below are the equations after setting them to 0

    f1val = W * sin(radians(theta)) - F - (W / gc) * a_G
    f2val = N - W * cos(radians(theta))
    f3val = F * r - (W / gc) * k_G ** 2 * alpha
    f4val = a_G - r * alpha
    f5val = F - mu*N
    return (f1val,f2val,f3val,f4val,f5val)

def main():
    (F,alpha) = fsolve(set_of_eqns,(1,1,1))
    print(F,alpha)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。