Trying to start optimization problem (minimization) with constraints
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
I'm having trouble figuring out how to optimize a multivariable equation so that the variables are minimized within the function. The theta function is what I am trying to work with. I have c, J, k defined but I really need to find those values if I have the constraints of:
theta (@ t=2) = 0
differential of theta(@ t=2) = 0
Any help would be much appreciated!
%% Constants/Variables
c = 110;
J = 200; % these values give -3.43 degrees and -.737 radians/second
k = 200;
t = 1:1:10;
%% Equation
%optimtool
%syms t
theta(t) = exp((-c.*t)./(2.*J)).*(((1.309.*c)./(2.*J.*sqrt((k./J)-(c./(2.*J)).^2)).*sin(t.*sqrt((k./J)-(c./(2.*J)).^2))) + (1.309.*cos(t.*sqrt((k./J)-(c./(2.*J)).^2))));
% y = diff(theta);
% vpa(subs(y,t,2))
plot(t, theta,'o')
0 个评论
回答(1 个)
Torsten
2019-4-4
0 个投票
Setting cJ= c/(2*J) and kJ = k/J, you arrive at
theta(t) = exp(-cJ*t)*(1.309*cJ/sqrt(kJ-cJ^2)*sin(t*sqrt(kJ-cJ^2)) + 1.309*cos(t*sqrt(kJ-cJ^2)));
Now you can solve for cJ and kJ from the conditions theta(2) = theta'(2) = 0.
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!