linear-equation

Solving a linear equation

I need to programmatically solve a system of linear equations in C, Objective C, or (if needed) C++. Here's an example of the equations: -44.3940 = a * 50.0 + b * 37.0 + tx-45.3049 = a * 43.0 + b * 39.0 + tx-44.9594 = a * 52.0 + b * 41.0 + tx From this, I'd like to get the best approximation for a, b, and tx....

Solution basis of underdetermined equation set in python

I have an underdetermined equation set (m equations of n variables, m smaller than n). As such, if it is solvable then the set of solutions are a linear space (if it is a homogenic set) or affine space (non-homogenic). Is there an easy way in Python (possibly with other libraries) to obtain this space - for example, a basis of which? T...

Correct way to standardize/scale/normalize multiple variables following power law distribution for use in linear combination

I'd like to combine a few metrics of nodes in a social network graph into a single value for rank ordering the nodes: in_degree + betweenness_centrality = informal_power_index The problem is that in_degree and betweenness_centrality are measured on different scales, say 0-15 vs 0-35000 and follow a power law distribution (at least...

Which one is faster / more stable: inverting matrix or solving three systems of linear equations with multiple right hand sides?

Hi, I have two equations I'm solving on each recursive round: X = A - inv(B) * Y * inv(B), X = X + A' * inv(B) * A, I solve the problem this way: C = inv(B)Y <=> BC = Y, solve C. D = Cinv(B) <=> DB = C <=> B'D' = C', solve D' E = inv(B)*A <=> BE = A, solve E. All matrices change over time, so I have to do this (or inverting) again...

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 + 2y = 22 //This should not validate because of the power. 4xy + 3y = 45 //This should n...

how to solve linear equations using genetic algorithm

hello i want to solve a system of n linear equations containing n variables using genetic algorithm. i am having difficulty in defining the crossover operation as the solution may consist of floating point values. how do i proceed. seems possible but this is my first encounter with genetic algorithms so your help would be great. suppos...

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 question has a lot of good information about the algorithms used to solve such equations. C...

How to identify subtriangle within a rectangle given a coordinate in that rectangle

Given a rectangle of width w and height h. and a coordinate x,y in that rectangle I would like to identify which triangle I am within. i.e. the function should take parameters(x,y) and return a,b,c,d or a zero based number representing that triangle index i.e. (0=A,1=B,2=C,3=D) if they are in that order. I think this would be somethi...