(bounds, t, y_meas)
| 36 | Fn, t, Y = data |
| 37 | return np.linalg.norm(Fn(t,A,B,C,D)-Y) |
| 38 | def compute_ABCD(bounds, t, y_meas): |
| 39 | args = (Fn, t, y_meas) |
| 40 | DE_result = differential_evolution(func, bounds, args=args) |
| 41 | soln = { 'success' : DE_result.success, |
| 42 | 'message' : DE_result.message, |
| 43 | 'x' : DE_result.x, |
| 44 | } |
| 45 | if DE_result.success: |
| 46 | y_DE_fit = Fn(t, *DE_result.x) |
| 47 | else: |
| 48 | y_DE_fit = [] |
| 49 | soln['y_fit'] = y_DE_fit |
| 50 | return soln |