필터 지우기
필터 지우기

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

조회 수: 6 (최근 30일)
Yannick Geiger
Yannick Geiger 2020년 2월 13일
편집: Yannick Geiger 2020년 2월 13일
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
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)
Use the matlabFunction function to convert these to anonymous functions.
Yannick Geiger
Yannick Geiger 2020년 2월 13일
편집: Yannick Geiger 2020년 2월 13일
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)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by