Using complex numbers in Fletcher Reeves optimization method

Hello,
I would like to minimize a function of 4 complex variables with the Fletcher Reeves optimization method (Conjugate Gradient VI).
Is it possible to do it with this VI or with HiQ4.5 ?
(for S-parameters specialists) The purpose is to de-embed using optimization method.
Thanks,
Dze

I believe that the "Conjugate Gradient nD.vi" and the optimize function in HiQ only work with real vectors. Most of the solve functions in HiQ work with complex numbers, and you may be able to create your own algorithm for the purpose, but I don't think that there is already a function that will do quite what you want.

Similar Messages

  • Using complex numbers/vectors

    I am trying to use the CNiMath::FFT(CNiComplexReal64 &x) function. I don't know how to set up the CNiComplexReal64 vector - I have no information on how to format the real and imaginary parts. Any easy example would be sufficient to get going on it. I have a vector of my real values and a vector of imaginary values if that can somehow be converted to the CNiComplexReal64 type. Thanks.

    Hello
    Check out the fft example that is installed with Measurement Studio, you can find it under ..\MeasurementStudio\VC\Examples\Analysis\Fft.
    The CNiMath::FFT has 2 overloads
    static MathError FFT(
    CNiComplexReal64Vector& x);
    and
    static MathError FFT(
    CNiReal64Vector& xReal,
    CNiReal64Vector& xImag);
    You can use the second overload, since you already have the data in that form. Check out the documentation for the CNiReal64Vector for more informtion on its available constructors and properties.
    Thanks
    Bilal Durrani
    NI
    Bilal Durrani
    NI

  • Hp 35s integrating with complex numbers/functions

    Are there any examples of how to integrate a complex function for
    the HP 35s..the manual suggests its possible..but, I can not find one
    example...anywhere... I am just interested in testing.....I do
    not want to break things into parts etc...I just want to try
    e^z for example, where z is complex..any help?
    I have tried xiy, rTheta, x+iy...syntax errors or non existent..funny

    Hi,
    The manual states that complex numbers can be used with EXP(x), but it does not mention anything about using complex numbers for integration. Edit: I missed some text in the manual, see below.
    As far as I can tell it cannot do integration with complex numbers. (The 50g can do this.)
    However, you may get a more definitive answer if you ask your question here:
    http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi
    EDIT: that forum has moved to a new version:
    http://www.hpmuseum.org/forum/forum-4.html
    Note: I do not work for HP, I just like playing with calculators :-)

  • SVD with complex numbers

    I'm working on creating a SVD class using complex numbers. I have an adaptation of the Jama ( http://math.nist.gov/javanumerics/jama/ ) implementation coded which works great with complex numbers with only a real part, but fails when the imaginary is present. I also coded up a port of numerical recipes' ( http://www.nr.com ) implementation, but am unable to get it to converge. I'm 99.9% sure that the problem does not exist in my complex number class as it has worked fine up until now.
    Anyhow, what I'm wondering is if anyone has a Java SVD for complex matrices that I could look at and/or use?
    Thanks in advance,
    m

    It wasn't working when I tried it a few months ago. I found the bug in the database - it's been long-standing. Given that Sun doesn't appear to be supporting Java3D very well, I doubt it'll ever be fixed.
    Besides, that SVD algorithm is only for real matricies, I believe. - MOD

  • How to use RLS with complex numbers as the input?

    I import a file which have complex numbers, and I want to filter it using complex RLS adaptive filter, but it always freeze at the filtering and update then it returns one value in the matrix and all the other numbers are NaN, so how can I fix this.
    The second thing is when I use FBLMS, it always return error 42020 unless I specify the filter length= number of the input which is huge number, so how do I specify normal filter length.

    Hi engomar,
    There is a detailed description of how to choose filter length in the Adaptive Filter Tollkit Help file. 
    http://zone.ni.com/reference/en-XX/help/372357B-01/lvaftconcepts/aft_choose_filterlength/
    This page has several links to other important factors of what filter to choose. Under Computational Resource Requirements, it lists the memory usage for different filter types. RLS is the most memory intensive, which could be causing the freeze. Maybe try a LMS to see if this helps.
    Robert R. | Applications Engineer | National Instruments

  • Complex Numbers problem

    I am having problems getting this Complex Numbers program to work correctly. i want to display using format a+bi the addition, subtraction and multiplication of 2 complex numbers.Can anyone reply today?
    class Complex
         private double realPart, imaginaryPart;
         public Complex()
              realPart = 0.0;
              imaginaryPart = 0.0;
         public static void main(String [] args)
              Complex c;
              double res;
              c = new Complex();
              Screen.message("-------------------MENU----------------------------");
              Screen.newline(2);
              Screen.message("Please enter a number: ");
              Keyboard.readDouble();
              res = c.get_realPart();
              Screen.newline();
              Screen.message("Please enter a second number: ");
              Keyboard.readDouble();
              res = c.get_imaginaryPart();
              Screen.newline(2);
              Screen.message("--------------------------------------------------");
              Screen.newline();
              Screen.message("     Designed by Niall Magner               ");
              Screen.newline();
              Screen.message("--------------------------------------------------");
              Screen.newline(2);
              Screen.writedouble(res);
              Screen.newline();
              Screen.writedouble(res);
              Screen.newline();
              Screen.writedouble(res);
              Screen.newline(2);
         public double get_realPart()
              return realPart;     
         public double get_imaginaryPart()
              return imaginaryPart;
         public void addComplexNum(Complex n1, Complex n2)
              realPart = n1.get_realPart() + n2.get_realPart();
              imaginaryPart = n1.get_imaginaryPart() + n2.get_imaginaryPart();
              Screen.message("-----------------------------------------------");
              Screen.newline(2);
              Screen.message("Number 1 is: " + realPart);
              Screen.message(" + " + imaginaryPart + "i");
              Screen.newline();          
              Screen.message("Number 2 is: " + realPart);
              Screen.message(" + " + imaginaryPart + "i");
              Screen.newline();          
              Screen.message("-----------------------------------------------");
              Screen.newline(2);
         public void subtractComplexNum(Complex n1, Complex n2)
              realPart = n1.get_realPart() - n2.get_realPart();
              imaginaryPart = n1.get_imaginaryPart() - n2.get_imaginaryPart();
              Screen.message("-----------------------------------------------");
              Screen.newline(2);
              Screen.message("Number 1 is: " + realPart);
              Screen.message(" - " + imaginaryPart + "i");
              Screen.newline();
              Screen.message("Number 2 is: " + realPart);
              Screen.message(" - " + imaginaryPart + "i");
              Screen.newline();          
              Screen.message("-----------------------------------------------");
              Screen.newline(2);
         public void multiplyComplexNum(Complex n1, Complex n2)
              realPart = n1.get_realPart() * n2.get_realPart();
              imaginaryPart = n1.get_imaginaryPart() * n2.get_imaginaryPart();
              Screen.message("-----------------------------------------------");
              Screen.newline(2);
              Screen.message("Number 1 is: " + realPart);
              Screen.message(" * " + imaginaryPart + "i");
              Screen.newline();          
              Screen.message("Number 2 is: " + realPart);
              Screen.message(" * " + imaginaryPart + "i");
              Screen.newline();
              Screen.message("-----------------------------------------------");
              Screen.newline(2);
    Any help greatly appreciated.
    Niall Magner

    There are several problems with this code. You never call the add method, so the numbers are never going to be added. You never load up a complex number to add either.
    Try doing something a bit more like this:
      read a float from the keyboard
      read another float from the keyboard
      Create a complex number from this float
      Complex complex1 = new Complex();
      complex1.realPart = first number from above;
      complex1.imaginaryPart = second number from above;
      do this again to get the second complex number
      then add the numbers together
      Complex complexSum = new Complex
      complexSum.addComplexNum(complex1, complex2)
      print complexSum.realPart + "+i" + complexSum.imaginaryPart;
      then do the other operations you wantI would also advise that you take a course in Java Programming, cos the code you have posted is truely awful.

  • Complex Numbers: better implementation

    I've already created a Complex class, with all the mathematical methods necessary. But I've seen at the Internet several attempts to do such classes, and one preferred to make a compiler that accepts complex as a primitive type. And he's right. Creating a class to represent the complex numbers takes too much memory and time only to store two doubles. Using C/C++, complex numbers could be made with structs, and a Complex class would be used to implement the necessary methods, wrapping the complex type, like Double wraps a double.
    So, I'd like to suggest a new type of class. This class would act like
    an C/C++ struct, being able to store only fields and constructors. I believe that this way would make it waste less memory, and enable faster use of this class. It would work like this:
    public value class complex {
      public double real;
      public double imag;
    public class Complex {
      public static final complex I;
      I.real = 0; I.imag = 1;
    }What do you guys think?

    Creating a class to represent the complex
    numbers takes too much memory and time only to store two doubles.If the only fields in the Complex object are two doubles, how much more memory does a Complex object take up? The methods would only appear in the Class object, not each Complex instance. Right?
    I guess you have one reference on the stack and two doubles on the heap, as opposed to two doubles on the stack and nothing in the heap.
    So, I'd like to suggest a new type of class. This
    class would act like an C/C++ struct, being able to store only
    fields and constructors. I believe that this way would
    make it waste less memory, and enable faster use of this class.At this point I wonder whether there'd really be a big memory savings, and whether it would be worth watering down the OOP-ness of the language.
    Defining a complex primitive is another issue.
    Issues like ordering and equality would seem to make the problem really...complex... Perhaps any choice for those issues would only satisfy a third of the interested parties, and any design would satisfy no one.

  • How to use different  numbers ranges in LSMW for a material in 8plants

    Hi all,
    I have to upload data using MM01 in LSMW by using external numbers.
    the MATNR for materials are like this 17240,22818,82618,487218,7218,26418
    how can i take these numbers in LSMW.i have 61 material numbers to be extended to 8plants.can i upload these material numbers at a time in LSMW
    the above material number should be extended to 8plants.but the field values for some fields are varying.the material number should be same for 8plants
    For this issue, which method i should follow in LSMW.

    Just do one thing,
    while recording enter the material numer field by yourself(Not blank).This material is the material which you mention out of 61,
    and upload the same in your upload file, and just change plant.i mean 8 records are there for each material( all 61)
    reward if useful.
    Amit Singla

  • I need help with this program ( Calculating Pi using random numbers)

    hi
    please understand that I am not trying to ask anymore to do this hw for me. I am new to java and working on the assignment. below is the specification of this program:
    Calculate PI using Random Numbers
    In geometry the ratio of the circumference of a circle to its diameter is known as �. The value of � can be estimated from an infinite series of the form:
    � / 4 = 1 - (1/3) + (1/5) - (1/7) + (1/9) - (1/11) + ...
    There is another novel approach to calculate �. Imagine that you have a dart board that is 2 units square. It inscribes a circle of unit radius. The center of the circle coincides with the center of the square. Now imagine that you throw darts at that dart board randomly. Then the ratio of the number of darts that fall within the circle to the total number of darts thrown is the same as the ratio of the area of the circle to the area of the square dart board. The area of a circle with unit radius is just � square unit. The area of the dart board is 4 square units. The ratio of the area of the circle to the area of the square is � / 4.
    To simuluate the throwing of darts we will use a random number generator. The Math class has a random() method that can be used. This method returns random numbers between 0.0 (inclusive) to 1.0 (exclusive). There is an even better random number generator that is provided the Random class. We will first create a Random object called randomGen. This random number generator needs a seed to get started. We will read the time from the System clock and use that as our seed.
    Random randomGen = new Random ( System.currentTimeMillis() );
    Imagine that the square dart board has a coordinate system attached to it. The upper right corner has coordinates ( 1.0, 1.0) and the lower left corner has coordinates ( -1.0, -1.0 ). It has sides that are 2 units long and its center (as well as the center of the inscribed circle) is at the origin.
    A random point inside the dart board can be specified by its x and y coordinates. These values are generated using the random number generator. There is a method nextDouble() that will return a double between 0.0 (inclusive) and 1.0 (exclusive). But we need random numbers between -1.0 and +1.0. The way we achieve that is:
    double xPos = (randomGen.nextDouble()) * 2 - 1.0;
    double yPos = (randomGen.nextDouble()) * 2 - 1.0;
    To determine if a point is inside the circle its distance from the center of the circle must be less than the radius of the circle. The distance of a point with coordinates ( xPos, yPos ) from the center is Math.sqrt ( xPos * xPos + yPos * yPos ). The radius of the circle is 1 unit.
    The class that you will be writing will be called CalculatePI. It will have the following structure:
    import java.util.*;
    public class CalculatePI
    public static boolean isInside ( double xPos, double yPos )
    public static double computePI ( int numThrows )
    public static void main ( String[] args )
    In your method main() you want to experiment and see if the accuracy of PI increases with the number of throws on the dartboard. You will compare your result with the value given by Math.PI. The quantity Difference in the output is your calculated value of PI minus Math.PI. Use the following number of throws to run your experiment - 100, 1000, 10,000, and 100,000. You will call the method computePI() with these numbers as input parameters. Your output will be of the following form:
    Computation of PI using Random Numbers
    Number of throws = 100, Computed PI = ..., Difference = ...
    Number of throws = 1000, Computed PI = ..., Difference = ...
    Number of throws = 10000, Computed PI = ..., Difference = ...
    Number of throws = 100000, Computed PI = ..., Difference = ...
    * Difference = Computed PI - Math.PI
    In the method computePI() you will simulate the throw of a dart by generating random numbers for the x and y coordinates. You will call the method isInside() to determine if the point is inside the circle or not. This you will do as many times as specified by the number of throws. You will keep a count of the number of times a dart landed inside the circle. That figure divided by the total number of throws is the ratio � / 4. The method computePI() will return the computed value of PI.
    and below is what i have so far:
    import java.util.*;
    public class CalculatePI
      public static boolean isInside ( double xPos, double yPos )
         double distance = Math.sqrt( xPos * xPos + yPos * yPos );        
      public static double computePI ( int numThrows )
        Random randomGen = new Random ( System.currentTimeMillis() );
        double xPos = (randomGen.nextDouble()) * 2 - 1.0;
        double yPos = (randomGen.nextDouble()) * 2 - 1.0;
        int hits = 0;
        int darts = 0;
        int i = 0;
        int areaSquare = 4 ;
        while (i <= numThrows)
            if (distance< 1)
                hits = hits + 1;
            if (distance <= areaSquare)
                darts = darts + 1;
            double PI = 4 * ( hits / darts );       
            i = i+1;
      public static void main ( String[] args )
        Scanner sc = new Scanner (System.in);
        System.out.print ("Enter number of throws:");
        int numThrows = sc.nextInt();
        double Difference = PI - Math.PI;
        System.out.println ("Number of throws = " + numThrows + ", Computed PI = " + PI + ", Difference = " + difference );       
    }when I tried to compile it says "cannot find variable 'distance' " in the while loop. but i thought i already declare that variable in the above method. Please give me some ideas to solve this problem and please check my program to see if there is any other mistakes.
    Thanks a lot.

    You've declared a local variable, distance, in the method isInside(). The scope of this variable is limited to the method in which it is declared. There is no declaration for distance in computePI() and that is why the compiler gives you an error.
    I won't check your entire program but I did notice that isInside() is declared to be a boolean method but doesn't return anything, let alone a boolean value. In fact, it doesn't even compute a boolean value.

  • In range and coerce with complex numbers?

    I have an array of complex numbers with these numbers I need to set to 0 all numbers whose real parts are negative. With "in range and coerce" I can split the array into real and imaginary then set all negative numbers to 0 then recombine the complex part but that still leaves me with 0+ai numbers that should be 0. How can I also set the complex part to zero for the negative numbers?

    Hello,
    You can use the following fonction in a for loop with your array.
    Michel

  • Oracle 8i Database and optimization method

    Is an optimizations method used for any entire database or schema? How can I tell which optimization method is being used?

    If you wre talking about optimizer_mode then Eric has already answered it. But if you are looking at optimizing methods of schema structures and database then that that is a big course.

  • Using Complex Data Types in Import JavaBean Model

    Hi,
    I have searched and read forums and weblogs related to import javabean model.
    But I am not clear about how to use complex data types like ArrayList, Collection etc in my java bean.
    If I use these complex datatypes in my bean, when creating model in WDF it displays the Complex data elements in Model Relation. I dont know how to use this model relation in my WD project.
    Anyone please explain the<b> step by step solution</b> about using complex data type(used in Bean) in WD Project.
    Thanks,
    Krishna Kumar

    Hi Krishna,
    Valery`s blog contains sample code ( http://www.jroller.com/resources/s/silaev/Employees.zip )
    Another blogs from this area:
    /people/anilkumar.vippagunta2/blog/2005/09/02/java-bean-model-importer-in-web-dynpro
    /people/valery.silaev/blog/2005/08/30/javabean-model-import-when-it-really-works
    And forum topics:
    Import JavaBean Model
    Problem Importing JavaBean Model in NetWeaver Developer Studio
    Issue on "Import JavaBean Model"
    import  JavaBean Model: no executable Methods?
    JavaBeans Model Import
    POLL : JavaBean Model Importer
    JavaBean-Model
    Invalid Class - Javabean not available for import
    WebDynpro Using JavaBean Model ->Please Help
    Best regards, Maksim Rashchynski.

  • Why do we use only numbers to define a client?

    why do we use only numbers to define a client?

    If you find the field name in SAP, in the same method you get the structure (from technical information). In the bottom is "Field description for batch input".
    i.e. Screen field CSKSZ-KOSTL.
    Enjoy!

  • I NEED HELP!!!. with complex numbers

    Hi, I need your help on creating a class called Complex for storing and performing arithmetic operations on a complex number. I am very new using java. The header of the problems is as follow:
    Create a class called complex for storing and performing arithmetic operations on a complex number. Private data members should be provided to store the real and imaginary parts of the Complex object. Provide two constructor methods: one with no arguments that initializes the Complex object to 0 + 0i, and one that enables an object of this class to be initialized with arguments when it is created. Inclued public member functions to:
    - Imput a Complex number from the Keyboard.
    - "add" two Complex arguments and store the sum in the current Complex object.
    - "substract" two Complex arguments and store the difference in the current Complex object.
    - "multiply" two Complex arguments and store the product in the current Complex object.
    -a toString() method that returns a String displaying a Complex object in the form a + bi, (when a is different than 0 and b is different than 0).
    I will appreciate your help about how i can create a constructor method that initialize the complex object to 0 + 0i.
    I am really stuck in creating the constructor for using it in the add, substrac, and multiply method. Another problem that i have is that when a user enter a complex number, they are going to enter as
    (3.2 + 2.7i) so what i am going to do with the "i"?
    I really appreciate your help.!!! thank you....

    I don't understand how I am goint to create a
    constructor with no arguments that initializes the
    Complex object to 0 + 0i.
    Should it be like:
    public Complex()
    real = 0,0;
    imaginary = 0,0;
    What I thinks is that I need to have something like:
    public Complex()
    cplx = real + imaginaryi
    then if I do this like I showed before, then what I am
    goint to do with the "i" in the imaginary part. Is
    there another way to do this or I am wrong or not
    understanding the concept?You've got a good start, but you seem to be missing a little bit.
    Your first constructor is good.
    You seem to thing the second constructor "...that enables an object of this class to be initialized with arguments when it is created" needs to take the string "3 + 4i". You may want to clarify with your instructor, but I don't think that's necessary. Instead, it should probably just take two float or double arguments--one for the real part and one for the imaginary part.
    public Complex(you need params here--I'll let you figure out what they are)Try that first, then work on the arithmetic and printing operations.

  • How to convert a waveform signal into array of complex numbers

    How to convert a waveform signal into array of complex numbers.

    Hi Chaks,
    try this:
    (Get Waveform components, convert to complex DBL)
    Message Edited by GerdW on 01-28-2008 09:23 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    ToCDB.png ‏1 KB

Maybe you are looking for