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
6
votes
1 answer

PETSc solving linear system with ksp guide

I am starting use PETSc library to solve linear system of equations in parallel. I have installed all packages, build and run successfully the examples in petsc/src/ksp/ksp/examples/tutorials/ folder, for example ex.c But I couldn't understand how…
Nurlan
  • 2,860
  • 19
  • 47
  • 64
5
votes
2 answers

Function to translate linear equations into matrix form in R?

I was wondering whether there exist any packages or other pre-built solutions for R that are capable of translating sets of linear equations into matrix form (e.g. for solution via the Gauss Seidel algorithm), similar to the…
dreamon
  • 67
  • 7
4
votes
1 answer

Python left multiplication of of a matrix with inverse of a sparse matrix

I'm trying to calculate an expression of the form K = P*C.T*S^-1 (implementation of a Kalman filter) All the involved matrices are sparse, and I would of course like to avoid calculating the actual inverse. I tried using import scipy.sparse.linalg…
ajn
  • 225
  • 1
  • 11
4
votes
2 answers

find center of circle when three points are given

I studied this link and coded accordingly but getting Wrong Answer for the example explained in the link, During solving the equation, I subtracted equation 2 from equation 1 and equation 3 from equation 2 and then proceed further. Please check link…
avinashse
  • 1,440
  • 4
  • 30
  • 55
3
votes
1 answer

Strange numerical error when transposing a matrix and solving a linear system in Matlab

I stumbled upon rather strange behaviour in MATLAB. The operator for solving a system of linear equations, \, sometimes produces different results, though the only thing that is changed is the place of transpose operator. Take a look at this…
Nejc Jezersek
  • 621
  • 1
  • 9
  • 19
3
votes
2 answers

Function to check if linear combination of elements in list are equal to a certain sum

The problem is to create a function to check if a linear combination of certain items of that list add up to a certain sum. The result would be a list with tuples(which are the same length of the list). For example: given list: [3,7,10], sum=…
V_Buffalo
  • 43
  • 6
3
votes
1 answer

Assertion Error while solving pair of linear equations

def lin_eqn(a,b): ''' Solve the system of linear equations of the form ax = b Eg. x + 2*y = 8 3*x + 4*y = 18 Given inputs a and b represent coefficients and constant of linear equation respectively coefficients: a =…
Kaustubh Dwivedi
  • 418
  • 4
  • 16
3
votes
1 answer

Using Eigen BICGSTAB in Parallel to solve the sparse matrix

I am trying to solve a linear system of equations of the form Ax=b with the Eigen BICGSTAB in parallel. initParallel(); int n=4; omp_set_num_threads(n); setNbThreads(n); BiCGSTAB > solver; solver.compute(A); x =…
3
votes
1 answer

SymPy `solve` fails to solve Matrix equation A*x = b when symbols are replaced by values with `subs`

I have linear equation I want to solve, as Ax = b. I want to show step by step only in symbols and at the end insert numbers and show problem's solution in numbers. I have problems with inserting in numbers. If previously calculated values are whole…
Simplex
  • 63
  • 4
3
votes
1 answer

How to determine which one is free variable in the result of sympy.linsolve

I want to solve the linear equation for n given points in n dimensional space to get the equation of hyper-plane. for example, in two dimensional case, Ax + By + C = 0. How can I get one solution if there are infinite solutions in a linear equations…
Lily Zhang
  • 31
  • 3
3
votes
1 answer

Scipy Sparse: Singular Matrix Warning after SciPy/NumPy Update

my problem results from nodal analysis for a large system of resistors. I am basically setting up a large sparse matrix A, my solution vector b, and I'm trying to solve the linear equation A * x = b. In order to do so, I'm using the…
lmr
  • 174
  • 2
  • 10
3
votes
1 answer

system of linear equation with additional constraint of minimal variables sum

I have a system of linear equations that I already reduced to a row echelon matrix using Gauss-Jordan elimination. My system with n variables Xn (where Xn is in N0 (=positive integers)) has multiple solutions and I want to find the solution for…
Thomas Bernard
  • 333
  • 3
  • 10
3
votes
1 answer

Parse Coefficient of an Linear equation

In java i am trying to find the coefficients of a linear equation to find solution of linear equation in my calculator application for example : 3x +2*(6x-3) = 2 -4x what i am dying to get is the coefficients of x and the constant in the form …
erluxman
  • 18,155
  • 20
  • 92
  • 126
3
votes
1 answer

best way to obtain one answer that satisfy a linear equation in matlab

I have a linear equation: vt = v1*x1 + v2*x2 + v3*x3 vt, v1, v2, v3 are scalars with values between 0 and 1. What is the best way to generate one set (any set will be fine) of x1, x2 and x3 that satisfy the equation above. and also…
Cici
  • 1,407
  • 3
  • 13
  • 31
3
votes
6 answers

How can I solve a system of linear equations in Excel?

I have a system of 22 linear equations (exactly 22 equations and 22 unknowns) which are dynamically generated in an Excel spreadsheet. Is there a way to have Excel solve the system and produce a value for each of the unknown variables? Another SO…
e.James
  • 116,942
  • 41
  • 177
  • 214
1
2
3
13 14