Python Forum
python odeint keeps giving me size of array error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python odeint keeps giving me size of array error
#2
According to error message, it seems like the array sizes aren't matching
# line 18:
return array([state0, state1]) # array of size 2

# line 35:
psi0 = np.array([0,1,1,0]) # array of size 4

# line 28:
psi = odeint(SE, psi0, x) 
# array returned by SE (line 18) and psi0 should probably be of same size
And looking at the original code, the author has psi0 of size 2.
Reply


Messages In This Thread
RE: python odeint keeps giving me size of array error - by j.crater - Nov-01-2018, 02:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  type error array BrianPA 2 2,425 Jan-17-2021, 01:48 PM
Last Post: BrianPA
  cannot reshape array of size 0 into shape Roro 2 6,295 Jun-14-2020, 11:28 AM
Last Post: Roro
  Mukhanov equation + odeint Messier087 0 1,623 Mar-28-2020, 04:03 PM
Last Post: Messier087
  Odeint to solve Mukhanov equation Messier087 4 2,574 Feb-17-2020, 05:05 PM
Last Post: Messier087
  TensorFlow get error - array with more than one element is ambiguous vokoyo 3 5,565 Nov-07-2019, 01:12 PM
Last Post: ThomasL
  How to get the size of a numpy array? mcgrim 2 2,993 Mar-23-2019, 02:25 PM
Last Post: perfringo
  odeint to solve Schrodinger equation kiyoshi7 14 12,277 Nov-23-2018, 11:49 AM
Last Post: kiyoshi7
  The size of the array returned by func (1) does not match usmankhan 0 4,486 Jan-16-2018, 12:27 PM
Last Post: usmankhan
  error in script "Expected 2D array, got 1D array instead:" drogontargaryen 0 17,844 Aug-07-2017, 04:32 PM
Last Post: drogontargaryen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020