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!

Three Unknowns and Three Equations

  1. Aug 21, 2011 #1
    Hi,

    I am working on an investigation for school and, before proceeding (or better, before trying again) I wanted to know if this would work.

    I have a graph and a proposed model with three variables:

    A/1 + Be(-Mx)

    x being time.

    Is it possible for me to find out these three unknowns (A,B and M) if:

    I set up three equations using that model for three different values of x and the y values they correspond in the graph?

    Thanks
     
  2. jcsd
  3. Aug 21, 2011 #2

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    First, I presume that you mean A/(1+ Be(-Mx)).

    Given three different values of x and y, say, [itex](x_0, y_0)[/itex], [itex](x_1, y_1)[/itex], and [itex](x_2, y_2)[/itex], you have the three equations
    [tex]\frac{A}{1+ Be^{-Mx_0}}= y_0[/tex]
    [tex]\frac{A}{1+ Be^{-Mx_1}}= y_1[/tex]
    [tex]\frac{A}{1+ Be^{-Mx_2}}= y_2[/tex]

    Dividing two one equation by another eliminates A giving, say,
    [tex]\frac{1+ Be^{-Mx_1}}{1+ Be^{-x_0}}= \frac{y_0}{y_1}[/tex]
    so that [itex]y_1(1+ Be^{-Mx_1})= y_0(1+ Be^{Mx_0})[/itex] which we can also write as [itex]B(y_0e^{-Mx_0}- y_1e^{-Mx_1})= y_1- y_0[/itex]
    and
    [tex]\frac{1+ Be^{-Mx_1}}{1+ Be^{-Mx_2}}= \frac{y_2}{y_1}[/tex]
    so that [itex]y_1(1+ Be^{-Mx_1})= y_2(1+ Be^{-Mx_2})[/itex] which we can write as
    [itex]B(y_1e^{-Mx_1}- y_2e^{-Mx_2})= y_2- y_1[/itex]
    and dividing those two equations eliminates B.

    I'll leave the rest to you. You might want to cast the equation in terms of hyperbolic functions rather than exponentials.
     
  4. Aug 21, 2011 #3

    NascentOxygen

    User Avatar

    Staff: Mentor

    Brackets are cheap. No need to go so sparingly. :wink:

    Can we a asume you mean: y = A/(1 + Be(-Mx)) ?

    y1 = A/(1 + Be(-Mx1))
    y2 = A/(1 + Be(-Mx2))
    y3 = A/(1 + Be(-Mx3))


    3 equations in 3 unknowns, so that should be solvable.
    You might be able to set up a maths package to solve it, if it looks difficult using pencil and paper. :smile:
     
  5. Aug 21, 2011 #4
    Firstly, yes, sorry about the lack of brackets. You guys got the equation correct. I tried doing something similar to what HallsofIvy suggested but I got lost in my work halfway through. I guess I'll try and follow HallsofIvy's work closely and see if I can get to an answer or maybe try and find a math package as NascentOxygen suggested.

    Thanks,
    Peter G.
     
  6. Aug 21, 2011 #5

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    What you have written is [itex] A + B e^{-Mx}[/itex]. Did you mean [tex]\frac{A}{1+Be^{-Mx}} ? [/tex] If so , you should use brackets, like this: A/[1 + B e^(-Mx)].

    RGV
     
  7. Aug 21, 2011 #6
    Ok, thanks for the advice RGV. :smile:
     
  8. Aug 21, 2011 #7

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    HallsofIvy gave you some good advice, but he did not point out the clincher: in general, there is no simple formula to solve a problem such as
    [tex] \frac{e^{-Mx_0}-e^{-Mx_1}}{e^{-Mx_1}-e^{-Mx_2}} =
    \frac{y_0 - y_1}{y_1 - y_2} . [/tex] In general, we must resort to a numerical method; for example, you can graph the left-hand-side for various M and try to pick off an approximate solution. Then you can correct the initial guess using various improvement methods (which you will see eventually, if you continue your studies). Alternatively, you can use a computer package to solve the problem.

    RGV
     
  9. Aug 21, 2011 #8

    dynamicsolo

    User Avatar
    Homework Helper

    Here's a thought on fitting a logistic curve to a handful of points (I'm just trying an idea here, although someone must have written about this in the past.) This is something to try in the absence of statistical or other numerical software…

    The logistic equation you are using is [itex]y = \frac{A}{1 + Be^{-Mx}}[/itex] , so you probably already know that its horizontal asymptotes are y = 0 and y = A .

    The first two derivatives are

    [tex] y \prime = \frac{AMBe^{-Mx}}{(1 + Be^{-Mx})^{2}}[/tex]

    and

    y''[itex] = AMB \cdot \frac{(1 + Be^{-Mx})(-Me^{-Mx}) - 2(e^{-Mx})(-MBe^{-Mx})}{(1 + Be^{-Mx})^{3}} . [/itex]

    What we're interested in is the location of the point of inflection, where y'' = 0 ; the denominator of our second derivative expression is never zero, so we can determine that the numerator is zero for [itex]e^{-Mx} = 1/B . [/itex] (I'm writing it this way to make substitutions easier elsewhere.)

    The point of inflection is the place where the (positive) slope of the curve is the largest. That maximum slope, found by substituting our result into the expression for y' , is

    [tex]y\prime_{max} = \frac{AMB \cdot \frac{1}{B} }{ (1 + (B \cdot \frac{1}{B}))^{2} } = AM / 4 .[/tex]

    The value of the logistic function there is [itex]y_{p.i.} = \frac{A}{( 1 + B \cdot \frac{1}{B} )} = A / 2 . [/itex] (This last is a familiar result.)


    This means that the point of inflection is "vertically" midway between the horizontal asymptotes and is located at x = (ln B) / M (solving our expression [itex]e^{-Mx} = 1/B [/itex] for x ). Dividing the maximum slope by (A / 2) gives us ( M / 2 ) . With M known, the x-coordinate gives us B .


    How does this help us with your three points? Plot them on a standard y vs. x graph. Of course we don't know where they fall along the curve, so we'll make some kind of estimate. Find the slopes of the three line segments connecting each pair of points.

    If the three slopes aren't too different from one another, we might take it that they fall along the "linear" portion of the logistic curve. Let's use the largest of these slopes as the estimate for AM / 4 . We could then take the average of the x-coordinates as the x-coordinate of the point of inflection and the average of the y-coordinates as the y-coordinate of the p.i. , A / 2 . We now have enough information to get an estimate for M , and then for B .

    If it looks like the points are approaching one of the asymptotes, there will be greater difference among the three slopes you've worked out. We could then assume that the point of inflection is near the pair of points which gave the largest slope. Take the point farther away from the developing curvature as an estimate of the point of inflection and proceed as described in the previous paragraph.

    I'm just suggesting this as something to try which is relatively simple to calculate. A "statistical package" will only give an estimate with sizable error bars on A, B , and M in any case, since you only have three data points to work with...
     
    Last edited: Aug 21, 2011
  10. Aug 22, 2011 #9

    NascentOxygen

    User Avatar

    Staff: Mentor

    It might be fun filling in 3 cells in a spreadsheet and guessing some initial values then perturbating them until results are near enough to a solution. Probably you have a good idea of the time-constant 1/M anyway?
     
  11. Aug 22, 2011 #10

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    If you use Excel you can exploit the Solver tool, which used some pretty multivariable Newton methods to deal with nonlinear systems. (However, as with any tool, it helps to start from an initial approximation.) I believe some open-source spreadsheets also come with comparable packages.

    RGV



    RGV
     
  12. Aug 22, 2011 #11
    Hi guys,

    I downloaded a free trial of Wolfram Matematica and inputed the three equations and asked it to solve. The values for the parameters fit almost perfectly the graph with the points I needed.

    I would have loved to try and do it on paper following the ideas and advice you guys put forward but I am not that great of a mathematician (or simply don't have the tools in my toolbox so far!)

    I do however, have more than 3 points (9 actually) and if I could use all of them I would probably get something even closer.

    Thanks a lot for the ideas!



    Peter G.
     
  13. Aug 22, 2011 #12

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    If you have only three parameters A, B and M but have 9 data points, you likely cannot hope to get a perfect fit: the A,B and M that work with one set of three points may be different from the A,B and M that work with another set of three points. In cases like this we need to look at "best" fits, which are fits that come as close as possible to all the data points (where "closenesss" can have various definitions). The most common form is the *least-squares* form, in which we choose A, B and M to minimize the sum of the squared residual errors; that is, if f(x) = A/[1+B*e^(-Mx)], we want to minimize S(A,B,M) = sum{[f(x_i) - y_i]^2, i=1,...,9}. Since the parameters A, B and M enter the form of f(x) nonlinearly, we have a nonlinear least-squares problem. This can be handled by sophisticated software, or by setting the derivatives of S(A,B,M) equal to zero and solving the resulting system of nonlinear equations numerically. Here, too, a spreadsheet Solver program could be applied if you don't have access to anything else.

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




Similar Discussions: Three Unknowns and Three Equations
Loading...