ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 15 Jul 2020 17:20:50 -0500Checking what the span is for a vectorhttps://ask.sagemath.org/question/52485/checking-what-the-span-is-for-a-vector/Let's assume I have a vector called v1 and I have a matrix called Matrix.
Let us assume that the vector is in the span of the rows of Matrix. How would I know what the linear combination is? Here is what I do know. Let's assume this is a m by n matrix. I do know there is the span function. So
I can do something like make a list of vectors out of the Matrix. Say something like make an empty list ListofVectors=[].
i=0
while i< m:
ListofVectors.append(M[i])
i+=1
Now doing
v1 in span(ListofVectors)
will give me true assuming v1 is in the span. However, is there a function that tells me what the coefficients are for each term. For example, the vector v1=[3,2,1] for the ListofVectors being [1,1,1], [1,0,0], and [0,1,0] should give me coefficients 1,2,1 respectively as 1*[1,1,1] + 2*[1,0,0] + 1*[0,1,0] gives [3,2,1].
whatupmattWed, 15 Jul 2020 17:20:50 -0500https://ask.sagemath.org/question/52485/vector equation solvehttps://ask.sagemath.org/question/48532/vector-equation-solve/How to solve this?:
F = vector([cos(alpha),sin(alpha),z])
G = vector([z,cos(alpha),sin(alpha)])
A = vector([0,0,0])
solve(F-G == A)
Answer must be:
[cos(asin(cos(alpha))),
sin(asin(cos(alpha))),
sin(alpha)]dimonbavlyMon, 28 Oct 2019 04:39:17 -0500https://ask.sagemath.org/question/48532/Yet another linear combinationhttps://ask.sagemath.org/question/10791/yet-another-linear-combination/Hi, I'm really new to Sage and to programming in general. I have 20 linear independent vectors of length 20, and a linear dependent vector. I would like to write this one as a linear combination of the others: I looked up on the internet all day, but nothing I found worked. The ways I tried are:
- define a vector space of dim 20 on the field I'm using, impose my vectors as a base, and use the method .coodinates(). PROBLEM: I couldn't impose the basis, I didn't find a command to do so.
- use G.solve_right(s), where G is a 20x20 matrix and s is my linear dependent vector. I thought I would have a vector as an output but instead I get something of dimension 20x8. Weird.
- I tried to do a linear system directly using equations with the vectors, in order to solve them with respect to some variables, but I got as an output that you can't do it using vectors.
So, what shall I try?
Thank you very much BubusetteteFri, 29 Nov 2013 11:49:42 -0600https://ask.sagemath.org/question/10791/