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

조회 수: 2 (최근 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.
Oliver Ries
Oliver Ries 2024년 2월 29일
It works, I just need to figure out how to display all the critical points.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by