How to fit a parameter-bound two-equations system?
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
Star Strider
2020-2-13
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)
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!