![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/181068/image.jpeg)
Solving for multiple variables
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Prathap
am 15 Sep. 2014
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/181068/image.jpeg)
If it is possible to fit any other equation (polynomial or trigonometric), would be helpful.
Antworten (2)
Star Strider
am 19 Okt. 2012
Bearbeitet: Star Strider
am 19 Okt. 2012
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.
0 Kommentare
Ryan G
am 18 Okt. 2012
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 Kommentare
Walter Roberson
am 19 Okt. 2012
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
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!