Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[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?
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started