Results 1 to 5 of 5

Math Help - How to solve ODE for independent function

  1. #1
    Newbie
    Joined
    Aug 2011
    Posts
    3

    How to solve ODE for independent function

    Hello,

    I need to solve numerically an equation of the form

    v(t) = k1*z(t)*w(t)-k2*i(t)-k3*di(t)/dt

    The issue is that rungekutta methods are useful for solving

    di(t)/dt = 1/k3 * [ k1*z(t)*w(t)-k2*i(t)-k3*-v(t) ]

    but I need to solve for v(t)

    What I did was:

    v (t) = k1*z(t)*w(t)-k2*i(t)-k3*[i(t)-i(t-1)]/h

    But is not a good approximation because the step size h cannot be small enough. I need a more sophisticated method than directly applying the difference quotient as I did.
    Thanks a lot!
    Follow Math Help Forum on Facebook and Google+

  2. #2
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2

    Re: How to solve ODE for independent function

    What functions are known, and what functions are unknown? Presumably i and v are unknown. If so, you need another equation in order to solve for v numerically. Is this equation from a circuit? If so, please post the circuit.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Aug 2011
    Posts
    3

    Re: How to solve ODE for independent function

    Thanks Ackbeet!

    Well, the only unknown is v(t)
    The equations are for an electric generator in stand alone operation, the actual equation is
    vd=Lq*iq*wr-Rs*id-Ld*did/dt
    where Lq, Ld, and Rs are constant parameters and vd, iq, wr, and id are functions of time.
    My first approach of course was did/dt = (id(t)-id(t-h))/h, then I improved by a higher order approximation of the form did/dt = (3*id(t) - 4*id(t-h) + id(t-2h))/(2*h)
    But still I have the same problem that did/dt oscillates too much and get's unstable with h less than 0.002, which is too big for me.
    The variables are declare as double in the C code, to have a better precision.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2

    Re: How to solve ODE for independent function

    It doesn't look like you're actually solving an ODE. What you have, correct me if I'm wrong, are the numerical values for all the functions/values on the RHS of your equation, and from that you want to construct the function on the LHS. Is that correct? If so, I would investigate multi-point approximations for derivatives a bit more even than you have. You might want to check out the derivative on both sides of t. So far, all I see are t, t-h, and t-2h. What about t+h and t+2h? Those points might be useful. Perhaps a symmetric approximation of the derivative?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Aug 2011
    Posts
    3

    Re: How to solve ODE for independent function

    You are right in your statement of what I'm trying to do. But I can't use future values because I'm using this equation to produce values of vd in a real-time application. So, I obtain say vd(t1) and with that value I calculate id(t2),iq(t2), and w(t2). With the new values I calculate vd(t2). So I can save the history of the system and use it to calculate the derivative, but I don't have future values.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. function of iid random variables also independent?
    Posted in the Advanced Statistics Forum
    Replies: 7
    Last Post: June 26th 2011, 11:45 AM
  2. Solve the function
    Posted in the Pre-Calculus Forum
    Replies: 4
    Last Post: August 31st 2010, 09:23 PM
  3. Independent Random Variable (exponential function)
    Posted in the Advanced Statistics Forum
    Replies: 4
    Last Post: April 27th 2010, 05:09 PM
  4. Function being path independent?
    Posted in the Calculus Forum
    Replies: 3
    Last Post: December 5th 2009, 04:21 PM
  5. Replies: 6
    Last Post: November 11th 2009, 11:43 AM

Search Tags


/mathhelpforum @mathhelpforum