Fit set of data (x,y) to function with parameter constraints?

1 view (last 30 days)
Hi!
I'm trying to fit set of (x,y) data to y = D*sin(C*arctan{B*x-E(B*x-arctan(B*x))})
with parameter constraint function
C = 1+(1-(2/pi)*arcsin(F/D))
here B,C,D,E are the parameter constants need to find and F is the asymptote of y as x goes to infinity.
I can curve fit data with cftool for the main equation,
searched in internet but cannot find way to get an answer
How to add the constraint parameter functions ?
Thanks for the help. sorry for my knowledge, I'm new to matlab.
  3 Comments
Shehara Perera
Shehara Perera on 18 Dec 2017
Edited: Shehara Perera on 18 Dec 2017
Thanks Roger,
but my problem has more than 20 of coefficients like above(implicit functions).
It's hard to get one equation for all
Any suggestions ?
How to minimize (C-2/pi*asin(F/D)) ?
Roger Stafford
Roger Stafford on 18 Dec 2017
The point I was making is that you cannot regard both F and C as quantities that can be independently varied while searching for a fit. As I have said, setting one of them will determine the other. That is because as x approaches infinity, arctan(B*x-E(B*x-arctan(B*x))) will of necessity approach pi/2 assuming B*(1-E)>0, and therefore y will approach D*sin(C*pi/2). This shows that F = D*sin(C*pi/2). Therefore you can regard B, C, D, and E as your variable parameters and F will automatically be satisfied. It is not a separate constraint.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!