Results 1 to 6 of 6

Math Help - Matlab differene equation question

  1. #1
    Newbie
    Joined
    Mar 2009
    Posts
    11

    Matlab differene equation question

    I hav a question im not quiet sure how to do on matlab. Here it is:

    Consider the following difference equation:
    q(n) = 2*q(n-1) + q(n-2) - 2*q(n-3)

    The analytical solution of the difference equation will be in the form
    q(n) = a(1) + a(2)*(-1)^n + a(3)*2^n

    Write down the system of linear equations in a(1), a(2), a(3) so that q(0) = 1
    q(1) = 2, q(2) = 2.5. Use Matlab to find the values for a(1), a(2), a(3). Hand in your Matlab commands.


    Usually I would do this by coming up with three simultaneous equations and solving them manually (or with a calculator) but this asks specifically for Matlab, and we havnt done simultanious equations, so i'm assuming theres another way, and if not mabe someone could run me through simultanious equations on Matlab.
    Any help is greatly appreciated.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by mrtwigx View Post
    I hav a question im not quiet sure how to do on matlab. Here it is:

    Consider the following difference equation:
    q(n) = 2*q(n-1) + q(n-2) - 2*q(n-3)

    The analytical solution of the difference equation will be in the form
    q(n) = a(1) + a(2)*(-1)^n + a(3)*2^n

    Write down the system of linear equations in a(1), a(2), a(3) so that q(0) = 1
    q(1) = 2, q(2) = 2.5. Use Matlab to find the values for a(1), a(2), a(3). Hand in your Matlab commands.


    Usually I would do this by coming up with three simultaneous equations and solving them manually (or with a calculator) but this asks specifically for Matlab, and we havnt done simultanious equations, so i'm assuming theres another way, and if not mabe someone could run me through simultanious equations on Matlab.
    Any help is greatly appreciated.
    What have you done in matlab?

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Mar 2009
    Posts
    11
    Quote Originally Posted by CaptainBlack View Post
    What have you done in matlab?

    CB
    Im only halfway through my first applied maths course (stage one) so probably not much. We'v done basic stuff like solving simple equations and drawing graphs. we'v done difference equations which involves analytical technique, for loops to do things like growh models and predator/prey models, and a few other things. Wev done Nonlinear equations which involves Newton-Raphson method, and have just started the bisection method, which involves using booleons. And I think thats about it.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by mrtwigx View Post
    Im only halfway through my first applied maths course (stage one) so probably not much. We'v done basic stuff like solving simple equations and drawing graphs. we'v done difference equations which involves analytical technique, for loops to do things like growh models and predator/prey models, and a few other things. Wev done Nonlinear equations which involves Newton-Raphson method, and have just started the bisection method, which involves using booleons. And I think thats about it.
    Have you done any matrix calculations?

    Visit this page.

    CB
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Member
    Joined
    Dec 2008
    From
    Auckland, New Zealand
    Posts
    189
    Quote Originally Posted by mrtwigx View Post
    Im only halfway through my first applied maths course (stage one) so probably not much. We'v done basic stuff like solving simple equations and drawing graphs. we'v done difference equations which involves analytical technique, for loops to do things like growh models and predator/prey models, and a few other things. Wev done Nonlinear equations which involves Newton-Raphson method, and have just started the bisection method, which involves using booleons. And I think thats about it.
    Hi there - amazing coincidence but we must be doing the exact same paper, MATHS162 at Auckland Uni? This question is in assignment 2 - which is due on the 30th April (2nd week after the break). If you've looked at the course book the next topic we are starting is called "Systems of linear equations" so we will be taught how to do it shortly
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Mar 2009
    Posts
    11
    Quote Originally Posted by nzmathman View Post
    Hi there - amazing coincidence but we must be doing the exact same paper, MATHS162 at Auckland Uni? This question is in assignment 2 - which is due on the 30th April (2nd week after the break). If you've looked at the course book the next topic we are starting is called "Systems of linear equations" so we will be taught how to do it shortly
    Wow that is amazing - we are doing the same paper anyway thanks for that I should probably looked in there before I posted, but I assumed it was something we had already done, and since I couldnt find out how to do it in the section we hav already done I resorted to asking one here.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Heat Equation on Matlab
    Posted in the Math Software Forum
    Replies: 2
    Last Post: April 9th 2011, 06:51 AM
  2. solve nonliner equation in matlab
    Posted in the Math Software Forum
    Replies: 2
    Last Post: May 21st 2010, 09:43 PM
  3. Matlab help writting an equation
    Posted in the Math Software Forum
    Replies: 1
    Last Post: December 11th 2009, 02:28 PM
  4. Equation solution Matlab
    Posted in the Math Software Forum
    Replies: 8
    Last Post: December 5th 2009, 01:22 AM
  5. help me to plot this equation in Matlab....
    Posted in the Math Software Forum
    Replies: 1
    Last Post: April 23rd 2009, 09:38 PM

Search Tags


/mathhelpforum @mathhelpforum