Matlab symbolic cannot separate real from imaginary
조회 수: 2 (최근 30일)
이전 댓글 표시
I am attempting to seperate a complex expression using Matlab's symbolic package.
I have some real V and r, and I know something about the relation between them (i.e., the square root of 9*V^2 - 4/3*V*sym('pi')*r^3 is complex). However, Matlab will not seperate the real and imaginary parts of the expression, even if I used "preferReal" in simplify().
syms V r
assume(V >= 0)
assumeAlso(V,'real')
assumeAlso(r >= 0)
assumeAlso(r,'real')
assumeAlso((9*V^2 - 12*V*sym('pi')*r^3) < 0) % criterion about the relation between V and r
eq = pi / 3 * h^3 - pi * r *h^2+V == 0;
sol = solve(eq, h, 'MaxDegree',3);
simplify(real(sol(1)),'Criterion','preferReal' ,'Steps', 200)
The output of this is,
So basically, the second term (with the complex number in the denominator) is left Re(complex), which is not very helpful.
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!