Symbolic Fraction Summation with Common Denominator
조회 수: 38 (최근 30일)
이전 댓글 표시
Hello there, hope you are all doing well.
I have two symbolic fractions with different denominators and I would like to know the result of the subtraction of them. I tried simplify and simplifyFraction functions; however they do not yield the result I want. I want the result to be in the form of A/B.
Here are the fractions and the result I get:
syms M1 M2 K1 K2 B s
T1 = (B*s + K1)/ ((M1*M2)*s^4 + (M1*B+M2*B)*s^3 + (M1*K1+M2*K1+M1*K2)*s^2 + (B*K2)*s + (K1*K2));
T = (M1*s^2 + B*s + K1) / ((M1*M2)*s^4 + (B*M1+B*M2)*s^3 + (K1*M1+K1*M2+K2*M1)*s^2 + (B*K2+B*K1-B)*s + (K1^2 -K1 + K1*K2));
T2 = T1 - T
T2 =
(K1 + B*s)/(M1*M2*s^4 + (B*M1 + B*M2)*s^3 + (K1*M1 + K1*M2 + K2*M1)*s^2 + B*K2*s + K1*K2) - (M1*s^2 + B*s + K1)/(s^3*(B*M1 + B*M2) - K1 + s^2*(K1*M1 + K1*M2 + K2*M1) + K1^2 + s*(B*K1 - B + B*K2) + K1*K2 + M1*M2*s^4)
Can you tell me which specific function I need to use to obtain the T2 in the form of A/B?
댓글 수: 1
Swatantra Mahato
2020년 11월 19일
Hi Kaan,
When I execute the "simplifyFraction" function as below
T2 = simplifyFraction(T1 - T)
I get the output in the form A/B
T2 =
-(- B^2*K1*s^2 + B^2*s^2 - 2*B*K1^2*s + 2*B*K1*s + B*M1^2*s^5 + M2*B*M1*s^5 + K2*B*M1*s^3 - K1^3 + K1^2 + K1*M1^2*s^4 + M2*K1*M1*s^4 + K2*K1*M1*s^2 + M2*M1^2*s^6 + K2*M1^2*s^4)/((K1*K2 + B*K2*s + B*M1*s^3 + B*M2*s^3 + K1*M1*s^2 + K1*M2*s^2 + K2*M1*s^2 + M1*M2*s^4)*(K1^2 - B*s - K1 + K1*K2 + B*K1*s + B*K2*s + B*M1*s^3 + B*M2*s^3 + K1*M1*s^2 + K1*M2*s^2 + K2*M1*s^2 + M1*M2*s^4))
Can you provide the expected result and if you obtain it by solving by hand?
Thanks
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!