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
1
vote
1 answer

What is the best way to construct, and then solve quickly a system of linear equations in Python?

Suppose I have a big system of linear equations: X_1*a_11 + X_2*a_21 + ... + X_n*a_n1 = b_1 . . . X_1*a_1m + X_2*a_2m + ... + X_n*anm = b_m The dimensions n and m are fixed (are not symbolic). I can find and plug the values of each coefficient…
1
vote
0 answers

How to convert a linear equation system to matrix?

So Im currently writing a chemical reaction solver with JavaScript, where my reaction to equalize is x1 C3H5N3O9 = x2 CO2 + x3 H2O + x4 N2 + x5 O2. So my linear equations would be: 3x1 = x2 5x1 = 2x3 3x1 = 2x4 9x1 = 2x2 + x3 + 2x5 Now I found a…
1
vote
1 answer

Seidel method in Pascal

I need to implement Seidel method in Pascal. I tried this code but it gives the wrong answer. I don't understand what the mistake is. This is what the procedure for finding roots looks like: procedure Seidel(n: Integer; var x: vector; a: matrix; e:…
Vladovello
  • 21
  • 3
1
vote
0 answers

Fastest way of solving system of linear equation with huge matrix

My system of linear equation is represented in the form AX = B. In order to find X, X = inverse(A) * B. There are quite a number of libraries such as numpy.linalg.solve, numpy.linalg.lstsq or numpy.linalg.inv to solve for X. However, with the size…
user2554925
  • 487
  • 2
  • 8
1
vote
0 answers

Linear equations in MATLAB: how to solve set of k-1 equations on k unknowns?

I am trying to solve the problem for my assignment that have polygon Q as input and outputs polygon P such that 2D coordinate points of Q are midpoints of the polygon P. That is, given a sequence of k points in the plane q1...qk, find a sequence…
1
vote
1 answer

Information about CGAL and alternatives

I'm working on a problem that will eventually run in an embedded microcontroller (ESP8266). I need to perform some fairly simple operations on linear equations. I don't need much, but do need to be able work with points and linear equations…
Toby Eggitt
  • 1,806
  • 19
  • 24
1
vote
2 answers

Problem with Forward elimination implementation

Let be the following Forward Elimination Implementation in terms of C# public static void ForwardElimination(double[,] AugmentedMatrix) { int N = AugmentedMatrix.GetLength(0); for (int k = 0; k < N; k++) …
1
vote
0 answers

Which linear equation algorithm requires less memory than LAPACK in general? Can I use it in R or RcppArmadillo?

I am trying to solve a linear system, Ax = b in R. A is a 111779 by 111779 sparse matrix or "dgCMatrix" and contains 10^11 elements. b is a 111779 by 1 dense matrix. I used a powerful AWS ec2 instance to calculate this. First I used solve() in R but…
zqin
  • 95
  • 10
1
vote
2 answers

How to solve linear equations with parametrization?

I am trying to solve my equasions this way: a = np.array([[1,2,4,1,0,2],[0,1,2,0,0,1],[0,0,0,2,2,0],[0,0,0,0,14,4],[0,0,0,0,0,-2]]) b = np.array([3,0,1,0,14]) x = np.linalg.solve(a,b) However, as they are not full ranked there is no one solution,…
DunkeyKing
  • 43
  • 4
1
vote
2 answers

Solve A linear equation system b=0 Rstudio

i would solve a linear equation system like this:…
1
vote
0 answers

r - Estimate selection-unbiased allele frequencies with linear regression systems

I have a few data sets consisting of frequencies for i distinct alleles/SNPs of some populations. Additionally I recorded some factors that are suspicious for having changed the frequencies of these alleles within the populations in the past due to…
Anti
  • 365
  • 1
  • 14
1
vote
0 answers

inverse() vs pinv() which one good for linear system

I have a linear system A*x=b. Here x is the unknown value, so I have to solve for x. A is a sparse matrix whose diagonal and off-diagonal elements have some non-zero values. The other elements is zero or close to zero. Using MATLAB, I have two…
1
vote
2 answers

Adding 0 as coefficients in matrixes

I have matrix A with my coefficients, and matrix x with the indices of the variables affected. A <- matrix(c(1,2,-1,2),2,2) x <- rbind(c(1,2), c(3,4)) Each row (on both matrices at the same time) writes an equation. For my example, this would be…
Carrol
  • 1,225
  • 1
  • 16
  • 29
1
vote
1 answer

Solving 1D Poisson Equation with Gauss Seidel Red Black

I'm trying to solve a 1D poisson equation to model potential at 10 micrometer intervals in the dielectric of a capacitor. The main issue I'm having is the red/black Gauss-Seidel code appears to not actually update the values in the potential matrix…
C.cent
  • 11
  • 1
1
vote
1 answer

Solving linear equation systems in Coq

I need to prove that this system of equations does not have a solution (the reason is that it is over-determined). Is there an easy way to do it in Coq? I.e. a tactic or library? Require Import Reals. Open Scope R. Lemma no_solution: forall …
larsr
  • 5,447
  • 19
  • 38