Hi, I am trying to find the maximum value of 'Pa' in this code with respect to 'a' while others are known. I wrote a following program. where I am wrong. As I am new to matlab, please help me.
clear all
clc
syms a
K=((1+(kh/(1-kv)))/(cos(d)+sin(d)*tan(a-p)))*((1/tan(a))+nq*(lf-l));
Pa=0.5*g*(1-kv)*K*H^2;
solve(diff(Pa)==0,a)

댓글 수: 6

KSSV
KSSV 2019년 3월 13일
Why use syms ? define all the values and get them and use max.
like this? then it shows :Undefined function or variable 'a'.
clear all
clc
kh=0.1;
kv=0;
d=26*(pi/180);
p=39*(pi/180);
lf=0.2;
l=0.1;
nq=1.35;
g=18.4;
H=4;
kagq=((1+(kh/(1-kv)))/(cos(d)+sin(d)*tan(a-p)))*((1/tan(a))+nq*(lf-l));
Pa=0.5*g*(1-kv)*kagq*H*H;
max(Pa,a)
KSSV
KSSV 2019년 3월 13일
What are the possibles values of a?
Akshay Pratap Singh
Akshay Pratap Singh 2019년 3월 13일
0 to 1.5
Akshay Pratap Singh
Akshay Pratap Singh 2019년 3월 13일
But I want also an expression for a.
madhan ravi
madhan ravi 2019년 3월 13일
The maximum value of Pa is inf when a is zero. Perhaps?

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

답변 (1개)

Yasasvi Harish Kumar
Yasasvi Harish Kumar 2019년 3월 13일

0 개 추천

Hi,
clear
clc
syms a;
kh=0.1;
kv=0;
d=26*(pi/180);
p=39*(pi/180);
lf=0.2;
l=0.1;
nq=1.35;
g=18.4;
H=4;
kagq=((1+(kh/(1-kv)))/(cos(d)+sin(d)*tan(a-p)))*((1/tan(a))+nq*(lf-l));
Pa=0.5*g*(1-kv)*kagq*H*H;
possition = vpasolve(diff(Pa)==0,a); % a value for maxima
I think this should solve it.
Regards

댓글 수: 1

madhan ravi
madhan ravi 2019년 3월 13일
편집: madhan ravi 2019년 3월 13일
The calculus approach is true but the result is not within the bounds 0 to 1.5 even if the range is specified in vpasolve() empty sol will be returned , meaning maxima does not exist in the given range.

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

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2019년 3월 13일

편집:

2019년 3월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by