Questions tagged [linear-equation]

An algebraic equation of the form y = mx+b

A linear equation is an algebraic equation in which each term is either a constant or the product of a constant and (the first power of) a single variable. More on Wolfram and Wikipedia.

203 questions
0
votes
2 answers

Solving a system of 2 Linear Equations using c++

Hello I'm having trouble writing a solution code for my homework. I am required to ask the user to input 6 variable for two equations. After successfully pulling numbers only, I need to find the slope of each line, the y-intercept for each line, two…
-1
votes
1 answer

Can someone explain the last part of this code?

I am a newbie at C++. I have been writing some code for the past 2 hours. It's about finding a solution to a tridiagonal system. #include #include using namespace std; int main() { float mat[100][100]; int n; cout <<…
-1
votes
2 answers

Solve a linear equation which has 16 variables

I'm trying to solve a 16 variable linear equation. I tried in Matlab but it says that the solution could not be found. Is there an efficient way to solve the equations. The equations are a = a^2+e^2+i^2+m^2, b = a*b+e*f+I*j+m*n, c =…
-1
votes
2 answers

Linear equation with 3 variables in C

I am given my C class homework, which is: A hyperloop track is built of individual pipe segments of certain length. The track starts and ends with a bulkhead, and there is a bulkhead in-between each two pipe segments. The segments are produced by…
-1
votes
1 answer

Solving Linear equations with constraint in Python

I have a system of linear equations with some constraints. I would appreciate it if someone could help me solving this system of equations in Python.
BASU
  • 49
  • 1
  • 3
-1
votes
1 answer

Read coefficients of linear equations from file into 2d array in c

I'm working on a program that reads linear equations from a file such as those - and solve them using matrices - : 3x+2y-2z=9 -2x+9y+12z=23 4x-7y+9z=45 The file is supposed to contain n equations with n variables , how to get only the numbers and…
Islams
  • 67
  • 1
  • 2
  • 12
-1
votes
1 answer

Printing out: no solution, multiple solution with Apache in java

I have this code which give solution to 4x4 linear equations. how can i print out when a linear equation have no solution or have multiples ones. instead of prints error ? public class OvaWork { void fourthEquationSolver() { …
Volazh
  • 126
  • 2
  • 13
-1
votes
1 answer

Findig a solution for a linear equation system which has more variable then equtions

Let's divide the problem to 2 parts, the second one is optional. Part 1 I have 3 linear equtions with N variables where N usually bigger then 3. x1*a+x2*b+x3*c+x4*d[....]xN*p = B1 y1*a+y2*b+y3*c+y4*d[....]yN*p = B2 z1*a+z2*b+z3*c+z4*d[....]zN*p =…
GaborK
  • 1
-1
votes
1 answer

How do I use a point class, rational number class, and line class to Solve a system of 2 linear equations?

I am fairly new to computer science and have been trying, unsuccessfully, to use a point class, a line class, and a Rational number class in order to solve a System of linear equations. The code for the System is old and I'm adapting it to work for…
hell2the0
  • 1
  • 1
-1
votes
1 answer

Cholesky Factorization in C?

I am implementing the Cholesky Method in C but the program quits when it arrives at this point. After the answers : Now it works thanks to the answers of (devnull & piotruś) but it doens't give me the right answer /* Ax=b *This algorithm does: * …
-1
votes
1 answer

Matlab: how to display answers of underdetermined linear system as {a = r1, b = r1/2, c = r1}

I have a 3x3 matrix, for example A=[3,2,4;2,0,2;4,2,3], and I'm trying to solve the following linear system in the form A*[a;b;c] = [8*a;8*b;8*c]: 3 2 4 a 8a 2 0 2 * b = 8b 4 2 3 c 8c Ok, so I have: 3a + 2b + 4c = 8a 2a + 2c = 8b 4a +…
-2
votes
1 answer

How to set the equations to implement a Kalman filter for predicting the foot traffic of a restaurant?

I want to implement a Kalman filter to predict the actual daily number of dine-in customers in a restaurant with the two sets of time series data below. Daily total number of people entering the restaurant: This is not exactly the same as the…
-2
votes
2 answers

Resolve task. Extend current line and get value

I'm looking for solve for this task in c#. There is an X and Y coordinate system. The task is to find the equation that matches the red line at the same angle and print the value of this line through the specified number of steps on the X…
Shinkov
  • 21
  • 5
-2
votes
2 answers

Is there a way to solve two linear equations in python without the use of any module?

Is there any way of solving two linear equations simultaneously in python without the use of a module?? I want to solve these two equations but can't seem to find the approach . a - b = 1 a + b =…
-2
votes
2 answers

Regex Expression to extract coefficent of linear eq "2x-3y+0.5"

I want to convert my eq to vector form so i need to extract the coefficient r"[-+]?\d*\.\d+|\d+" I tried this but I am not able to get the "-" sign along with the integer. For 2x-3y+0 i am getting [2, 3, 0] but I need [2, -3, 0].
1 2 3
13
14