필터 지우기
필터 지우기

Solving for multiple variables

조회 수: 1 (최근 30일)
Nathan
Nathan 2012년 10월 18일
댓글: Prathap 2014년 9월 15일
Hi,
I am trying to solve the Magic Formula (tire simulation) for the variables B, C, D and E in the equation below. I have been given a set of X and Y values. I am not very familiar with MATLAB and don't know where to start. Any feedback would be very helpful.
Y=D*sin[C*arctan{(1-E)*B*X+E*arctan(B*X)}]
  댓글 수: 1
Prathap
Prathap 2014년 9월 15일
Hi all, I am working on similar problem. I have to find the equation using magic formula to model a friction damper to be used in ADAMS software for dynamic simulation. I have the damper characteristic curve from which I extracted data points. Now I have to fit a curve equation that would fit the behavior it.
If it is possible to fit any other equation (polynomial or trigonometric), would be helpful.

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

답변 (2개)

Star Strider
Star Strider 2012년 10월 19일
편집: Star Strider 2012년 10월 19일
Since you have a set of (X,Y) values, my guess is that you may want to estimate the numeric values of B, C, D, and E. I suggest this approach:
% B = P(1), C = P(2), D = P(3), E = P(4)
MagicFormula = @(P,X) P(3).*sin(P(2).*atan((1-P(4)).*P(1).*X+P(4).*atan(P(1).*X))); % Anonymous function version of the Magic Formula
% Choose an appropriate initial estimate ...
Beta0 = rand(4,1);
% Then either ...
[Beta,R,J,CovB,MSE] = nlinfit(X, Y, MagicFormula, beta0);
% or ...
[Beta,resnorm,residual,exitflag,output,lambda,jacobian] = lsqcurvefit(MagicFormula, Beta0, X, Y);
% ‘Beta’ is the vector corresponding to the estimated values of B, C, D, and E
If you have more than four distinct (X,Y) data pairs, you can likely identify your parameters uniquely. Note that nonlinear curve fitting is inherently heuristic, so you may have to attempt several different sets (and perhaps magnitudes) of starting values for Beta0 to get a good fit. (If you know about what they should be, start with those values.) See the documentation for nlinfit (Statistics Toolbox) and lsqcurvefit (Optimization Toolbox) for details.

Ryan G
Ryan G 2012년 10월 18일
You have 1 equation and 4 unknowns. Assuming you have at least 4 sets of X/Y values you can split this into 4 equations with 4 unknowns.
Once you have the 4 equations you can use something like the symbolic toolbox to solve for the 4 equations.
  댓글 수: 5
Ryan G
Ryan G 2012년 10월 19일
편집: Ryan G 2012년 10월 19일
Shouldn't matter. See how walter's answer has 3 equations, 3 unknowns and has vectors x and y. x and y do not need to by symbolic as they are vectors of data.
Edit: Agree with Walter, what I meant was the syntax should be the same.
Walter Roberson
Walter Roberson 2012년 10월 19일
There will be some differences in output and internal workings for R2007, as R2007's Symbolic Toolbox would have been based upon Maple rather than MuPAD

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by