how to find the maximum symbolic value of a function with matlab

12 views (last 30 days)
Hello
I am traing to find the max value of the asynchronous motor efficiency (mu)
by finding its dervitive with respect to the slip (s) so i am using the sympolic dervitive but it alawys gives me ( Empty sym: 0-by-1 ) for of the roots of the differentiation of the efficiency (mu)
can you help me to find the maximum value of ( mu)
here's my codes
syms x2 s Zin Vth Pr Sr v1 r2 Xm r1 x1 X2 ws T(s) ;
I1=v1/((-X2* Xm+(r2/s)*j*Xm) )/( r2/s+ j*X2+j*Xm)+r1+j*x1 ;
Zin =((-X2* Xm+(r2/s)*j*Xm) )/( r2/s+ j*X2+j*Xm)+r1+j*x1 ;
I2= I1*(j*Xm/( r2/s+ j*X2+j*Xm)) ;
Pm=(3*(r2/s)*(1-s)*I2^2);
Pin=sqrt(3)*v1*I1;
mu =Pm/Pin;
a=diff(mu,s) ;
roots(a)
  1 Comment
dpb
dpb on 1 Jun 2019
Edited: dpb on 1 Jun 2019
As noted on the newsgroup, we can't do anything w/o the coefficients to go with it...
BTW, use the code formatting to clean up your code and also then folks can just copy it by click...(select the code section and use the button or CTRL-E)

Sign in to comment.

Answers (1)

John D'Errico
John D'Errico on 1 Jun 2019
Almost certainly not gonna happen. As long as you keep all the coefficients symbolic, the result will be a fairly high order mess as a function of s. There will be no symbolic solution.
Of course, at the end, trying to use roots is silly, since roots is a purely numerical solver, designed to work on a list of coefficients of a polynomial. This is not a polynomial, and it is not purely numeric. So roots will NEVER suffice there. You would need to use solve. It still will fail miserably though, because no analytical solution will exist.
Worse, even if solve did give you a solution? Probably there would be multiple solutions too. You would not know if it was a minimum or a maximum, because that would depend on all of those completely unknown parameters!
If, and I do mean IF, you supply values for ALL of the unknown parameters, except for s, then you could treat this as a simple problam of maximization of a function of one variable. Even then, you surely won't get a symbolic solution, with all the roots listed neatly out for you.
It is surprsingly easy to pose a problem in mathematics with no analytical solution.
pretty(mu)
2 / v1 \
sqrt(3) Xm r2 (s - 1) | r1 + x1 1i - ------------------------------------------- |
| / Xm r2 1i \ / r2 \ |
| | X2 Xm - -------- | | X2 1i + Xm 1i + -- | |
\ \ s / \ s / /
-----------------------------------------------------------------------------------
/ r2 \2
s v1 | -- + X2 1i + Xm 1i |
\ s /
pretty(diff(mu,s))
2 / r2 v1 Xm r2 v1 1i \
sqrt(3) Xm r2 | --------- - ----------- | (s - 1)
2 2 | 2 2 2 2 | 2 2
sqrt(3) Xm r2 #1 sqrt(3) Xm r2 (s - 1) #1 \ s #3 #5 s #3 #4 / sqrt(3) Xm r2 (s - 1) #1 2
----------------- - ------------------------- - -------------------------------------------------- + ----------------------------
#2 2 2 #2 3 3
s v1 #5 s v1 #5
where
v1
#1 == r1 + x1 1i - -----
#3 #4
2
#2 == s v1 #5
Xm r2 1i
#3 == X2 Xm - --------
s
r2
#4 == X2 1i + Xm 1i + --
s
r2
#5 == -- + X2 1i + Xm 1i
s
  1 Comment
dpb
dpb on 1 Jun 2019
"If, and I do mean IF, you supply values for ALL of the unknown parameters, except for s, then you could treat this as a simple problam of maximization of a function of one variable."
You obviously already knew that was where I was next going to point OP, John! :)

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!