Jan-14-2019, 03:52 PM

Hello !!!

I'm a physics student trying to solve an experimental problem in fluid dynamics and here is the issue I'm having.

The data output of my experiment is a 2D trajectory ([X,Y] array). I also have a theoretical model in the form of 3 coupled differential equations, solved using Runge Kutta 4, which also gives me a 2D trajectory ([x,y] array). This model depends mainly on 3 constants (a,G,B) of unknown values.

Here is an equivalent python script of my problem:

So finally my question. I'm looking for a tool or an algorithm which could optimize the values of (a,G,B) by trying to minimize the difference between my XY graph and my xy graph.

(I guess that a better way to say it is : "I've 2 distributions, one of which depends on 3 constants. I'm looking for a way to calculate these 3 constants so that the 2 distributions are the same.", but it's harder to understand)

To give you some context on what I already tried.

I tried doing it by hand with sliders but it's way too complicated.

I tried to use scipy.optimize.curve_fit with an intelligent hack, but I'm obviously not intelligent enough .

Now you know everything ... Can you please help me ?

Thanks

I'm a physics student trying to solve an experimental problem in fluid dynamics and here is the issue I'm having.

The data output of my experiment is a 2D trajectory ([X,Y] array). I also have a theoretical model in the form of 3 coupled differential equations, solved using Runge Kutta 4, which also gives me a 2D trajectory ([x,y] array). This model depends mainly on 3 constants (a,G,B) of unknown values.

Here is an equivalent python script of my problem:

import matplotlib.pyplot as plt import numpy as np XY = np.loadtxt("experimental_data.txt") plt.plot(XY[:,0],XY[:,0],label="experimental data") x,y = Solver_diff_eqt(a,B,G) #Solution of my model plt.plot(x,y,label="model") plt.legend() plt.show()Obviously my code is much more complicated, but this is the basic idea.

So finally my question. I'm looking for a tool or an algorithm which could optimize the values of (a,G,B) by trying to minimize the difference between my XY graph and my xy graph.

(I guess that a better way to say it is : "I've 2 distributions, one of which depends on 3 constants. I'm looking for a way to calculate these 3 constants so that the 2 distributions are the same.", but it's harder to understand)

To give you some context on what I already tried.

I tried doing it by hand with sliders but it's way too complicated.

I tried to use scipy.optimize.curve_fit with an intelligent hack, but I'm obviously not intelligent enough .

Now you know everything ... Can you please help me ?

Thanks

You like this post