Plotting a graph to find unknowns

AI Thread Summary
To find the unknown variables a and b in the equation y = ax + bx^2, one can use two data points to create simultaneous equations. The discussion highlights that transforming the equation to a linear form can aid in plotting and solving for these parameters. Using logarithmic transformations is suggested, but it is emphasized that the initial equation must be handled correctly to avoid errors. When dealing with more than two data points, a least-squares fitting approach is recommended to accommodate experimental errors. Understanding the nature of the data is crucial for determining the best method to find a and b.
Glenn G
Messages
113
Reaction score
12

Homework Statement


Plot a suitable graph, using your x and y data, to find the variables a and b.

Homework Equations


y = ax + bx^2

The Attempt at a Solution


This is clearly a quadratic, the best I can do is to play about with lns and I came out with
lny = lnax + lnbx^2
lny = ln(ab.x^3)
lny = 3ln(ab) + 3lnx

so plotting lny against lnx should give gradient 3 and from the intercept can get the product ab but not the individual values of a and b.
Other than taking two point from the graph and using simulataneous equations is there something I'm missing? Is there another graphical way to get at a and b?
 
Last edited by a moderator:
Physics news on Phys.org
1. y = ax + bx2
2. lny = ln(ax) + ln(bx2)
3. ln y = ln(abx3)
4. ln y = 3ln(ab) + 3 lnx

Of these steps, that between 2 and 3 is the ONLY one you got right. You correctly saw that lnA + lnB = ln(AB). But do you see why that makes the step from 1 to 2 wrong? ln(A+B) is not equal to lnA + lnB. (From 3 to 4, the cube only affects x, not ab.)

Can you think of a simple transformation of the initial equation that makes the RHS linear in x?
 
  • Like
Likes Merlin3189 and scottdave
Glenn G said:

Homework Statement


Plot a suitable graph, using your x and y data, to find the variables a and b.

Homework Equations


y = ax + bx^2
What data do you have? Your equation above is that of a parabola, so if your data points are on the parabola you can use two of the data points to form two equations in a and b, and then solve for these parameters.

mjc123 said:
Can you think of a simple transformation of the initial equation that makes the RHS linear in x?
Maybe it's because I just woke up, but I can't think of such a transformation.
 
Wow, I made a dreadful mistake with the lbs!

So I think then that if you had numerical data for x and y (from a practical) and then it was suggested the relationship was:
Y = ax + bx^2
Then there is nothing you could do to actually find out what the a and b was?
Cheers,
Glenn
 
Glenn G said:
Wow, I made a dreadful mistake with the lbs!

So I think then that if you had numerical data for x and y (from a practical) and then it was suggested the relationship was:
Y = ax + bx^2
Then there is nothing you could do to actually find out what the a and b was?
Cheers,
Glenn
Lns not lbs. predictive text!
 
Glenn G said:
Then there is nothing you could do to actually find out what the a and b was?
Did you read what I wrote earlier? Here it is again:
Mark44 said:
Your equation above is that of a parabola, so if your data points are on the parabola you can use two of the data points to form two equations in a and b, and then solve for these parameters.
 
Mark44 said:
Did you read what I wrote earlier? Here it is again:
Thanks Mark, missed that on my phone.
regards,
G.
 
If you are certain that it will fall into the format of y = ax + bx2, then take some of your (x,y) data points, then you will have 2 or more linear equations:
constant1 = a{constant2} + b{constant3},
constant4 = a{constant5} + b{constant6} etc.
 
scottdave said:
If you are certain that it will fall into the format of y = ax + bx2, then take some of your (x,y) data points, then you will have 2 or more linear equations:
constant1 = a{constant2} + b{constant3},
constant4 = a{constant5} + b{constant6} etc.
This is essentially what I said in posts 3 and 6.
I would write the above two equations as
##y_1 = ax_1 + bx_1^2##
##y_2 = ax_2 + bx_2^2##
Assuming that ##(x_1, y_1)## and ##(x_2, y_2)## are actually points on the parabola, my two equations can be used to solve for a and b.
 
  • #10
Using log on the vertical axis versus log on the horizontal axis is helpful when you have some data, which you believe fits the form:

y = Axn

It is especially helpful when you don't know the value of n. It is not necessary to be an integer, you could have y = (2.1)x1.5 for example.

then taking logs of both sides, you get log(y) = log(Axn) and then: log(y) = log(A) + log(xn) and finally:

log(y) = log(A) + n*log(x), so n is the slope of the graph, and log(A) is the intercept.

Often this would be done by getting some graph paper which already had log scales on both axes, and plotting the data directly.
 
  • #11
Mark44 said:
Maybe it's because I just woke up, but I can't think of such a transformation.
What about y/x = a + bx ?
 
  • Like
Likes ehild and Merlin3189
  • #12
Glenn G said:

Homework Statement


Plot a suitable graph, using your x and y data, to find the variables a and b.

Homework Equations


y = ax + bx^2

The Attempt at a Solution


This is clearly a quadratic, the best I can do is to play about with lns and I came out with
lny = lnax + lnbx^2
lny = ln(ab.x^3)
lny = 3ln(ab) + 3lnx

so plotting lny against lnx should give gradient 3 and from the intercept can get the product ab but not the individual values of a and b.
Other than taking two point from the graph and using simulataneous equations is there something I'm missing? Is there another graphical way to get at a and b?

People have asked you about the nature of your data, and you have refused to answer. That question is very important. If you have just two data points ##(x_1,y_1)## and ##(x_2,y_2)## you can set up and solve two equations to find ##a## and ##b##; the equations you need to use have been written already by others.

However, if you have more than two data points, and if there are possibly some experimental errors in the data, that "solving" approach is in trouble. Suppose, for example, you had 10 data points ##(x_1,y_1), (x_2,y_2), \ldots, (x_{10},y_{10})##. There may be no possible parabola that fits all of them; there are 45 different ways to choose two point from ten points, so there may be as many as 45 different "fits" to your data. Obviously, that makes no sense, so in such cases we seek a "compromise" fit, which may not go through any of the points exactly, but (hopefully) passes close to all of them. When you have data with experimental errors, that is the best you can hope for.

Anyway, in such cases we normally find the so-called "least-squares fit"; see, eg.,
http://mathworld.wolfram.com/LeastSquaresFitting.html .
You can find many other links by doing a Google search for "least squares fit", for example. Many of the links use at least a bit of Calculus, so I have not cited them herein. Of course, I could spend quite a lot of time writing it all out, but numerous people have done that already, and it is as easy for you to read material on other web sites as on this one.

So, I ask again: what is the nature of your data?
 
Last edited:
  • Like
Likes Skins
Back
Top