Fit with implicit nonlinear function - Matlab

In summary, the speaker is trying to fit a function with nonlinear dependence on a parameter, but is having difficulty doing so. They have already measured ydata and x0, and know that their xdata follows a specific formula with a being the parameter they need to find. They also have a fitting function F(x,b) with b being another parameter to be found. The speaker has found a "brute" way to determine the best a parameter, but is now struggling with adding a second parameter to the fit. They are asking for help and suggest posting a self-contained code to make it easier for others to assist.
  • #1
Ras9
15
1
Hi guys! I am trying to fit a function whose x data depends nonlinearly on the parameter of the fit and I am having hard time doing that!
I will explain better: from my experiment I was able to measure my ydata e my x0 array and I know that my xdata are:
x=x0+a/(1+4x^2), with a being a parameter of the fit that I need to find.
After found a I can try to fit my data knowing my fitting function F(x,b) with b another parameter of the fit.
I managed to find a "brute" way to find the best a parameter for my data, by simply making it change and measuring the difference between my fitting function and my ydata. But know that I have to add a second parameter to the fit I really don't know what to do! Any help?
Thanks a lot
 
Physics news on Phys.org
  • #2
It is difficult to ascertain your problem based on your post. Can you please post a self-contained piece of code instead? Then it will be easier for other people to run your code and help you fix it or add to it.
 
  • Like
Likes BvU

1. What is a nonlinear function?

A nonlinear function is a mathematical function where the output is not directly proportional to the input. This means that when you change the input, the output does not change by a constant amount. Instead, the relationship between the input and output can be complex and nonlinear.

2. How do I determine if a function is nonlinear?

To determine if a function is nonlinear, you can plot the data points and see if the relationship between the input and output is linear or not. If the points form a straight line, the function is linear. If the points form a curved line, the function is nonlinear.

3. What is the advantage of using implicit nonlinear functions in Matlab?

The advantage of using implicit nonlinear functions in Matlab is that they can accurately model complex relationships between variables. This allows for more accurate predictions and analysis compared to linear functions. Additionally, Matlab has built-in functions and tools to handle implicit nonlinear functions efficiently.

4. How do I fit data with implicit nonlinear functions in Matlab?

To fit data with implicit nonlinear functions in Matlab, you can use the fitnlm function. This function allows you to specify the implicit nonlinear function and the data points, and it will find the best fit parameters for the function. You can also use the nlparci function to calculate confidence intervals for the fit parameters.

5. Can I use implicit nonlinear functions for any type of data?

Yes, implicit nonlinear functions can be used for any type of data as long as there is a nonlinear relationship between the variables. However, it is important to choose an appropriate function that accurately represents the relationship between the data points. Good data visualization and analysis techniques can help in selecting the right function for the data.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
992
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
651
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
878
Back
Top