You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Dew.Math.Units Namespace > Classes > Polynoms Class > Polynoms Methods > Polynoms.DeConv Method
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
Polynoms.DeConv Method

Divide polynomials, deconvolution.

Syntax
C#
Visual Basic
public static void DeConv(TVec B, TVec A, TVec Quot, TVec Remain);

The procedure deconvolves vector A out of vector B. If vectors A and B are treated as polynomial coefficients, the the deconvolution is equal to polynomial division. In this case the DeConv divides polynomial B with polynomial A and returns the quotient in Quot and remainder in Remain. An exception is raised if A and B complex properties do not match. An exception is raised if |A.Values[0]| = 0

NOTE To perform polynomial multiplication, use the TVec.Convolve method.

Below are two cases. In the first case the following division is performed. 

 

(x - 1) * (x - 2) * (x - 2) -------------------------------- = (x - 1) * (x - 2) 1*x^3 - 5*x^2 + 8x - 4 -------------------------- = x - 2 x^2 - 3x + 2

 

For the first example the ratio is x-2, and the reminder is zero. The second case demonstrates that division can be done also for complex polynomials giving complex result and reminder.

using Dew.Math; using Dew.Math.Units; using Dew.Math.Editors; namespace Dew.Examples { private void Example() { Vector A = new Vector(0); Vector B = new Vector(0); Vector Ar = new Vector(0); Vector Br = new Vector(0); Vector Q = new Vector(0); Vector R = new Vector(0); // Case 1 Ar.SetIt(false,new double[] {1,2}); // Define roots of the polynomial A: Polynoms.PolyCoeff(Ar,A); // get coefficients = (X - 1)* (X - 2) Br.SetIt(false,new double[] {1,2,2}); // Define roots of the polynomial B: Polynoms.PolyCoeff(Br,B); //get coefficents = (X - 1)* (X - 2) * (X - 2) Polynoms.DeConv(B,A,Q,R); // Q = [ 1, -2 ] // R = [ 0 ] MtxVecEdit.ViewValues(Q,"Q",true); MtxVecEdit.ViewValues(R,"R",true); // Case 2 B.SetIt(true,new double[] {2,-1, 2,3, 0,5}); A.SetIt(true,new double[] {0,2, 1,-3, 2,2}); Polynoms.DeConv(B,A,Q,R); // Q = [ -0.5 - i ] // R = [ 0 , 5.5 + 2.5i, -1 + 8i] MtxVecEdit.ViewValues(Q,"Q",true); MtxVecEdit.ViewValues(R,"R",true); } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!