python - Setting array element with sequence -


Run this code: Python simulation to calculate potential difference of rod

Setup Details: Visual Import from Visual Import * From __future__ Import Division

  View = Display (X = 0, Y = 0, width = 600, height = 600) Graph = Gdisplay (x = 600, y = 0, width = 400, height = 300)  

Code body:

  # objects Vgraph = gcurve ( Color = color.Sation) marker = spherical (pause = vector (0, .15,0), radius = .05, color = color. Ed) marker.v = vector (0, .5,0) #Constants e = 1.6e-19 oofpez = 9e9 scale = 8e-3dt = 0.001 # initial value l = 2 ## Rod length N = 100 ## Point Charges Q = 3e-8 dQ = Q / NDX = L / nt = 0x = (dx-L) / 2 dVtotal = 0 Annet = Vector (0,0,0) ## Calculating x & Lt; L / 2: spherical (pause = (x, 0,0), radius = 1/6, color = color.sean) x + = dx while marker.pos.y & lt; 1.15: x = (dx-L) / 2net = vector (0,0,0) while X & lt; L / 2: r = marker.po - vector (x, 0,0) rmag = meg (r) rHTH = r / rmag e = orphase * dq / rmagad2 * rhp annet + = e x + = dx dv = - Dot (Annet, .0005), Detachable = DTT + DVT = T + DT Marker.Pause = Marker.Po + + Marker. * DT Wigraphflot (Pause = (T, DVT)) Print ("DitTatal =", Digitotle, "Voltage")  

produces this error:

  traceback (most recent call final): the file "F: / Purdue / Second Semester / PHYS 272 / accrue / lab5.py", line 49, & lt; Module & gt; Vgraph.plot (pos = (t, dVtotal)) file "C: \ Python32 \ lib \ site-packages \ visit \ graph.py", line 742, in plot position, c = primitiveargs (self, args) file "C : \ Python32 \ lib \ site-packages \ visit \ graph.py ", in line 708, primitiveargs pos = array (argument ['pos'], float) Value error: Setting an array element with a sequence.  

How do I fix this?


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -