필터 지우기
필터 지우기

Optimization problem for trigonometric functions

조회 수: 4 (최근 30일)
Chhatrola Parth Mukeshbhai
Chhatrola Parth Mukeshbhai 2021년 3월 12일
편집: ANKUR KUMAR 2021년 3월 12일
How to minimize below equation wrt θ (Theta) where k, l0, cotθ0, r1 and r2 constant only variable is theta

답변 (2개)

ANKUR KUMAR
ANKUR KUMAR 2021년 3월 12일
편집: ANKUR KUMAR 2021년 3월 12일
If k, lo, r1, and r2 are constants, you can use anonymous function to calculate the expression:
k=randi(10,1,1);
lo=randi(10,1,1);
r1=randi(10,1,1);
r2=randi(10,1,1);
% theta in degree
func = @(theta) (k*lo*cotd(theta)/r1^4)+(k*lo*((cscd(theta)/r2^4)-(cotd(theta)/r1^4)))
func(25) % make sure to put values in degree, not in radians
You can write multiple values while calling the function
func([25,45,120,160])

David Hill
David Hill 2021년 3월 12일
I learned that you take the derivative of the function and set it to zero to find the points of relative minimum and maximum.
theta=acos((r2/r1)^4);%after simplifying

카테고리

Help CenterFile Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by