Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Pls help me solve a task using numpy

$
0
0

I have to solve this system of equations of three unknowns.

10x+5y+0.5z = 100
x+y+z = 100

In course said that you can use for loop, but, in my opinion, it's a difficult way. I think, i can use numpy, but my code is incorrect.

`lang - py

import numpy as np

M1 = np.array([[10., 5., 0.5], [1., 1., 1.]])
v1 = np.array([100., 100.])

np.linalg.inv(M1).dot(v1)

`


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>