quadratic

I use VI of roots of polynomial of the simple quadratic equation but alwas ge the wrong answer. Have proplem simple 2 * X ^ 2 + 2 * X + 0 = 0, are the roots of thos - 1.0 but the VI gives different roots.

Check your table, he is currently [0, 2, 2, 4]

Tags: NI Software

Similar Questions

  • How can I make calculations in swift

    I'm doing a quadratic Solver. As shown in the photo, I value a, b, c. I want to use the formula x = (- b + - √(b^2-4ac)) / 2 has to solve. I wish that the result will be deployed on x 1 and x 2. What should I write in the code?

    My codes are below

    import UIKit

    class ViewController: UIViewController {}

    @IBOutlet low var a: UITextField!

    @IBOutlet low var b: UITextField!

    @IBOutlet low var c: UITextField!

    Solve @IBAction func (_ sender: AnyObject) {}

    Equation.Text = \(a.text!) "(x ^ 2 + \(b.text!). x + \(c.text)! = 0 "

    x 1. Text = (-b + (√b ^-4ac)) / 2A

    x 2. Text = (-b-(√b^-4ac)) / 2A

    }

    @IBOutlet low var equation: UILabel!

    Low @IBOutlet var x 1: UILabel!

    Low @IBOutlet var x 2: UILabel!

    Override func viewDidLoad() {}

    super.viewDidLoad)

    Do any additional configuration after the view loading, usually of a feather.

    }

    Override func didReceiveMemoryWarning() {}

    super.didReceiveMemoryWarning)

    Get rid of all the resources that can be recreated.

    }

    }

    Would be nice if you said that you got the error.

    You seem to be a confused text with floats. You must convert a, b and c of doubles to calculate with them and then convert the expression back into a string to print.

  • Polynomial function

    First of all, thanks to you in advance for reading my question and taking the time to respond. I greatly appreciate your effort.

    I have 30 lines of data. Each line represents the net amount of items sold every day.

    I created a graph 2D with these data and applied the polynomial regression for purposes of sales forecast. You can find this feature under series->-> polynomial trendlines.

    You also have the following options to order: 2, 3, 4, 5 and 6 (I chose 6). That really means this 'order'?

    Very simplified and general answer (from a non-statisticien):

    Trend curves are the "best fit" lines applied to a set of XY data that has been drawn on a diagram of dispersion. A linear trendline can be described using a polynomial function "order 1':

    y = a * x ^1 + b * x ^ 0

    (x ^ 1 = x, x ^ 0 = 1)

    Best suited for data graphics in a shape that looks like a curve will require a graphic that function as a curve, as a quadratic function (order 2):

    y = a * x ^2 + b * x ^ 1 + c * x ^ 0

    Data sites that seem to have a folding alternated in the curve, you need a higher order, such as a cubic function (order 3)

    y = a * x ^3 + b * x ^ 2 + c * x ^ 1 + d * x ^ 0

    Unless your data set is large enough, higher orders probably will not give you a more precise match.

    For more information, search for "polynomial regression function" and check out some of the statistics pages.

    Kind regards

    Barry

  • Satellite L500-164: 15.6 "does not appear fullscreen in games

    Hello

    I recently bought the L500-164 and installed Windows 7 64-bit. Everything works perfectly, just a thing which annoys me incredibly.

    Whenever I play a game (Counterstrike, Warcraft3, Warsow, soldier) is a big black band on the left and right, so basically the screen of the game resembles a quadrat. I saw even more on my old 15.4 "laptop, because he was able to view as wide screen.

    I installed the new catalyst, but is not possible within the REC to enlarge the screen of the game for the full amount...
    I really want to solve this problem and I hope for your help.

    Thank you!

    Hello

    Normally, every game, you can change the screen resolution and I think that you didn t set the resolution of the screen to the right. As far as I know the Satellite L500-164 has a native resolution of 1366 x 768. did you choose this resolution?
    If you choose another resolution that uses another format, you have these bands on the left and right sides.

    In addition, you must use the Toshiba display driver directly. Other drivers are not pre-tested and don t have protection against overheating.

  • HP problem first Solver (bug?)

    Solve (r = f ^ (a - ln (f)), f)

    correctly gives the solution f = e ^(quad formula)

    BUT, if I replace the 'a' in the above with any number between 0 and 1, for example, solve (r = f ^ (0, 5 - LN (f)), f), it gives an incorrect answer.

    What it does is to replace the 1/2 power in the quadratic formula, by a multiple of 1/2 instead - IE. Instead of

    e ^ (b + (c)^(1/2)) (correct answer).

    It gives

    e ^ (b + (c)*(1/2)) (it wrong - this simplifies down to something like d * r for some d - and it took me a long time to find what she does!)

    is this a bug with the command solve or I just hurt?

    I noticed a similar problem when solving 2nd order of. When simplifying a solution (using the display button 'to increase'), he sometimes changes things like e ^(x*3) in e ^(x^3). Unfortunately I don't have a simple example of it yet!

    Three things here.

    First of all, it's really not a good idea to use tiny e as a variable because that could also be interpreted as e ^ 1 and it can be confusing, that's who. Second, when you put an approximate value as 0.5 you no longer are not a symbolic resolution. Like most systems of CASE 1.  is interpreted as "an approximate 1 floating-point value" and not "and exact symbolic whole." You should do an "exact (0.5)' instead.5 or well" 1/2 "directly.". "

    Thirdly, I think you may have spotted a problem. Well, this has already been resolved and runs a connectivity kit update, you will have the version the most recent where it works correctly even solve approximately.

  • Equation of Bhaskara

    Hello

    I'm trying to understand how things works in HP first and I'm putting the complete (if possible) equation of Bhaskara, in order to get results for x' and x 'at the same time. Not use an equation for one and one for the x. second if possible at the end I want to click on the chart and get the results. I was wondering to put the equation AX ^ 2 + bx + c and run the my equation for results. Is - this possinle? Anyone know where I can find something?

    Thank you

    Hi!, Marcelo_Moraes:

    The BJB formula is the same, what, quadratic equation. See, in the Guide to the user, page 302/303.

    Since then, the definition of Wolfram Alpha...

  • education to ENTER a custom program - HP 35s calculator

    just try to program a quadratic equation in this thing, came across this example of how to provide the two solutions of the equation:

    Statement on line
    ------+-------------
    Q001 LBL Q
    Q002 CF 10
    Q003 ENTRY HAS
    ENTRY Q004 B
    Q005 ENTRY C
    Q006-B÷ (2xA)
    ENTER Q007
    Q008 ENTER
    Q009 B ^ 2-4xAxC
    Q010 x > = 0?
    Q011 GTO Q017
    Q012 + /
    Q013 sqrt, press the k key
    Q014 I have
    Q015 x
    Q016 GTO Q018
    Q017 sqrt
    Q018 2xA
    ÷ Q019
    Q020 +.
    Q021 x <>y
    Q022 LASTx
    Q023-
    Q024 RTN

    fact sense... but I have the stupid question that I could possibly think... How in the hell you enter as INPUT and instruction?  (Q007 and Q008)

    mast

    Hello

    > Try to stick to using the ALG mode... how my brain works is more in line with this mode.

    I understand it, we are all different. Even if I prefer RPN myself, I found it interesting using ALG mode on the 35s.

    Here is the program for ALG mode:

    Q001 LBL Q
    Q002 CF 10
    Q003 ENTRY HAS
    ENTRY Q004 B
    Q005 ENTRY C
    Q006 B÷(2×A) ; the first - is the +/-key
    Q007 LASTx STO R ; The LASTx is blue, a black > will show instead of the STO
    Q008 B ^ 2-4 × A × C ; use y ^ x instead of x ^ 2
    Q009 x > = 0?
    Q010 GTO Q015
    Q011-LASTx ; press + / followed by the LASTx
    Q012 sqrt (LASTx)
    Q013 I have LAST ×x
    Q014 GTO Q016
    Q015 sqrt (LASTx)
    Q016 LASTx÷ (2 × A)
    Q017 R + LASTx
    Q018 R-REGY ; for REGY press on Roll down (E key) and if necessary to highlight Y
    Q019 RTN

    Press on y x <>see the other root.

    Pressing x <>y swap between the two roots.

    Best regards.

  • Reproduce a sequence of operations-DIAdem

    Hi all

    I'm new to the tiara and I explore a method of repeating a standard order of operations for groups of channels of 85-90. The task goes like this:

    Each channel group has a set of three strings, in which certain mathematical operations 7-8 are to perform as sum of two-channel, medium, find the mean quadratic value and add/subtract the results to real channels, finding the arc tan value results etc..,.

    I need to reproduce the same task for groups of channels of 85-90. I tried to use 'activate record' Mode in the Script window and tried to use the script it generates and use it in a for loop. But since the recording mode, contains the actual name of the channel instead of a reference, it is difficult to change the names of the channels individually making it heavier than the actual work. This is why I need another way to do the same.

    Any help will be much appreciated.

    Hi Subramanian,

    You just asked for the additional code calculator, here it is:

    iMax = Data.Root.ChannelGroups.Count
    FOR i = 1 to iMax
    Set Group = Data.Root.ChannelGroups (i)
    Set consolidate = Group.Channels ("load AmpHr")
    Set BChannel = Group.Channels ("AmpHr discharge")
    Set RChannel = Group.Channels.Add ("Result", DataTypeFloat64)
    Symbols = Array (A, B, R)
    Channels = Array (consolidate, BChannel, RChannel)
    Calculate the call ("R = ArcTan(B/A)", symbols, channels)
    NEXT ' I

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • The broadband divide

    Deal all,

    I develop a VI FPGA to calculate the least quadratic average, over 19 samples acquired with 9223 module e/s OR cRIO-9012 controller and chassis cRIO-9118. You can see that my code in the LMS snipped attachment.

    I have problems with understanding the setting of flow to the section for configuration of the function execution Mode to divide broadband within a SCTL. When I set this variable to 1 cycle/sample, it seems to me that the correct results after the function of division broadband are coming after the latency time of the function. Thus, for example in this case after 30 cycles. But when I put the possible maximum value, in this case 29 cycles/sample, I never get a correct result of the division, and the result is always on the increase until the maximum number that goes to zero and start to increase in the same way. So I really do not understand this function.

    Can someone please give me more information about the function broadband divide? At least more information about the flow setting.

    Thank you very much.

    Kind regards

    Nikola

    Hello Nikola,

    You need 30 cycles to get a valid result - no matter what bitrate is defined. When you set the control to the value 1/cycle you can subscribe a value to each cycle. The calculation is in pipeline and intermediate results are stored in shift registers.

    When you set 30cycles value, all 30 cycles only you can feed a new value. The advantage is, it costs less resources that piplines are less necessary.

    I think that the valid output is not wrong all the time, it is true once every 30 cycles and miss you maybe looking at the face before of the VI. Use the "valid output' 'ready for the entry' control of the power/reading of new values. Alternatively, you can use 1cycle by value if you have resources left on the chip,

    Kind regards

    René

  • PCI-6110 - calculated resolution RMS

    We have a requirement for the resolution of measurement of voltage AC RMS. I am in a position a repetitive alternating signal with 512 samples on 1 cycle using the range full scale. I then calculate the value of these data. What is the effective resolution of the RMS measurement? Should not 512, 12-bit samples (signal varies for each sample) produce a measure of 12-bit resolution? How can calculate the actual resolution of bit RMS?

    I don't see how it takes into account the benefits obtained with various LSB errors between samples.

    The best I can determine via Google is the increase of the resolution for a simple average is the square root of the number of samples. So 512 samples would result in improved time 22.6 (adds 4.5 bits). The improvement of a quadratic average is probably different (less), but my test here with real hardware is in this stadium. Google also revealed that some applications intentionally add a small amount of random noise, resulting in a dramatic improvement in the calculation the resolution.

  • "Read binary file" and efficiency

    For the first time I tried using important binary file on data files reading, and I see some real performance issues. To avoid any loss of data, I write the data as I received it acquisition of data 10 times per second. What I write is an array double 2D, 1000 x 2-4 channels data points. When reading in the file, I wish I could read it as a 3D array, all at the same time. This does not seem supported, so many times I do readings of 2D table and use a shift with table register building to assemble the table 3D that I really need. But it is incredibly slow! It seems that I can read only a few hundred of these 2D members per second.

    It has also occurred to me that the array of construction used in a shift register to continue to add on the table could be a quadratic time operation depending on how it is implemented. Continually and repeatedly allocating more larger and large blocks of memory and copy the table growing at every stage.

    I'm looking for suggestions on how to effectively store, read effectively and efficiently back up my data in table 3-d that I need. Maybe I could make your life easier if I had "Raw write" and "read the raw data" operations only the digits and not metadata.then I could write the file and read it back in any size of reading and writing songs I have if you please - and read it with other programs and more. But I don't see them in the menus.

    Suggestions?

    Ken


  • value whole County angle encoder

    Hello

    I try to trace the pressure exerted by a cylinder of an engine vs the rolling angle. And for each engine cycle.

    I want to trace the value of the pressure of each degree which mean I value 720 by cycle because a cycle mototor corresponding rotation two of the rolling.

    (I join a graph that represents what I draw simplify the 'pressure vs CAD')

    My problem:

    I have a quadratic encoder 3600 ppr which mean an accuracy of 0.1 °, but I'm just interresting to the total value of the angle.

    So I traced the pressure value only if it is an integer, apparently, I miss a lot of them that's why I have a graph with 6 cycles instead of one.

    (see attached "my results")

    I think it's because of a timing problem with my curls on FPGA or RT or two of them...

    I am open for every advice, examples or anything else that can help me

    Best regards

    Simon

    I think you want something like that on the FPGA. You have to put your data in the buffer. See if you can understand the RT code to work with it. Basically, you want to read from the FIFO. Your problem is now that you are reading a control, which means that you can only read as fast as the RT can go. You lose the advantage of speed of FPGAs. Your FPGA should read point at a high rate. Your RT then reads multipoint pieces that are buffered to the top the FPGA. My suggestion is to read FIFO 3600 items at once (a full turn) on the side of the RT. Of course, it depends on how fast the encoder is rotating. I suggest you determine the maximum SPEED of your system will work on, and then set up your size of buffer accordingly.

    I did the FPGA, but I wouldn't quite call me an expert yet. Others may come along with better ideas, but this is generally what I would do. WARNING: I have no test or check this work so it can certainly be bugs. Also, he is still waiting for the impulse of Z. In your application, you can wait the Z pulse once, get the TDC offset, then just stay in the inner loop. I didn't know whether you need synchronization with the Z pulse each time. Whatever it is, this should give you the general idea.

    Edit: Have not yet had my coffee. I should only be to increment the account in the inner loop when I get a rising edge. And then I should be add to the FIFO only when the offset is greater than the offset TDC. Sorry, this mistake will cost you 20 minutes at compile time! I'm sure glad that I put this disclaimer clause

  • function with a variable number of cubic curves

    Hello

    I have a set of data : a set representing the independent variable and a set representing the dependent variable. I need to find the minimum number of cubic curves (find their coefficients) that reduce the average quadratic error less than a given tolerance. If the tolerance is higher than 17 particular segments, so I need to raise an error.

    You have an idea what function blocks, I need to?

    I could use general polynomial Fit VI with order 3 and its default method to check the residue. If the residue is greater than the given tolerance, so I could try to use two cubic curves and test them on different starting and ending points until the residue is less than the given tolerance. If tolerance is not guaranteed, I add another curve and I test again the Assembly as shown above. By iteration until the residue is less than the given tolerance, or until I would need to add 18th cubic curve.

    If there was something ready, I would be grateful.

    Thank you.

    Fabiobonelli wrote:

    Please, you can test your VI adding another point to four present?

    X =-6453

    Y =-266

    Check the residue.

    Thank you.

    Did you even read my response? You have a serious air conditioning problem because the data is on a narrow Beach far from zero. By example-6500 ^ 3 is smaller that - 2E11, i.e. a value that many (many!) is orders of magnitude different from that of the constant term (1). The linear algebra problem that results is very ill, conditioned and just blindly Ford over the accelerator pedal are bad advice here.

    This isn't a problem with the implementation of LabVIEW, but a fundamental vice that you encouter also (or worse) If you would do your own math. No way around it. (See also)

    My recommendation is to delete the X offset and add it later again. Now things work correctly. (Note that a second order polynomial fitting still works without twist it).

    Try the and see for yourself.

  • Questions about the frequency step response

    Hello

    I use the Signal Express 3.0. I'm not clear on the transfer functions in step of frequency response with different modes of calculation of the average. What I got from the help file is this H (f) = Sab (f) /Saa (f) which is cross the frequencies on the spectrum auto where is the pulse and b the signal response signal. When the mean quadratic value is used, I wonder if the transfer function becomes greatness of cross spectrum divided by the magnitude of the spectrum of the car. When an average of vector is, everthing is used in complex numbers. He averaged temporal signals, frequency domain signals, or the results of transfer functions?

    Thank you very much.

    The algorithm to calculate the spectrum is the same in both modes.  However, the method of calculation of the average can have a huge impact on the outcome.  Mean quadratic value is performed on the spectrum itself, after the calculation.  Vector averaging is done on the input signals before the calculation.  With an average of vector signals must be consistent (have the same phase) or the result will be bad due to the signal being on average by far.

  • Questions about an average of response spectrum and frequency of feeding mode.

    Hello

    I have a few questions about an average of mode. When I generate a sinusoidal signal from one output to two input channels channel to see if my DAQ card works well and vector averaged in the power spectrum for DFT, the amplitudes was different from the previous one of the amplitude, which was supposed to be 1 v peak. They range from 0.5 v to 0.6 v peak. When the calculation of the average model is RMS, the amplitudes were close to 1. I wonder what are the fomulas of RMS and average vector. Does that mean that I could not accurate if I use an average of vector? In a time of frequency response, why I coherences of difference and the amplitudes using the vector and the mean quadratic value?

    Thank you

    Ningyu

    rico1985,

    The differences in modes of generation are as they sound: 1 sample output only a sample writing, N samples will be released however many samples configure you for each entry, and the continuous samples released samples continuously until a specified user action happens (you press the stop button or a logic that you created gets fulfulled). The range of Signal output allows you to set a ceiling high and low level of your output signal and it only affects the quality keeping in this beach. Timing to set a deadline for the time between the acquisition of the sample. If a new sample becomes unavailable before the timeout setting, you will get an error. This is useful for looking at a network, because if the network goes down and you stop getting data from a machine and then you would like to know about it. I point you to those videos that are short tutorials on how to make the most of these actions in SignalExpress.The SignalExpress 3.0 Help file is also your first point of contact for all your questions on getting started. These two resources should get you up and running in SignalExpress in no time. (either by the way all your questions answered using these resources) Bravo!

Maybe you are looking for