How do I simplify polynomial coefficients with symbolic variables to the least possible forms?

23 views (last 30 days)
I am working on a two-area LFC system. The characteristic polynomials are represented as a function of system parameters (symbolic variables). Here, I want to simplify the polynomial coefficients to their simplest form. I tried using Matlab's "simplify" and "collect" functions, but I was unable to achieve the desired result. I welcome your recommendations.

Answers (1)

John D'Errico
John D'Errico on 26 Apr 2023
The simplest form in your eyes is not always what a computer sees as the simplest form. It may require factoring the polynomial to make it looks better. But that need not be easy to find those factors. You can try using the simplify options.
help simplify
simplify - Algebraic simplification This MATLAB function performs algebraic simplification of expr. Syntax S = simplify(expr) S = simplify(expr,Name,Value) Input Arguments expr - Input expression symbolic expression | symbolic function | symbolic vector | symbolic matrix Name-Value Arguments All - Option to return equivalent results false (default) | true Criterion - Simplification criterion 'default' (default) | 'preferReal' IgnoreAnalyticConstraints - Simplification rules false (default) | true Seconds - Time limit for the simplification process Inf (default) | positive number Steps - Number of simplification steps 1 (default) | positive number Examples Simplify Expressions Simplify Matrix Elements Get Simpler Results for Logarithms and Powers Get Simpler Results Using More Simplification Steps Get Equivalent Results for Symbolic Expression Separate Real and Imaginary Parts Avoid Imaginary Terms in Exponents Simplify Units Get Simpler Result by Expanding Expression See also collect, combine, expand, factor, horner, numden, rewrite, simplifyFraction, Simplify Symbolic Expression Introduced in Symbolic Math Toolbox before R2006a Documentation for simplify doc symbolic/simplify Other uses of simplify digraph/simplify InputOutputModel/simplify explicitMPC/simplify polyshape/simplify graph/simplify sym/simplify
For example:
syms x y
P = x^2 + 4*x + 4 + x*y
P = 
But is the expression
(x+2)^2 + x*y
ans = 
a simpler expression? Sometimes simplfy can give you a better result. But here it does not.
simplify(P,'steps',100,'all',true)
ans = 
  1 Comment
Suud Hasen
Suud Hasen on 26 Apr 2023
I employed the function, but it didn't provide a simplified form. I have manually computed some of the coefficients just for comparison however some of the coefficients are too huge to be manually computed.

Sign in to comment.

Categories

Find more on Polynomials in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!