简体   繁体   English

使用Matlab计算弓弦的力量

[英]Calculate the power in a bow string using matlab

I'm trying to calculate the force in a bow string while using MATLAB 's ode45 , I have this differential equation 我正在尝试使用MATLABode45来计算弓弦中的力,我有这个微分方程

M(x)=d^2y/dx^2 * (1+(dy/dx)^2)^(-3/2)=-q * y where M(x) is the average torque in the bow, q=11.4716, and y(0)=0.3, y'(0)=0 and 0≤ x ≤0.3668

I have calculated the differential equation with ode45 but I have tried to calculate the force with this code; 我已经用ode45计算了微分方程,但是我尝试使用此代码计算力;

X=0.3668
tolerance=odeset('Abstol', 1e-9, 'Reltol', 1e-11);
[x,M]=diffekv45(tolerance,X)    

force=zeros(length(x),1);
for i=1:length(x)
    if x(i)==0
        force(i)=0;
    else
        force(i)=(0.3-M(i,1))./x(i); %%% 0.3-M(i,1) is because it is equilibrium in the         %%center of the bow
    end
end
totalforce=sum(force);

Line 6 is calculating the torque in all the readings. 第6行正在计算所有读数中的扭矩。 I suppose that the first element in M is the average torque. 我假设M中的第一个元素是平均扭矩。

I'm using these functions 我正在使用这些功能

function [x,M] = diffekv45(tolerance,X)
    u0=[0.3;0];
    [x,u]=ode45('M',[0,X],u0,tolerance);
end

function M=M(~,u)
global q 
    M=[u(2)
        -q*u(1)*(1+u(2)^2)^(3/2)];
end

When I calculate the force with a higher or lower tolerans I get a significant higher or lower value of the force. 当我用较高或较低的公差计算力时,我会得到较大或较小的力值。 That's why I'm wrong. 这就是为什么我错了。 So how can I calculate the force in the bow string? 那么如何计算弓弦中的力呢?

You have a 2nd order equation in terms of the displacement, which needs to be split up into two first order equations for use in orde45() . 就位移而言,您有一个二阶方程,需要将其分解为两个一阶方程,以便在orde45()

Use a state vector h=[y; diff(y,x)] 使用状态向量h=[y; diff(y,x)] h=[y; diff(y,x)] and create the following differential function for use in ode45() h=[y; diff(y,x)]并创建以下微分函数以在ode45()

function hp = deriv(x,h)
  y = h(1);       %First element of h is the deflection
  v = h(2);       %Last element of h is the slope
  hp = [v; -q*y/(1+v^2)^(-3/2)];
end

and then call 然后打电话

h0 = [0.3; 0];
ode45(deriv, [0,X], h0, tol);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM