-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFORMA2D_F0_J0.m
More file actions
40 lines (36 loc) · 1.18 KB
/
FORMA2D_F0_J0.m
File metadata and controls
40 lines (36 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function [F0x, F0y] = FORMA2D_forcefield(X, Y, DX, DY, dt, gamma)
% FORMA2D 2D implementation of FORMA
%
% [k, Omega, theta, D] = FORMA2D(r, Dt, gamma) calculates the values of the
% trap stiffnesses along the principal axes k=[kx,ky], the
% orientaiton of the principal axes theta, the angular velocity
% Omega, and the particle diffusion coefficients along the
% principla directions D=[Dx,Dy] given a sequence of particle
% positions r=[x,y] (N by 2 matrix) sampled with sampling
% frequency 1/Dt and the friction coefficient gamma of the
% particle.
%
% This code is provided with the article:
%
% High-Performance Reconstruction of Microscopic Force Fields from
% Brownian Trajectories
% Laura Perez Garcia, Jaime DonLucas, Giorgio Volpe, Alejandro V. Arzola
% & Giovanni Volpe
% 2018
%dr = diff(r);
ONEM=ones(size(X));
DXY=gamma/dt*[DX,DY];
XY1=[X,Y,ONEM];
clear ONEM
MLE=(transpose(XY1)*XY1)\transpose(XY1)*DXY;
clear XY1
clear DXY
MLE=MLE';
F0x=gamma*MLE(1,3);
F0y=gamma*MLE(2,3);
%f = gamma*[drx dry]/Dt;
%r1=[rx ry ones(size(rx))];
%Jt =(transpose(r1)*r1)\transpose(r1)*f;
%Jt=Jt';
%F0x=Jt(1,3);
%F0y=Jt(2,3);