Bắt đầu ngayBắt đầu miễn phí

Find the second derivative

Now that you have the derivative of your objective function, you can calculate the second order derivative. You'll do so symbolically using sympy.

The values for dc_dq and q_opt, and the objective function c with the quantity variable q from the previous exercise are available to you.

Bài tập này là một phần của khóa học

Introduction to Optimization in Python

Xem khóa học

Bài tập tương tác thực hành trực tiếp

Hãy thử làm bài tập này bằng cách hoàn thành đoạn mã mẫu này.

# Find the second derivative
d2c_dq2 = ____

# Substitute the optimum into the second derivative
sol = ____(____)
print(f"The 2nd derivative at q_opt is: {sol}")
Chỉnh sửa và Chạy Mã