Solving cubic equation with imaginary numbers

조회 수: 4 (최근 30일)
jayvoor
jayvoor 2022년 12월 2일
댓글: jayvoor 2022년 12월 2일
Hi everyone
I want to solve this equation by multiplying these variables with imaginary numbers and get clear result with s variable and output is in some weird form. What's wrong?
My code below .
clc;
clear;
s1 = 133.9457 + 253.416i
s2 = 133.9457 - 253.416i
s3 = 1339.457
syms s
x = solve(0.00017493*(s-s1)*(s-s2)*(s-s3))
Thanks in advance

채택된 답변

Stephan
Stephan 2022년 12월 2일
편집: Stephan 2022년 12월 2일
s1 = 133.9457 + 253.416i;
s2 = 133.9457 - 253.416i;
s3 = 1339.457;
syms s
x_exactly = solve(0.00017493*(s-s1)*(s-s2)*(s-s3))
x_exactly = 
x_numeric = double(x_exactly)
x_numeric =
1.0e+03 * 1.3395 + 0.0000i 0.1339 - 0.2534i 0.1339 + 0.2534i
  댓글 수: 3
Stephan
Stephan 2022년 12월 2일
s1 = 133.9457 + 253.416i;
s2 = 133.9457 - 253.416i;
s3 = 1339.457;
syms s
x_exactly = expand(0.00017493*(s-s1)*(s-s2)*(s-s3))
x_exactly = 
jayvoor
jayvoor 2022년 12월 2일
Thank you very much!! Have a good day sir :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numbers and Precision에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by