Results 1 to 5 of 5

Math Help - Matlab weird help

  1. #1
    Newbie
    Joined
    Jun 2014
    From
    Zuzaru
    Posts
    3

    Matlab weird help

    ]As you can see in the photo, I have the values for A1..A7 and B1..B7.

    Then, I plot a graph for the upper side A1..A7 and fit an exponential to it in Matlab. The eq is y=22.297e^-5.323x

    After, I plot the graph for the lower side B1..B7 and fit an exponential to it. The eq is y=40.949e^-5.002x


    The problem is that it is needed the same value for e's exponent. So it is needed that for A and B I get maybe something like y=22.297 e^-5.4x for both curves.

    To do that I see that I can move the OX axis down/up and thus the y values for the A(x,y) and B(x,y) points change, making the equations for the curves change. But I want some kind of algorithm that can do this automatically until the exponents for e for both curves become as close as possible.



    How can I make Matlab

    1. fit the exponential curve for each graph (one for the As and one for the Bs)

    2. check the values for e's exponent for the curves that correspond to the two graphs

    3. find a value "d" to ad/subtract from the y values of the A(x, y) and B(x, y) so that now it has A(x, y+d) b(x, y+d)

    4. do 1 and 2 again and see if the values for e's exponent for both curves have become equal or at least as close as possible.

    5. show that value "d".


    Thank you!

    Matlab weird help-33333.jpg
    Last edited by isro1; June 20th 2014 at 10:34 PM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Jun 2014
    From
    Britain
    Posts
    18
    Thanks
    4

    Re: Matlab weird help

    Hi
    I was intrigued by your query.
    Your data appears to be the envelope for a decaying sinusiodal waveform.
    The y intercepts should be equal either side of zero ie y = +/-Vexp(-at)
    so V the amplitude and a the decay constant need to be numerically equal.
    If the sinusoid has a phase shift I don't think it will give you the necessary affect.
    Cheers
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jun 2014
    From
    Zuzaru
    Posts
    3

    Re: Matlab weird help

    Hello,


    Thanks for your reply...

    My data is experimental and it is not exactly sinusoidal.

    Also, when I gather the data I choose where the OX is, I do not have any reference so it's my choice where Y is 0. So if I put OX too "up" or too "down" then the curve equations for up and down have different exponents for "e" which means the position I chose is not that good.

    That's why I need some sort of way to get those exponents as close to each other as possible for all my experimental trials.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Jun 2014
    From
    Britain
    Posts
    18
    Thanks
    4

    Re: Matlab weird help

    Hi

    Sorry I didn't catch on to what you were trying to do too well.

    If you take logs of each side you get a linear equation of the type ln(y) = ln(A) - kt where A is the max on the y axis and k is the parameter you want to match (I think ?).

    Would it help to combine the data (making the -ve values +ve) in this linear form and do a least squares fit.

    k would be a 'best fit' for your exponant and ln(A) a 'best fit' for your intercept on the y axis.

    Just a thought !

    Regards
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Jun 2014
    From
    Zuzaru
    Posts
    3

    Re: Matlab weird help

    Thank you! I will try to do that and see what happens. Sorry that I am replying so rarely, I am working on other things at the same time and then coming back to this. Thanks again for your replies!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. This is weird
    Posted in the LaTeX Help Forum
    Replies: 5
    Last Post: December 18th 2010, 10:52 AM
  2. Weird MCQ options!
    Posted in the Trigonometry Forum
    Replies: 4
    Last Post: February 5th 2010, 08:54 PM
  3. Weird sum problem
    Posted in the Calculus Forum
    Replies: 1
    Last Post: November 21st 2009, 03:47 AM
  4. weird one
    Posted in the Math Challenge Problems Forum
    Replies: 6
    Last Post: November 18th 2006, 05:43 PM

Search Tags


/mathhelpforum @mathhelpforum