Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Trying to start optimization problem (minimization) with constraints

1 vue (au cours des 30 derniers jours)
Abby Thomas
Abby Thomas le 3 Avr 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
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')

Réponses (1)

Torsten
Torsten le 4 Avr 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.

Community Treasure Hunt

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

Start Hunting!

Translated by