Question: [Python] Why is the dFdt not giving me an array? I use the cross product. dBdt is printing out an array and v is initialized
[Python]
Why is the dFdt not giving me an array? I use the cross product. dBdt is printing out an array and v is initialized with s[0:2], shouldn't it print out an array?
![[Python] Why is the dFdt not giving me an array? I use](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3bcd883619_62466f3bcd82487e.jpg)
In [79]: def func(s, t): VX, vy, x, y = 5 #initialize variables 9 = 1.602e-19 #C mue_const = le-7 I = 10 #Amps n = 100 #turns of wire in each coil R = .1 V = s[2:2] z = 5(2:4) dBdt = mue_const * (2*pi*R**2*I)/(2**2 + R**2) ** (3/2) dFdt = q* (np.cross(v, dBdt)) print (dBdt) print(dFdt) return concatenate ([dBdt,dFdt]) so = np.array ([1, 1, 0, .1]) ts = linspace(0,500,300) ans = odeint(func, so, ts, full_output = 1) [6.283185312-05 2.22144147e-85] -6.5069136286368435e-24 ValueError Traceback (most recent call last)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
