I am trying to perform the second derivative test of this function I came up with

4 次查看(过去 30 天)
Trying to do the second derivative test to find the minimum W, but none of this code is working. How do I get the critical points and then the second derivative to test if those points are a minimum. Also how do I go back and plug them into the equation for R and W when I set them up as syms.
E = 9.9*10^6;
p = .098;
F = 1500;
L = 20;
g = 32.2*12;
I = (F*L^2)/(E*pi^2);
syms R1 t
x = I == (pi/4)*(((R1+t)^4)-(R1^4));
R = solve(x, R1, 'MaxDegree', 4);
W0 = 2.*pi.*p.*L.*g.*t.*R;
disp(W0);
W = inline(W0,'t');
disp(W);
dW = diff(W(t),t)==0;
disp(dW);
cp = vpasolve(dW,t);

采纳的回答

Walter Roberson
Walter Roberson 2024-2-29
编辑:Walter Roberson 2024-2-29
Q = @(v) sym(v);
Pi = Q(pi);
E = Q(9.9)*10^6;
p = Q(.098);
F = Q(1500);
L = Q(20);
g = Q(32.2)*12;
I = (F*L^2)/(E*Pi^2);
syms R1 t
x = I == (Pi/4)*(((R1+t)^4)-(R1^4));
R = solve(x, R1, 'MaxDegree', 4);
W0 = 2.*Pi.*p.*L.*g.*t.*R;
disp(W0);
dW = diff(W0,t)==0;
disp(dW);
cp = arrayfun(@(F) solve(F,t), dW(1), 'uniform', 0)
cp = 1×1 cell array
{4×1 sym}
cp{1}
ans = 
vpa(cp{1})
ans = 
Hmmm... those look suspiciously similar...
Note that the general solution involves
cp = arrayfun(@(F) solve(F,t), dW, 'uniform', 0)
I had to restrict it to dW(1) to fit within the time limits here.
  2 个评论
Oliver Ries
Oliver Ries 2024-2-29
So for me it is only outputting the imaginary number, but not the rest. Since the imaginary number is so similar to the real number, I might just extract the leading part of it and use it as the real number. Unless would you be willing to help me figure out how to display all of these critical points.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear Algebra 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by