Get one equation from two complex roots

3 visualizzazioni (ultimi 30 giorni)
Tam Li Na
Tam Li Na il 2 Set 2022
Risposto: John D'Errico il 2 Set 2022
Hi, I would like to ask if it is possible to get a single equation from this expression (s-(-9+j*3))*(s-(-9-j*3)).
I tried to use syms s (to declare s as a variable) but I only get a simplified form of this expression which is (s+9-j*3))(s+9+j*3)) as the answer.
I calculated by hand that the equation in the end should be s^2+18*s+90.
Thank you.

Risposte (2)

KSSV
KSSV il 2 Set 2022
syms s
eqn = (s-(-9+1i*3))*(s-(-9-1i*3)) ;
simplify(eqn)
ans = 

John D'Errico
John D'Errico il 2 Set 2022
You can use
help sym/expand
EXPAND Symbolic expansion. EXPAND(S) writes each element of a symbolic expression S as a product of its factors. EXPAND is most often used on polynomials, but also expands trigonometric, exponential and logarithmic functions. EXPAND(S,'ArithmeticOnly',true) limits expansion to basic arithmetic, whereas EXPAND(S,'ArithmeticOnly',false) (which is the default) will also expand trigonometric and other special functions. EXPAND(S,'IgnoreAnalyticConstraints',VAL) controls the level of mathematical rigor to use on the analytical constraints while simplifying (branch cuts, division by zero, etc). The options for VAL are TRUE or FALSE. Specify TRUE to relax the level of mathematical rigor in the rewriting process. The default is FALSE. Examples: syms x y expand((x+1)^3) returns x^3+3*x^2+3*x+1 expand(sin(x+y)) returns sin(x)*cos(y)+cos(x)*sin(y) expand(exp(x+y)) returns exp(x)*exp(y) expand((exp(x+y)+1)^2,'ArithmeticOnly',true) returns exp(2*x + 2*y) + 2*exp(x + y) + 1 expand(log(x*y)) returns log(x*y) expand(log(x*y),'IgnoreAnalyticConstraints',true) returns log(x)+log(y) See also SYM/SIMPLIFY, SYM/FACTOR, SYM/COLLECT. Documentation for sym/expand doc sym/expand
to force MATLAB to expand an expression that contains parens.
syms s
expand((s-(-9+i*3))*(s-(-9-i*3)))
ans = 

Community Treasure Hunt

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

Start Hunting!

Translated by