fitting bi-linear equation using fmincon
Afficher commentaires plus anciens
Hello dear all
I am trying to fit a bi-linear equation on a dataset using fmincon command in MATLAB. My objective is to minimize the error in the whole bi-linear curve. My curve looks like the picture bellow:

and I want to fit a bi-linear model on it having two slopes and the x0 as the the unknown parameters. The whole bi-linear fitted line should give the minimum error ( sum(y-y^)^2 = min ).

in which d1 (or X0 in picture bellow) can have an upper and lower bond of for example [0.01 0.02].
So the final bi-linear fit would be like this:

I found the fmincon command in MATLAB the best way to achieve this goal, but unfortunately I don't know how practically program this.
What I provided in this question was a very simplified version of my actual task wich is tri-linear curve, so if I be able to fit a bi-linear, I will be able to implement it on more complex problems. I also attached my datapoints file.
I do appreciate you kind helps on this. Thank you very much.
4 commentaires
Benjamin
le 18 Déc 2019
Jordan Poissy
le 5 Juin 2020
Hey Benjamin,
I am really interested in what you did but your zip file is not working. Is it possible to reupload it please because I would like to use your program to do the same thing with my data. Thank you very much !
Matt J
le 15 Oct 2020
Mattia Pucci's comment moved here:
Hello Benjamin
For my thesis I should do a code as similar as your.
I am attaching the "pushover" curve that I plotted in Matlab. I would like to built a bi-linear curve with the same area of first curve
I know the final poin ant the area.
How could I do?
I appreciate your help.
Benjamin
le 6 Nov 2020
Réponses (0)
Catégories
En savoir plus sur Get Started with Curve Fitting Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!