1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Shooting Arrows - Nonlinear Spring Problem

  1. Oct 17, 2013 #1
    Hello awesome physics people!

    Someone asked me for help on their first year physics homework, and I couldn't really solve it. This kept bugging me, because I should know how this works by now :P

    1. The problem statement, all variables and given/known data

    See attachment for the full problem statement. Basically, a bow is strung with an arrow, and what they want to know is, among other things, the graph for the velocity with respect to time.

    2. Relevant equations

    The given equation is [tex]F(x)=-k_1x-k_2xe^{cx^2}[/tex].

    Other equations I've used:

    [tex]E_{pot}=E_{kin}=1/2*mv^2[/tex]
    [tex]v_{terminal}=sqrt{(2*E_{pot})/m_{arrow}}[/tex]

    3. The attempt at a solution

    I've come as far as the calculation of the terminal velocity of the arrow, however, after that I need to come up with an equation of velocity with respect to time, whilst I have only the acceleration with respect to distance from the equilibrium position of the bow. If it were linear I would be able to use a constant acceleration, but seeing as the acceleration is dependent on the distance from equilibrium, I don't really know what to do.

    I've implemented my partial solution in MATLAB, here is my code:

    Code (Text):
    %% First I let MATLAB calculate the initial x:

    solve('-390*x-115*x*exp(2.3*x^2)=350','x');

    % The outcome of this: xin=-0.62035062944153550757039658657226, or -0,620m

    %% Now for the numerical stuff

    k1=390;
    k2=115;
    c=2.3;
    Fmax=350;

    x=-0.620:0.01:0;    
    % This is the x-vector, I initialized it from the initial x until x=0, when
    % the arrow leaves the string.

    dt=0.01;        % This is the timestep
    t=0:dt:5;       % Here I construct a vector t from 0 to 5 with steps of dt
    m=34*10^-3;     % This is the mass of the arrow

    % The following is the given formula:
    F=-k1.*x-k2.*x.*exp(c.*x.^2);

    % To get the energy stored up in the spring, we need only to integrate F
    % over x:

    Epot=trapz(F,x);            % This gives Epot = 146.4474 J

    % As all of the potential energy will be transferred into kinetic energy of
    % the arrow, according to Epot = Ekin = 1/2*mv^2, we can calculate the
    % terminal velocity of the arrow:

    vterm=sqrt((2*Epot)/m);      % This gives vterm = 92.8146 m/s

    % Assuming all of the force gets transferred to the arrow, and because
    % F=m*a, we can calculate the acceleration of the arrow as function of x
    % simply by dividing by the mass of the arrow:

    a=(-k1.*x-k2.*x.*exp(c.*x.^2))/m;

    figure, plot(x,F,'g')
    title('Force with respect to x')

     
    I've included the plot as another attachment.

    I guess my problem can be stated another way:

    How do I parametrize from x to t?



    Thanks in advance!!
     

    Attached Files:

    Last edited: Oct 17, 2013
  2. jcsd
  3. Oct 17, 2013 #2

    gneill

    User Avatar

    Staff: Mentor

    Your value shown for xin looks a bit suspicious. Verify your solution.

    For the V vs T plot you're going to have to do a numerical integration of the trajectory. Use whatever algorithm you think appropriate, such as the Leapfrog method, or Euler's method, or Verlet, or even Runge-Kutta (probably overkill). Some web time will fill you in on those.

    They all boil down to using the force at a given position to determine an acceleration to apply over the next small time interval. Use it to update the velocity and position, rinse, repeat.
     
  4. Oct 17, 2013 #3
    Thanks for your reply gneill! I see, so there is no analytical method of converting distance into time when working with a nonlinear system?

    My x_initial doesn't seem suspicious to me, loading a bow by pulling back 62 cm is plausible, right? The minus sign is explicable by the definition of the x-axis in the problem statement.

    I'll try to implement this Frogleap integration method, thanks again!
     
  5. Oct 17, 2013 #4

    gneill

    User Avatar

    Staff: Mentor

    It depends upon the functions involved. If you run into a transcendental function you're basically hosed :smile: In this case the x2 in the exponent of the exponential is a major stumbling block for a solution involving the normal basis set of functions that we're used to.

    I get a different value when I find the root of the function. In particular, I find x = -0.559 m.

    Sounds like a plan!
     
  6. Oct 19, 2013 #5
    Yay, it worked!

    I implemented the Leapfrog algorithm, and it worked! At first I got a sine wave (which isn't strange seeing as I basically modelled a spring), so I made the calculation stop as soon as x became positive. A bit of a hack solution, also because the rest of the vectors are zeros after that (that explains the sudden straight line in the graphs), but I didn't feel like polishing the code. I also used the erroneous value of -0.62 for x_initial, as it didn't really matter for this implementation (but thanks for checking anyways!)

    Here's my code:

    Code (Text):

    %% Now attempting a Leapfrog integration
    dt=0.001;
    t=0:dt:0.013;
    x_in=-0.620;
    x_t=zeros(1,length(t));
    v_t=zeros(1,length(t));
    a_t=zeros(1,length(t));
    x_t(1)=x_in;
    v_t(1)=0;
    a_t(1)=(-k1.*x_in-k2.*x_in.*exp(c.*x_in.^2))/m;


    i=2;
    while x_t(i-1)<0
       
        x_t(i)=x_t(i-1)+v_t(i-1)*dt+0.5*a_t(i-1)*dt^2;
        a_t(i)=(-k1*x_t(i)-k2*x_t(i).*exp(c*x_t(i).^2))/m;
        v_t(i)=v_t(i-1)+0.5*(a_t(i-1)+a_t(i)).*dt;
        i=i+1;
    end

    hold all
    subplot(2,2,1), plot(t,v_t,'b'), title('Velocity with respect to time')
    subplot(2,2,2), plot(t,x_t,'r'), title('Distance with respect to time')
    subplot(2,2,3), plot(t,a_t,'g'), title('Acceleration with respect to time')
     
    And my graphs are attached. Cheers gneill :)
     

    Attached Files:

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Shooting Arrows - Nonlinear Spring Problem
  1. Shooting an Arrow (Replies: 8)

Loading...