How to fit a parameter-bound two-equations system?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Star Strider
el 13 de Feb. de 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)
Yannick Geiger
el 13 de Feb. de 2020
Editada: Yannick Geiger
el 13 de Feb. de 2020
Respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!