private void subMatrixExecute() { try { MatrixA.SaveElements(); MatrixB.SaveElements(); Matrix result = MatrixA.matrix - MatrixB.matrix; MatrixC = new MatrixVM("C", result); } catch (Exception e) { MessageBox.Show(e.Message); } }
/*========================================================================== * Function: PoleLocation * Arguments: None * Returns: One Vector */ public override ComplexNumber[] PoleLocation() { int poleNumber = MatrixA.GetLength(1); //Compute pole location ComplexNumber[] poleLocation = new ComplexNumber[poleNumber]; for (int i = 0; i < poleNumber; i++) { poleLocation[i] = new ComplexNumber(1, 0); } // Return the pole vector return(poleLocation); }
/*========================================================================== * Function: ToDiscreteTimeSystem * Arguments: double * Returns: One DTModel */ public DTModel ToDiscreteTimeSystem(double ts) { // Define local variable double[,] newMatrixA = new double[MatrixA.GetLength(1), MatrixA.GetLength(0)]; double[,] newMatrixB = new double[MatrixB.GetLength(1), MatrixB.GetLength(0)]; double[,] newMatrixC = new double[MatrixC.GetLength(1), MatrixC.GetLength(0)]; double[,] newMatrixD = new double[MatrixD.GetLength(1), MatrixD.GetLength(0)]; // Calculate matrix exponetial to obtain new matrix // Update newMatrixA, newMatrixB, newMatrixC, newMatrixD // Create a discrete time system DTModel dtSystem = new DTModel(newMatrixA, newMatrixB, newMatrixC, newMatrixD, ts); Console.WriteLine("CT system is transfered to DT system!!"); // Return discrete time system return(dtSystem); }
private Point3d getPositionFromIndex(int i, int j, int k) { Point4d pt4 = MatrixA.LeftMultiply(new Point4d(i, j, k, 1)); return(new Point3d(pt4.X, pt4.Y, pt4.Z)); }