Clear Filters
Clear Filters

How to fit a parameter-bound two-equations system?

4 views (last 30 days)
Hello,
I have a dataset of 'x' and 'y' values which are described by two equations of type:
x = f(s,t,a)
y = f(s,t,a)
Both equations are linked through the variable 'a': one value for 'a' gives an x/y-pair through the two equations. 's' and 't' are fix parameters which I would like to find out through the fitting process.
Now, how should I proceed? Basically, the program first should fix 's' and 't', then find the 'a'-values which give 'x'-values fitting to the dataset. Then it should use those 's', 't', and 'a'-values in the 2nd equation to check if the resulting 'y'-values fit the dataset. I'm not sure which modules or commands might be helpful here.
Below you'll find the detail of the equations ('v1' and 'v2' are parameters I know; 'b' is there to shorten the equations for 'x' and 'y', it is itself a function of 's','t' and 'a'). Thanks in advance for your help :-)
x=(1+2*s*a)/v1*sqrt(a^2-4*b)
y=v1*v2/(a+s*(a^2-2*b)+t*b)
with b=f(s,t,a)=(a+2*s*a^2-v1)/(4*s-2*t)
Minimum value for a is: a(min)=(sqrt(1+2*v1*(2*s+t))-1)/(2*s+t)
  2 Comments
Star Strider
Star Strider on 13 Feb 2020
I have absolutely no idea what you are doing (‘a’ and ‘b’ appear in the equations, although not in your discussion of them), so I am not posting this as an Answer.
% % % MAPING: s = p(1), t = p(2)
% x=(1+2*s*a)/v1*sqrt(a^2-4*b)
% y=v1*v2/(a+s*(a^2-2*b)+t*b)
v1 = 3;
v2 = 5;
syms a b s t v1 v2 x y z
Eq1 = x == (1+2*s*a)/v1*sqrt(a^2-4*b);
Eq2 = y == v1*v2/(a+s*(a^2-2*b)+t*b);
st = solve([Eq1,Eq2], [s t]);
s = simplify(st.s, 'Steps',500)
t = simplify(st.t, 'Steps',500)
producing:
s =
((v1*x)/(a^2 - 4*b)^(1/2) - 1)/(2*a)
t =
((v1*x)/(a^2 - 4*b)^(1/2) - 1)/a - (a*((v1*x)/(2*(a^2 - 4*b)^(1/2)) + 1/2))/b + (v1*v2)/(b*y)
Use the matlabFunction function to convert these to anonymous functions.
Yannick Geiger
Yannick Geiger on 13 Feb 2020
Edited: Yannick Geiger on 13 Feb 2020
Thanks for your comment. I've edited my original post to highlight the different parameters and variables: actually I do discuss 'a'; 'b' is there just to shorten the expressions for 'x' and 'y'. 'b' is itself a function of 's','t' and 'a'. Is this more clear now?
I put here the two equations in full length, with the 'b'-part integrated:
x=(1+2*s*a)/v1*sqrt(a^2-4*(a+2*s*a^2-v1)/(4*s-2*t))
y=v1*v2/(a+s*(a^2-2*(a+2*s*a^2-v1)/(4*s-2*t))+t*(a+2*s*a^2-v1)/(4*s-2*t))
Minimum value for 'a' is: a(min)=(sqrt(1+2*v1*(2*s+t))-1)/(2*s+t)

Sign in to comment.

Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!