How can MATLAB help in finding an equation for a given curve?

  • Thread starter davidmandis
  • Start date
  • Tags
    Curve
In summary, A single equation or expression to represent the curve shown in the attached figure can be written as f(x)= x/20000 + H(x- 4000)(4000- x/2000) where H(x) is the Heaviside function and x\le4000, H(x- 4000)= 0 so f(x)= 1/2000 and if x> 4000, H(x- 4000)= 1 so f(x)= 1/2000+ 4000- x/2000= 4000. This can be simplified to f(x)= x/2000 if x\le 4000, f(x)= 2 if x> 400
  • #1
davidmandis
1
0
Hi,
I need to find a single equation to represent the curve shown in the attached figure. I have access to MATLAB if that will help. Can anyone help me out?

Thanks,
David
 

Attachments

  • curve.JPG
    curve.JPG
    19.7 KB · Views: 518
Mathematics news on Phys.org
  • #2
What exactly do you mean by "a single equation"? That can be simply written as a "piecewise linear function": f(x)= x/2000 if x[itex]\le[/itex] 4000, f(x)= 2 if x> 4000.

If you want a "single expression", use the Heaviside function H(x) which is defined by "H(x)= 0 if x[itex]\le[/itex] 0, H(x)= 1 if x> 1". We can fit it to f by taking H(x- 4000).

f(x)= x/20000 + H(x- 4000)(4000- x/2000)

If x[itex]\le[/itex]4000, H(x- 4000)= 0 so f(x)= 1/2000. If x> 4000, H(x- 4000)= 1 so f(x)= 1/2000+ 4000- x/2000= 4000.
 
  • #3


Hi David,

Finding an equation for a curve can be a challenging task, but with the help of MATLAB, it can become a lot easier. First, you will need to gather some information about the curve, such as the coordinates of several points on the curve. Once you have this data, you can use MATLAB's curve fitting tools to find the best equation that fits the curve.

One way to do this is by using the "polyfit" function in MATLAB, which takes in the x and y coordinates of the points and fits a polynomial curve to them. You can also use the "fit" function, which allows you to choose from a variety of different curve fitting models, such as linear, exponential, or power functions.

Once you have found the best fitting equation, you can plot it on the same graph as your curve to see how well it matches. If you are satisfied with the fit, you can use the equation to represent the curve. If you need further assistance, there are also many online resources and tutorials available for using MATLAB's curve fitting tools.

I hope this helps you in finding the equation for your curve. Best of luck!
 

What is the process for finding the equation of a curve?

The process for finding the equation of a curve involves gathering data points from the curve, plotting them on a graph, and then determining the best fit line or curve that passes through most of the points. This line or curve can be described by an equation, which can then be used to make predictions or analyze the behavior of the curve.

What are the different types of curves and their equations?

There are many types of curves, each with their own unique equation. Some common types of curves include linear, quadratic, exponential, logarithmic, and trigonometric curves. Each of these curves has a specific form of equation that can be used to describe its behavior.

How do I find the equation of a curve using regression analysis?

Regression analysis is a statistical method used to find the best fit line or curve for a set of data points. This method involves using mathematical algorithms to calculate the parameters of the equation that best describes the data. This equation can then be used to model the behavior of the curve.

Can I find the equation of a curve without using regression analysis?

Yes, there are other methods for finding the equation of a curve without using regression analysis. These methods include trial and error, graphical methods, and using specific formulas for certain types of curves. However, regression analysis is often the most accurate and efficient method for finding the equation of a curve.

How can I use the equation of a curve to make predictions?

The equation of a curve can be used to make predictions about the behavior of the curve beyond the data points that were used to create it. By plugging in different values for the independent variable, we can determine the corresponding values for the dependent variable and see how the curve changes. This can be useful in making forecasts or analyzing trends.

Similar threads

Replies
5
Views
446
Replies
8
Views
1K
  • General Math
Replies
16
Views
1K
  • General Math
Replies
1
Views
742
Replies
49
Views
3K
Replies
2
Views
1K
  • General Math
Replies
17
Views
1K
Replies
1
Views
736
  • General Math
Replies
18
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
Back
Top