linear-equation

Solve homogenous system Ax = 0 for any m * n matrix A in R (find null space basis for A)

一笑奈何 提交于 2019-12-17 20:32:21
问题 How to solve a homogenous system Ax = 0 , when A is any m * n matrix (not necessarily a square one) in R? # A=[-0.1 0.1]= 1x2 matrix; x=2x1 to be found; 0: 1x1 zero matrix A <- t(matrix(c(-0.1,0.1))) This question seems to be equivalent of finding the kernel (null space) of an Rn -> Rm (can't do superscript; sorry) linear transformation. 回答1: Anyway, the solution for the above specific matrix A will suffice to me. We can eye-spot it, x = (a, a) , where a is an arbitrary value. A classic /

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

独自空忆成欢 提交于 2019-12-12 14:36:59
问题 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 satisfy x1>0 x2>0 x3>0 I have couple thousand sets of vt,v1,v2 and v3, therefore I need to be able to generate x1, x2 and x3 programmatically. 回答1: There are two ways you could approach this: From the method that you have devised in your post. Randomly generate x1

solving two linear equation in program [closed]

你。 提交于 2019-12-11 09:01:41
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . I have two lines UV and PQ, with U(15,10) V(50,25) and P(40,10) and Q(30,30). and i am finding a point of intersection between these two points. I am forming two linear equations for that: eq 1: Ux + t(Vx-Ux) = Px +s(Qx-Px) eq2 I want to solve these equations using C program to get the value of

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

点点圈 提交于 2019-12-11 07:41:30
问题 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 ? I have tried scipy.linalg.solve() but it requires coefficient matrix A to be nonsingular. I also tried sympy A = Matrix([[0, 0, 1], [1, 1, 1]]) b = Matrix([0, 0]) linsolve((A, b), [x, y, z]) It returned me this {(−y,y,0)} I have to parse the

How to solve linear equations using a genetic algorithm?

冷暖自知 提交于 2019-12-11 04:51:33
问题 I want to solve a system of n linear equations containing n variables using a genetic algorithm. I am having difficulty in defining the crossover operation as the solution may consist of floating point values. How do I proceed? It seems possible, but this is my first encounter with genetic algorithms. Suppose we have to solve x + 2y = 1 2x + 8y = 3 The answer would be x = 1/2 and y = 1/4. How do we model the problem? Update : see if you could decipher anything from the paper http://www

Solving a system of linear equations in a non-square matrix [closed]

元气小坏坏 提交于 2019-12-04 06:06:57
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . I have a system of linear equations that make up an NxM matrix (i.e. Non-square) which I need to solve - or at least attempt to solve in order to show that there is no solution to the system. (more likely than not, there will be no solution) As I understand it, if my matrix is not square (over or under-determined), then no exact solution can be found - am I correct in thinking this? Is there a way

Linear fitting in python with uncertainty in both x and y coordinates [closed]

好久不见. 提交于 2019-12-03 13:58:42
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 months ago . Hi I would like to ask my fellow python users how they perform their linear fitting. I have been searching for the last two weeks on methods/libraries to perform this task and I would like to share my experience: If you want to perform a linear fitting based on the least-squares method you have many options.

PETSc solving linear system with ksp guide

戏子无情 提交于 2019-12-03 08:35:44
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 to fill matrices A,X an B by reading them for example from file. Here I provide the code within ex2.c file: /* Program usage: mpiexec -n <procs> ex2 [-help] [all PETSc options] */ static char help[] = "Solves a linear system in parallel with KSP.\n\ Input parameters include:\n\ -random_exact_sol : use a random exact solution vector\n\ -view_exact_sol

Linear fitting in python with uncertainty in both x and y coordinates [closed]

旧巷老猫 提交于 2019-12-03 08:13:18
Hi I would like to ask my fellow python users how they perform their linear fitting. I have been searching for the last two weeks on methods/libraries to perform this task and I would like to share my experience: If you want to perform a linear fitting based on the least-squares method you have many options. For example you can find classes in both numpy and scipy. Myself I have opted by the one presented by linfit (which follows the design of the linfit function in IDL): http://nbviewer.ipython.org/github/djpine/linfit/blob/master/linfit.ipynb This method assumes you are introducing the

How to solve systems of XOR equations?

牧云@^-^@ 提交于 2019-12-01 05:56:47
I have to solve a system that consists of 32 xor equations, each involving 15 of 32 variables. One would look like this: i[0] = p[0] ^ p[4] ^ p[5] ^ p[10] ^ p[11] ^ p[20] ^ p[21] ^ p[22] ^ p[23] ^ p[25] ^ p[26] ^ p[27] ^ p[28] ^ p[30] ^ p[31] i[n] and p[n] being 16 bit integers. So as I understand I would end up with a 32x32 matrix (containing only 1s and 0s) and a 32 result vector. Apparently Gaussian elimination is what I need but I can't wrap my mind around the problem, could someone give me some insight on how to solve such a problem? Yes, you can use gaussian elimination to solve this.