I would like to do a minimization and so determine some parameters and one which represent some translations. But i have translations in X and Y directions. I would like to know if it s possible to distingish them? Currently i have the "A2" parameter which take in count the 2 directions but i would like to get A2x and A2y for 2 directions... (i cant minimize in each direction...too easy if i can do that).
import numpy as np
import numpy.ma as ma
def test(vars, r, theta, donnees):
Kappa = vars[0]
A2 = vars[1]
modele = ma.masked_invalid((Kappa + 1/2. + (-1))*np.cos(1*theta/2.) - 5/2.*np.cos((5-4)*theta/2.) +A2)
return (donnees-modele)
#r and theta correspond to polar coordinates and
from scipy.optimize import leastsq
vars = [Kappa, A2] #KI
identif = sco.leastsq(test, vars, args=(rvect, thetavect, Depvect),epsfcn=0.0001)
I m looking for to get something like that :
def test2(vars, r, theta, donnees):
Kappa = vars[0]
A2x = vars[1]
A2y = vars[2]
modele = ma.masked_invalid((Kappa + 1/2. + (-1))*np.cos(1*theta/2.) - 5/2.*np.cos((5-4)*theta/2.) +A2x + A2y)
return (donnees-modele)