Questions tagged [quadratic]

Pertains to squares or squaring. Use this tag for questions relating to quadratic equations, quadratic regression, and similar concepts in the context of programming as defined in the Help Center. It may also be used for questions regarding quadratic probing and quadratic time complexity.

Quadratic means to the second (2nd) power, that means, squares (in algebra), or squaring. This tag is used for questions relating to quadratic equations, regression, and similar programming contexts involving quadratic polynomials or terms.

A quadratic polynomial is a polynomial of degree 2. All quadratic polynomials of a single variable x is of the form ax^2 + bx + c where the quadratic coefficient a != 0. The graph of a quadratic function is a parabola, with open end up if a > 0, and down if a < 0. All quadratic polynomials have exactly two complex roots, and can have either two, one, or zero real roots. The famous quadratic formula, applicable for all quadratic polynomials ax^2 + bx + c with real or complex coefficients a,b,c , is given by x = (-b ± sqrt(b^2 - 4*a*c)) / (2*a).

Here are the graphs of three quadratic functions with color coding

three quadratics

A quadratic regression is a method of finding a parabola, represented as a quadratic polynomial of best fit in a set of data. The chart below shows an example of finding a parabola extrapolating the known data points.

Source: https://www.varsitytutors.com/hotmath/hotmath_help/topics/quadratic-regression

Quadratic Complexity means complexity of O(n^2). That means, it grows similar to a positive quadratic function ax^2 + bx + c, a > 0 as x grows, precisely, f(x) == O(x^2) if f(x)/x^2 is constant. There are two forms of quadratic complexity: quadratic space and quadratic time, indicating that this program or algorithm asymptotically requires extra memory space or took time equal to the square of the size of the input n respectively. Selection sort is an example of a quadratic time algorithm. Linear or better complexity is also within quadratic complexity.

420 questions
0
votes
1 answer

About matlab quadprog using a structure hessian

I've been using matlab for solving a quadratic optimization problem, using a factor structured hessian, say I have a covariance matrix H and I wrote it as H=A+B*B'. Then I have a small piece of code to calculate the hessianf=@f; options =…
Jack2019
  • 275
  • 2
  • 10
0
votes
1 answer

I need a Java library to help me solve multi-times equations

I just started using Java to simulate solar panel's performance, however the single diode model requires lots of calculations: basically, each function is a function of the other, all of them of the variable of Rs, a. two equations are available…
user1056916
  • 31
  • 1
  • 2
0
votes
2 answers

How to fit a quadratic model knowing the maximum in R?

I have a data frame x and y, and I know the maximum of y. I want to fit this data to a quadratic model. How can I do it in R knowing the maximum? If I didn't know the maximum, I would fit it with lm(y~x + I(x^2)). Can anyone has an idea about this?…
Chris
  • 1,248
  • 4
  • 17
  • 25
0
votes
3 answers

Draw a quadratic arc over IplImage

I currently have an iplimage that has been modified using opencv. I am needing to draw an arc like that of the parabola of a quadratic equation, and I am unable to make one using the basic drawing functions built into opencv. I have been looking…
a sandwhich
  • 4,352
  • 12
  • 41
  • 62
0
votes
1 answer

Find the control point of a quadratic curve

I have the start and end point of the curve and the top point of the curve. I would like to know how i can get the control point with this ? I have a graph with links. When a link is on a node, i want that the links dodge the nodes. So I recover the…
Vénon
  • 35
  • 7
0
votes
0 answers

cvxpy.error.DCPError: Problem does not follow DCP rules: Error is probably due to the quardratic constraint , but how to solve this problem?

In the following section of my code i am facing error , cvxpy.error.DCPError: Problem does not follow DCP rules.the error is probably due to the quardratic constraint , but how to solve this problem? the errors display the specific equations that…
0
votes
0 answers

Change Quadratic Objective Function in R Optimization (ROI Package)

I'm using the ROI package in R and am trying to setup an optimization with a quadratic objective function. It looks like the default function is of the form: 1/2 x^T Q x+ C^T x. I'd like to alter this function so that I'm optimizing to maximize:…
GT213
  • 89
  • 6
0
votes
1 answer

Score models based on log, quadratic, or linear fit on a 0-1 scale

I am looking for a way to score model fits of x,y data on a scale from 0 to 1, depending on which model the data best fit. If data fit a linear model best, the score would come out close to 1. Log would be close to 0, and quadratic would be…
Emma
  • 1
  • 1
0
votes
0 answers

Getting Bezier Handles from a Curve's control points

I am working with a program that defines its Curves with 'Edges' that have three control points (The red points 0, 1, 2 in the attached image). I believe this is a Quadratic Curve. This is a list of their x & y coordinates: [(736,620), (963, 488),…
0
votes
0 answers

How to conceptually interpret output of a polynomial (quadratic) regression, when the regressors are orthogonal/correlated

I want to show an inverted U-shape relationship between two variables: "minutes spent in a room A" and "trustworthiness in others". The hypothesis is that those who have low and high trustworthiness are the ones who spend the least amount of time in…
0
votes
2 answers

How can I transform any Equation inputted into a standard form in Python?

I am Writing a Simple Quadratic Equation Solver. However I have realized that in order for the code logic to work efficiently I need to convert the input into the standard Quadratic Form no matter what the user provides. Standard Form of Quadratic…
0
votes
3 answers

Calling a function inside a function in C

I've been trying to code a program that solves quadratic equations. Everything seemed fine to me, but the functions I try to go again didn't start after I'd called them. I can't understand what I made wrong. #include #include int…
user21590545
0
votes
0 answers

Why is my SQP returning an infeasible point and how do I fix it?

I am trying to solve an optimization problem using my own code. I want to use Sequential Quadratic Programming to minimize a n objective function given a few inequality constraints. I have made an active-set solver for the sub-QP problem and I have…
0
votes
1 answer

emtrends in presence of a quadratic term: difference in quadratic trends

I want to model my response variable by Time. I used a quadratic term . Usually when I only have a linear term, I use the function emtrends of emmeans package to get the differences between the two trend of two levels of my factor 'Side', how to…
learners
  • 195
  • 1
  • 12
0
votes
1 answer

In R, how to draw quadratic plateau graph using ggplot?

I have a data like below and drew a quadratic graph. nitrogen<- c(10,20,30,40,50,60) yield<- c(15,25,38,42,35,30) dataA<- data.frame(nitrogen,yield) dataA ggplot(data=dataA, aes(x=nitrogen, y=yield))+ stat_smooth(method='lm', linetype=1,…
Jin.w.Kim
  • 599
  • 1
  • 4
  • 15