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
3 answers

Eliminate a redundant equation from a linear programming

I was asked to re-write this linear programming question with an equation less. MAX 7X1+5X2 S.t : 4X1+3X2 <= 2400 2X1+0.5X2 <= 750 X1 >= 100 X1,X2 >= 0 What I did was I used the simplex method and I found that the maximum profit is 4030 with X1 =…
0
votes
1 answer

Calculating linear systems using EJML

How exactly do I format my code so that It would take 1x+2y+3z+4w=5e 6x+7y+8z+9w=10e 11x+12y+13z+14w=15e 16x+17y+18z+19w=20e and return x,y,z,w? I was trying to follow the format described in this answer, Currently what I have is the following code…
daedsidog
  • 1,732
  • 2
  • 17
  • 36
0
votes
1 answer

Implementing simplex algorithm and getting "matrix singular to machine precision" error

I am implementing the (dual) simplex algorithm in Matlab/Octave. My algorithm works just fine for a small test problem, but as soon as I try a bigger problem as afiro.mps (from http://www.netlib.org/lp/data/) I get the warning "matrix singular to…
tilman151
  • 563
  • 1
  • 10
  • 20
0
votes
0 answers

Matlab linear equations with binary solutions

I have a linear equation (binary) system: x+1=0; x+1=y; x=1; It has binary solutions x=1,y=0; But I don't know how to solve this system in matlab, could anybody help? Thanks so much!
woss
  • 63
  • 4
0
votes
1 answer

Plot two regression equations (or more) on the same graph ggplot

I need to display on the same graph two linear regression equations and the coefficients (r, r², p, N). I did this using the facet_grid, but now the two curves can not be displayed separately. I modified the code that was like facet_grid function: …
j_3265
  • 207
  • 3
  • 12
0
votes
0 answers

Solving equations with circular reference in R

I have a set of following equations: x = 11y y = x-5 The above equations are easy to solve if I rearrange the variables and solve using matrices. However, I want to pass the above equation as it is and solve them. Can someone suggest a way?
user3625024
  • 319
  • 1
  • 2
  • 11
0
votes
3 answers

Solving a simple linear equation

Suppose I needed to solve the following equation, ax + by = c Where a, b, and c are known values and x, y are natural numbers between 0 and 10 (inclusively). Other than the trivial solution of, for (x = 0; x <= 10; x++) for (y = 0; y <= 10;…
Matt Olan
  • 1,911
  • 1
  • 18
  • 27
0
votes
1 answer

Solving equations and plotting the results

(edited, i have changed the code) Well i have compound equations that i need to solve in matlab and find the result. I have tried different techniques but have failed. the equations are: u(j-1)-2(u(j))+u(j+1)= -4*h^2*pi^2 * sin(2*pi*xj) where…
Hammadzafar
  • 480
  • 1
  • 7
  • 21
0
votes
1 answer

How to invert a matrix

I need to solve a system of n-linear equations with n-unknown variables in C++ using the gaussian method of elimnation. Any hints how to achieve that? I'll be probably using rand(); for the amount of n, since isn't available, because C++11 I can't…
0
votes
1 answer

Linear equation with random values

I would like to insert random values from a lognormal distribution into a linear equation. The equation is: y = 2/(9x) + 8 ...and x shall take random values from the distribution exp(rnorm(100, m=-2.59625, sd=0.5852539)) How do I generate the…
user3213255
  • 21
  • 1
  • 1
  • 3
0
votes
3 answers

Solving n linear equation

I am trying to solve n linear equations with n variables. I used cramer's rule but in cases it failed when determinant is equal to zero. How to approach this problem ? I am using c language. Also my linear equation is of form: for n = 3: - x + y + z…
user2826957
  • 303
  • 2
  • 3
  • 12
0
votes
0 answers

Test succeeds in Python interpreter, but unit test in command prompt fails

I have the following things defined: def test_groupEs(self): for in_list, out_list in self.groupEs_tests: self.assertEqual(linSol2.groupEs(in_list), out_list) groupEs_tests = [ (['4.0x', '-', '2.0e', '-', '4'], ['4.0x', '-'…
0
votes
2 answers

Linear Equations

I have a program in C# that asks the user for the 4 values. They are: MinIndex, MaxIndex, MinValue, MaxValue I want to be able to determine the value for any given index within the [MinIndex MaxIndex] range. The range of Indexs will not always be…
Colm Clarke
  • 480
  • 1
  • 7
  • 23
0
votes
2 answers

Validating linear equations with regular expressions?

How can I validate linear equations with regular expressions or is there another way besides using regular expressions. I will use ^ to denote an exponent. 2x + 3 = 8 //This should validate fine 3x + 2y + 4z = 12 //This should validate fine 4x^2 +…
Xaisoft
  • 45,655
  • 87
  • 279
  • 432
0
votes
3 answers

Simple linear equation with binary search?

Is there a way to solve a simple linear equation like -x+3 = x+5 Using binary search? or any other numerical method? BACKGROUND: My question comes because I want to solve equations like "2x+5-(3x+2)=x+5" Possible operators are: *, -, + and…
capsula
  • 498
  • 1
  • 7
  • 21