Trying to start optimization problem (minimization) with constraints
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
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')
Antworten (1)
Torsten
am 4 Apr. 2019
0 Stimmen
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.
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!