How Do I Fit the Equation x*y^a = b to Data in MatLab?

  • Thread starter Thread starter 2slowtogofast
  • Start date Start date
  • Tags Tags
    Data Matlab
Click For Summary

Discussion Overview

The discussion revolves around fitting the equation x*y^a = b to a given dataset of x and y values using MATLAB. Participants explore various methods for curve fitting and algebraic manipulation to derive the necessary parameters.

Discussion Character

  • Homework-related, Exploratory, Technical explanation

Main Points Raised

  • One participant expresses uncertainty about how to start fitting the equation x*y^a = b to their data.
  • Another participant suggests using the curve fitting toolbox in MATLAB as a potential resource.
  • A participant mentions using polyfit with a logarithmic transformation, resulting in a linear equation, but seeks clarification on how to proceed from that point to achieve the desired form of the equation.
  • Another participant provides an algebraic approach to rearranging the equation, indicating that it can be manipulated into a form suitable for linear regression, while also noting the limitations of providing a complete solution due to the homework context.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best method to fit the equation, as multiple approaches are suggested and uncertainty remains about the next steps.

Contextual Notes

Some participants rely on algebraic manipulation and logarithmic transformations, while others suggest using built-in MATLAB functions, indicating a variety of approaches that may depend on the specific characteristics of the dataset.

Who May Find This Useful

Individuals interested in data fitting techniques, particularly in the context of MATLAB and algebraic manipulation of equations.

2slowtogofast
Messages
134
Reaction score
1
if i am given a data set of x and y values i need to come up with an expression of

x*y^a = b and b are constants

no idea how to get started any help geting started please
 
Physics news on Phys.org
You may want to investigate the curve fitting toolbox

http://www.mathworks.com/products/curvefitting/description1.html
 
Last edited by a moderator:
yeah i did polyfit(x,log(y),1)

that will return 2 number and ill have an eqn

lny = a1x+a2 it fit a straight line to my data but I am confused on what to do next i need xy^a = b is there another function i should try and use or is this more of an algebraic manipulation type of thing and if so can some one tell me where to start.
 
There is an algebraic way to solve that. Here is my approach

y^a = \frac{b}{x}

\log(y^a) = \log(\frac{b}{x})

a \log(y) = \log(b) - \log(x)

Since this is the homework forum I can't solve the entire problem for you. However, if you do some arranging you can do a y=mx+b curve fit and solve for your coefficients.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K