-1

I got these two functions:

mom=-1/2*q*x**2+1/2*q*len*x
quer=-q*x+1/2*q*len

where x is an array defined with numpy:

x=7
q=10
anzahl = 100
x=np.linspace(0, len, anzahl)

I am trying to get the MAX of 'mom' & 'quer" which I get with:

max(mom) & min(mom)

But now I'm trying to get the 'x' value where mom is MAX / MIN

I tried print (x.index(max(mom)) but I think this code doesn't connect the two functions in the right way.

Mr. T
  • 11,960
  • 10
  • 32
  • 54
KayD
  • 372
  • 5
  • 17

1 Answers1

2

In order to find the max index, try to use np.argmax(mom)! https://docs.scipy.org/doc/numpy/reference/generated/numpy.argmax.html

In case of more max points, and all needed: How to make numpy.argmax return all occurrences of the maximum?

Lricsi
  • 36
  • 11