MATLAB Answers

0

Trying to start optimization problem (minimization) with constraints

Asked by Abby Thomas on 3 Apr 2019
Latest activity Answered by Torsten
on 4 Apr 2019
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 Comments

Sign in to comment.

1 Answer

Answer by Torsten
on 4 Apr 2019

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 Comments

Sign in to comment.