You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Optimization method based on the Nonlinear least squares as well as fmincon for the defined objective function (Non-linear function).
47 views (last 30 days)
Show older comments
Hi there,
I am currently working on a Matlab code for my task (optimization task), and I tried two different methods;
Method A: the fmincon was used to minimize the objective function in which different algorithms, such as interior-point, sqp, sqp-legacy, interior-point, and active-set, were applied.
Method B: Nonlinear least squares optimization was combined with three algorithms, levenberg-marquardt, and trust-region-reflective.
The best results I got now are (from the Nonlinear least squares optimization + 'interior-point'):
RMSE for X, Y, Z Direction(mm) : [1.18, 0.16, 1.33] mm; however, I want to reduce it as far as it is possible.
@ A quick guide for the code, and how it works.
1. I do have 3D data sets, and I used some mathematical methods to convert these 3D data into 2D data (Step 3).
2. The goal is to use some inverse method to get the same 3D datasets; therefore, after defining the objective function, I applied different optimization methods to address this task.
Any assistance or alternative approaches would be greatly appreciated.
Thank you in advance!
% @ Payam Samadi (2025.3.15) NLSP (Nonlinear least squares optimization)
% In step 3, the 2D projection data was extracted from the 3D data at
% different projections.
% In step4, the objective function is defined.
% In step 5, the Nonlinear least squares optimization is used to minimize
% the objective function.
% Algorithm:
% 1. 'levenberg-marquardt' : [1.21, 0.17, 1.39] mm,
% 2. 'trust-region-reflective' : [1.21, 0.17, 1.39] mm,
% 3. 'interior-point' : [1.18, 0.16, 1.33] mm
% Note: It is important to carefully consider the initial guesses for
% target locations, as well as the lower bounds (lb) and upper bounds (ub).
tic;
clc;
clear;
close all;
%% Step 1: Load xls file (3D Tumor position)
Load_Data = xlsread('Sample 1.xlsx'); % Data include 12 (sec)
% Load_Data = xlsread('Sample 2.xlsx'); % Data include 60 (sec)
Time = Load_Data(:,1); % Time (s)
xt=Load_Data(:,2); % xt for targets
yt=Load_Data(:,3); % yt for targets
zt=Load_Data(:,4); % zt for targets
true_T=[xt,yt,zt]; % target locations
[~,numT]=size(true_T); % number of targets
%% Step 2: Define imaging system parameters
SAD = 100; % source-axis distance (cm)
SID = 150; % source-image plane distance (cm)
num_projections = length(Time); % number of different views
% Generate projection angles
alpha = linspace(0, 360, num_projections);
% alpha=30;
theta_rad = deg2rad(alpha); % view angles (radians)
%% Step 3: Projection Model: Compute 2D projections
Xp=zeros(1,num_projections); % allocate array
Yp=zeros(1,num_projections);
for i=1:num_projections
f_theta = (SAD - (true_T(i,1) .* sin(theta_rad(i)) + true_T(i,3) .* cos(theta_rad(i)))) ./ SID;
Xp(1, i) = (true_T(i,1) .* cos(theta_rad(i)) - true_T(i,3) .* sin(theta_rad(i))) ./ f_theta;
Yp(1, i) = true_T(i,2) ./ f_theta;
end
xp = Xp';
yp = Yp';
%% Step 4: Define the objective function
% Define the objective function
objFun = @(T) computeProjectionError(T, xp, yp, theta_rad, SAD, SID, num_projections);
%% Step 5: Minimize the objective function using lsqnonlin
% Algorithm:
% 1. 'levenberg-marquardt' : [1.21, 0.17, 1.39] mm,
% 2. 'trust-region-reflective' : [1.21, 0.17, 1.39] mm,
% 3. 'interior-point' : [1.18, 0.16, 1.33] mm
% Define bounds
lb = []; % Lower bounds
ub = []; % Upper bounds
% Define optimization options
options = optimoptions('lsqnonlin', ...
'Algorithm', 'interior-point', ...
'Display', 'iter', ...
'MaxIterations', 300, ...
'MaxFunctionEvaluations', 20000, ...
'TolFun', 1e-10, ...
'TolX', 1e-10, ...
'StepTolerance', 1e-8, ...
'FiniteDifferenceStepSize', 1e-3, ...
'UseParallel', true);
% Generate a better initial guess
T0 = ones(3, num_projections);
% Run optimization for each projection
estimated_T = zeros(3, num_projections);
for i = 1:num_projections
objFun_i = @(T) computeProjectionError(T, xp(i), yp(i), theta_rad(i), SAD, SID, 1);
estimated_T(:, i) = lsqnonlin(objFun_i, T0(:, i), lb, ub, options);
end
%% Step 6: Calculate RMSE value
% Estimated Tumor Position in X, Y, and Z Direction
Estimate_3D_X = estimated_T(1,:);
Estimate_3D_Y = estimated_T(2,:);
Estimate_3D_Z = estimated_T(3,:);
RMSE_x = Calculate_RMSR (xt,Estimate_3D_X);
RMSE_y = Calculate_RMSR (yt,Estimate_3D_Y);
RMSE_z = Calculate_RMSR (zt,Estimate_3D_Z);
fprintf(['RMSE for X, Y, Z Direction(mm): ' ...
'[%.2f, %.2f, %.2f] mm\n'], RMSE_x, RMSE_y, RMSE_z);
%% Step 7: Plot Estimated vs Real Data
Plot_results (Time, xt, yt, zt, Estimate_3D_X, Estimate_3D_Y, Estimate_3D_Z);
toc;
%% Objective function: Computes error between observed and estimated projections
function error = computeProjectionError(T, xp, yp, theta_rad, SAD, SID, num_projections)
for i=1:num_projections
x_est = T(1,:);
y_est = T(2,:);
z_est = T(3,:);
% Compute estimated projection using the perspective transformation
f_theta = (SAD - (x_est(i) .* sin(theta_rad(i)) + z_est(i) .* cos(theta_rad(i))))./ SID;
xp_est(i) = (x_est(i) .* cos(theta_rad(i)) - z_est(i) .* sin(theta_rad(i))) ./ f_theta;
yp_est(i) = y_est(i) ./ f_theta;
end
%% Compute residual error (Method 1)
% Compute the residual error
error_x = xp - xp_est;
error_y = yp - yp_est;
% Return residuals for least squares minimization
error = [error_x; error_y];
end
function RMSE = Calculate_RMSR (True_value,Estimated_value)
% Calculate RMSE
e1 = (True_value(:)-Estimated_value(:)).^2;
RMSE = sqrt(mean(e1,'omitnan'));
end
function Plot_results (Time, xt, yt, zt, Estimate_3D_X, Estimate_3D_Y, Estimate_3D_Z)
figure('WindowState', 'maximized')
subplot(3,1,1);
plot(Time, Estimate_3D_X,'r');
hold on;
plot(Time, xt,'b');
legend ('Estimate', 'Real');
title ('X Dierction')
xlabel ('Time (s)');
ylabel ('Motion (mm)')
hold off;
subplot(3,1,2);
plot(Time, Estimate_3D_Y,'r');
hold on;
plot(Time, yt,'b');
legend ('Estimate', 'Real');
title ('Y Dierction')
xlabel ('Time (s)');
ylabel ('Motion (mm)')
hold off;
subplot(3,1,3);
plot(Time, Estimate_3D_Z,'r');
hold on;
plot(Time, zt,'b');
legend ('Estimate', 'Real');
title ('Z Dierction')
xlabel ('Time (s)');
ylabel ('Motion (mm)')
hold off;
end
3 Comments
Torsten
on 17 Mar 2025
Edited: Torsten
on 17 Mar 2025
As far as I understand, in the loop
% Run optimization for each projection
estimated_T = zeros(3, num_projections);
for i = 1:num_projections
objFun_i = @(T) computeProjectionError(T, xp(i), yp(i), theta_rad(i), SAD, SID, 1);
estimated_T(:, i) = lsqnonlin(objFun_i, T0(:, i), lb, ub, options);
end
you solve two (after rewriting: linear) equations in three unknowns for each value of i.
Is that really what you want ? Usually, there will be infinitely many solutions for each value of i.
Matt J
on 17 Mar 2025
Since you have no constraints, you may as well use fminunc instead of fmincon, or fsolve instead of lsqnonlin.
payam samadi
on 18 Mar 2025
I made a change in step 5 and defined a new function called "computeProjectionError_b." However, I got some unexpected results that are quite confusing. I'm not sure where I went wrong, but here's what I'm trying to do: In the first loop, I used only the initial guess. For the following iterations, I used the estimated results to update the variables. I should mention that this might not be the best approach, but it was the idea that came to mind. Any help or alternative methods would be greatly appreciated.
Accepted Answer
Matt J
on 18 Mar 2025
Edited: Matt J
on 18 Mar 2025
The goal is to use some inverse method to get the same 3D datasets; therefore, after defining the objective function, I applied different optimization methods to address this task.
But for every time Time(i), you appear to have only one projection view of the tumor position. This is not enough, I'm afraid. As noted by Torsten as well, it will be an underdetermined problem. However, since this appears to be a radiotherapy scenario, and since radiotherapy treatment systems typically have two x-ray imagers, you should be able to get two projections per tumor position. If we adapt your code to this scenario (see below), we can see the inverse problem is easily solved:
%% Step 1: Load xls file (3D Tumor position)
Load_Data = xlsread('Sample 1.xlsx'); % Data include 12 (sec)
% Load_Data = xlsread('Sample 2.xlsx'); % Data include 60 (sec)
Time = Load_Data(:,1); % Time (s)
xt=Load_Data(:,2); % xt for targets
yt=Load_Data(:,3); % yt for targets
zt=Load_Data(:,4); % zt for targets
true_T=[xt,yt,zt]; % target locations
numT=height(true_T); % number of targets
%% Step 2: Define imaging system parameters
SAD = 100; % source-axis distance (cm)
SID = 150; % source-image plane distance (cm)
num_projections = length(Time); % number of different views
% Generate projection angles
alpha = linspace(0, 360, num_projections)';
theta_rad = deg2rad(alpha)+[0,pi/2];
num_detectors=width(theta_rad);
%% Step 3: Projection Model: Compute 2D projections
[Xp,Yp]=deal(nan(num_projections,num_detectors)); % allocate arrays
for i=1:numT
for j=1:num_detectors
f_theta = (SAD - (true_T(i,1) .* sin(theta_rad(i,j)) + true_T(i,3) .* cos(theta_rad(i,j)))) ./ SID;
Xp(i,j) = (true_T(i,1) .* cos(theta_rad(i,j)) - true_T(i,3) .* sin(theta_rad(i,j))) ./ f_theta;
Yp(i,j) = true_T(i,2) ./ f_theta;
end
end
xp=Xp; yp=Yp;
%% Step 4: Define the objective function
tic
T = optimvar('T',[numT,3]);
[eqn1,eqn2]=deal(cell(num_projections,1));
for i=1:numT
for j=1:num_detectors
f_theta = (SAD - (T(i,1) .* sin(theta_rad(i,j)) + T(i,3) .* cos(theta_rad(i,j)))) ./ SID;
eqn1{i,j}=xp(i,j).*f_theta == (T(i,1) .* cos(theta_rad(i,j)) - T(i,3) .* sin(theta_rad(i,j))) ;
eqn2{i,j}=yp(i,j).*f_theta == T(i,2) ;
end
end
prob=eqnproblem();
prob.Equations.eqn1=vertcat(eqn1{:});
prob.Equations.eqn2=vertcat(eqn2{:});
s=prob2struct(prob);
Linear equation problem is overdetermined. Equations will be solved in a least squares sense.
estimated_T=reshape(s.C\s.d,[],3);
toc
Elapsed time is 5.777380 seconds.
%% Step 6: Calculate RMSE value
% Estimated Tumor Position in X, Y, and Z Direction
Estimate_3D_X = estimated_T(:,1);
Estimate_3D_Y = estimated_T(:,2);
Estimate_3D_Z = estimated_T(:,3);
RMSE_x = Calculate_RMSR (xt,Estimate_3D_X);
RMSE_y = Calculate_RMSR (yt,Estimate_3D_Y);
RMSE_z = Calculate_RMSR (zt,Estimate_3D_Z);
fprintf(['RMSE for X, Y, Z Direction(mm): ' ...
'[%.2f, %.2f, %.2f] mm\n'], RMSE_x, RMSE_y, RMSE_z);
RMSE for X, Y, Z Direction(mm): [0.00, 0.00, 0.00] mm
%% Step 7: Plot Estimated vs Real Data
Plot_results_Matt(Time, xt, yt, zt, Estimate_3D_X, Estimate_3D_Y, Estimate_3D_Z);

●
34 Comments
Matt J
on 18 Mar 2025
Note, the approach above reformulates the problem as a set of linear equations, as we have been discussing, and estimates T non-iteratively. This may not give you the most optimal triangulation, as the stochastic errors in xp,yp will be weighted in a weird way. However, it will give you a better initial guess for an iterative optimization, if you wish to go back and refine it.
payam samadi
on 18 Mar 2025
The goal is to use some inverse method to get the same 3D datasets; therefore, after defining the objective function, I applied different optimization methods to address this task.
Yes, indeed.
But for every time Time(i), you appear to have only one projection view of the tumor position. This is not enough, I'm afraid. As noted by Torsten as well, it will be an underdetermined problem. However, since this appears to be a radiotherapy scenario, and since radiotherapy treatment systems typically have two x-ray imagers, you should be able to get two projections per tumor position.
In the best scenario, yes, we can have two X-ray images, but the goal is to extract the 3D tumor position from a single X-ray image (Mv images). For more information, please see this article from Poulsen et al. (2009).
Also, I noticed that I made a mistake and the number "1" should be "num_projections".
The variable "num_projections" in the function "computeProjectionError" is set to 1.
Matt J
on 18 Mar 2025
Edited: Matt J
on 18 Mar 2025
Your link doesn't lead anywhere, so I don't know what Poulsen did. However, it has already been pointed out to you that it is absolutely not possible with only 1 projection and no other constraints. The problem is underdetermined in that case.
Perhaps Poulsen et al. apply special constraints or structure on the problem, but you have not applied any special tricks in your code. You are using a very basic unconstrained model. So you won't be able to get much from it.
payam samadi
on 18 Mar 2025
Thanks for your reply.
Here is the link for the article.
https://iopscience.iop.org/article/10.1088/0031-9155/54/13/005
One more question about the code that used two detectors. If we have new data (some 2d projections at different time intervals), how can we use the current code (the optimized one with the initial datasets; ex 12-second data) to estimate the new 3D position?
payam samadi
on 18 Mar 2025
Dear Matt,
I came up with an interesting idea and would love to hear your thoughts on it.
If we generate a fake projection from the original one (which I have already done), could this serve as a potential solution for our task? I have attached the results for your review.
Looking forward to your insights!
Torsten
on 18 Mar 2025
I think the people with a tumor wouldn't be amused to hear that you localized it with fake projections.
payam samadi
on 18 Mar 2025
Yes, indeed. They may not like the idea, but we are here to explore every possibility before turning it into reality.
Perhaps I didn't express my idea clearly. If you use these two commands:
plotregression(Yp(:,1), Yp(:,2))
The regression for the Y direction is R = 0.99985, indicating a strong linear relationship.
plotregression(Xp(:,1), Xp(:,2))
However, for the X direction, the regression is R = 0.96272, showing some deviation. I believe this suggests a hysteresis pattern rather than a purely linear relationship in the X direction.
What do you think?
Matt J
on 18 Mar 2025
Edited: Matt J
on 18 Mar 2025
If we generate a fake projection from the original one (which I have already done), could this serve as a potential solution for our task? I have attached the results for your review.
No, if the synthetic ("fake") projection is derived from the original projection, it cannot contain any new information. I get very poor results when I run your Method_1.m. Your Results.docx attachment contains no results, only a description of your idea. So, I'm not sure what we were supposed to see.
how can we use the current code (the optimized one with the initial datasets; ex 12-second data)
If you mean, how do you use the original, nonlinear equation model, you can adapt your main loops as below,
T0=____; % Nx3 matrix of initial guesses. Get this from the linear method
estimated_T=nan(numT,3);
options = optimoptions('fsolve', 'Algorithm', 'levenberg-marquardt', 'Display', 'off');
for i=1:numT
i,
T = optimvar('T',[1,3]);
[eqn1,eqn2]=deal(cell(2,1));
for j=1:num_detectors
f_theta = (SAD - (T(1) .* sin(theta_rad(i,j)) + T(3) .* cos(theta_rad(i,j)))) ./ SID;
eqn1{j}=xp(i,j) == (T(1) .* cos(theta_rad(i,j)) - T(3) .* sin(theta_rad(i,j)))./f_theta ;
eqn2{j}=yp(i,j) == T(2)./f_theta ;
end
prob=eqnproblem();
prob.Equations.eqn1=vertcat(eqn1{:});
prob.Equations.eqn2=vertcat(eqn2{:});
sol0.T=T0(i,:);
estimated_T(i,:) = solve(prob, sol0, 'Options', options).T;
end
Torsten
on 18 Mar 2025
Why do you use a nonlinear solver ? Shouldn't "\" or "lsqlin" suffice to solve for T after multiplying by f_theta ?
Matt J
on 18 Mar 2025
Edited: Matt J
on 18 Mar 2025
@Torsten If there is no measurement noise in xp,yp then either modeling approach will give the same result. However, since there is generally additve stochastic noise in the measurements, cross-multiplying by f_theta creates a non-additive noise-model, and that is usually not ideal.
Although, as I've said, the linear solution is still useful as an initializer for the nonlinear solution.
payam samadi
on 19 Mar 2025
Edited: payam samadi
on 21 Mar 2025
Dear Matt and Torsen,
I was quite surprised to find that, even in my worst-case (attached here), the RMSE value in all three directions was zero. However, I would expect some degree of deviation in certain cases. Could you help me understand if this result is expected, or if there might be an issue with the calculations?
Updated Note: I am working on the Matt code. (2D projection from two detectors).
payam samadi
on 19 Mar 2025
Updated Note: I am working on the Matt code. (2D projection from two detectors).
Matt J
on 19 Mar 2025
Your Xp, Yp aren't dervied from real measurements. You are still simulating them from a set of known T values with no errors. If you add errors to your simulation, like below, you will see that you don't get a perfect re-estimate of T.
sig=0.3; %simulated error standard deviation
for i=1:numT
for j=1:num_detectors
f_theta = (SAD - (true_T(i,1) .* sin(theta_rad(i,j)) + true_T(i,3) .* cos(theta_rad(i,j)))) ./ SID;
Xp(i,j) = (true_T(i,1) .* cos(theta_rad(i,j)) - true_T(i,3) .* sin(theta_rad(i,j))) ./ f_theta;
Yp(i,j) = true_T(i,2) ./ f_theta;
Xp(i,j)=Xp(i,j) + sig*randn;
Yp(i,j)=Yp(i,j) + sig*randn;
end
end
Torsten
on 19 Mar 2025
The equations you define and solve for T just recover exactly the true_T values you used in the loop before. This means that you get RMSE values of 0.
payam samadi
on 19 Mar 2025
Correct. I see now that I missed the point of recovering the true_T values used in the previous loop.
If you are still solving the 1-projection problem, there is no way to predict the result.
But this article shows that it is possible (see the apendix part), doesn’t it?
https://iopscience.iop.org/article/10.1088/0031-9155/54/13/005
Matt J
on 19 Mar 2025
Edited: Matt J
on 19 Mar 2025
Even if so, they are working with a different model for the tumor position, one that may have fewer degrees of freedom than the one in your code. In your code, you give the tumor position a full 3 degrees of freedom (x,y,z) per time point. It is easy to see that this is under-determined when you have only 1 projection.
payam samadi
on 19 Mar 2025
Moved: Matt J
on 19 Mar 2025
Here is the code based on Poulsen et al., 2009.
I would like to express my deep appreciation for William Rose’s help during the development of this code. However, when I ran the code, I encountered the following error:
"Error using barrier: Objective function is undefined at initial point. Fmincon cannot continue."
Any help to resolve this issue would be greatly appreciated.
payam samadi
on 19 Mar 2025
Edited: payam samadi
on 19 Mar 2025
Thanks Matt,
We don't know what you did... If you are still solving the 1-projection problem, there is no way to predict the result.
You asked me for the code for this task, I shared it with you.
If you have time, I would appreciate it if you could take a look at the code and possibly help me resolve the issue. Otherwise, I'm grateful for previous tips and assistance you provided.
If the Poulsen code was developeed with William Rose in another thread...
William and I are both working on it together.
Matt J
on 19 Mar 2025
Edited: Matt J
on 19 Mar 2025
William and I are both working on it together.
If you give the link to that thread, Torsten and/or I and/or others might join it to see what we can contribute. However, as for the fmincon error message, it looks pretty simple. It is telling you that evaluating your objective function at x0 is returning nan or inf. So, you need to finish debugging your objective function before trying to minimize it. Usually you would investigate the error by calling the objective function on x0 separately with the debugger active and see what is going on.
Torsten
on 19 Mar 2025
payam samadi
on 20 Mar 2025
Thank you, Torsten, for sharing the thread.
As you can see at the end of the thread, William and I have decided to move to private communication via email. If you and Torsten are interested, I can send you a private message with my email address. This way, we can discuss things more carefully.
Please let me know.
payam samadi
on 22 Mar 2025
Edited: Torsten
on 22 Mar 2025
Dear Matt,
Thanks for your clue. I finished debugging the code. It gave me some initial results, but it was too far from my expectations (Please see the difference between the covariance matrix from the Real data and Estimation).
I attached the code here and I think there might be two possibilities for it.
1. The code may be getting trapped in local minima (Please take a moment to review the notes at the beginning of the code). This could be due to an incorrect initial guess for LvecInit in the computeError function, improper selection of the lower (LB) and upper (UB) bounds, or the use of an unsuitable optimization method for this task. Also, three methods to optimize the objective function, including fmincon (results in no convergence since the matrix B (inverse covariance matrix) is not positive definite), elder-Mead (simple) as well as Nelder-Mead (with constraint) [both run and get some results; but it so far from my expectations].
2. The code functions correctly, but step 3 (Projection Model: Compute 2D projections) employs an incorrect method for projecting the 3D data into a 2D projection.
I also attached my notes from the article that are related to this work (I used this information during implementation), as I thought they would be helpful.
Please let me know if you come up with any ideas.
Thanks in advance for your time.
% Payam Samadi and William Rose, 2025-03-19.
% After loading the data and defining the system parameters in
% steps 1 and 2, the 2D projections are estimated from the original datasets.
% A simulated error standard deviation (sigma) is then added to
% the 2D projection datasets (Step 3).
% Step 4: Estimate distribution parameters (Appendix of Poulsen et al.,
% 2009).
% The code is not working; the problem comes from FMLE (Nan or INF).
%%
% New Update (2025.3.21): The lb and ub parameters have been replaced
% with LvecInit, which serves as the initial guess for Lvec.
% The code has been executed accordingly.
% Step 5 has also been included to evaluate the results
% from the estimated Final_Vec_opt against the real data.
% Three methods were utilized to optimize the objective function (Objective.m):
% 1. Method 1: fmincon
% 2. Method 2: Simple Nelder-Mead
% 3. Method 3: Nelder-Mead with constraints
% Two possibilities have been identified for this part:
% 1. The code may be getting trapped in local minima [The LvecInit
% (initial guess for Lvec) in computer error is wrong, or
% the lower bounds (LB), as well as upper bounds (UP), should be modified].
% 2. The code functions correctly, but step 2 employs
% an incorrect method for projecting the 3D data into a 2D projection.
%%
tic
clc
clear
close all
%% Step 1: Load xls file (3D Tumor position)
Load_Data = xlsread('Sample 1.xlsx'); % Data include 12 (sec)
Time = Load_Data(:,1); % Time (s)
xt=Load_Data(:,2); % xt for targets
yt=Load_Data(:,3); % yt for targets
zt=Load_Data(:,4); % zt for targets
true_T=[xt,yt,zt]; % target locations
numT=height(true_T); % number of targets
%% Step 2: Define imaging system parameters
SAD = 100; % source-axis distance (cm)
SID = 150; % source-image plane distance (cm)
num_projections = length(Time); % number of different views
% Generate projection angles
alpha = linspace(0, 360, num_projections)';
theta_rad = deg2rad(alpha);
num_detectors= 1;
%% Step 3: Projection Model: Compute 2D projections
% Add simulated error standard deviation (sig) to the projection
sig=0.05; %simulated error standard deviation
[Xp,Yp]=deal(nan(num_projections,num_detectors)); % allocate arrays
for i=1:numT
for j=1:num_detectors
f_theta = (SAD - (true_T(i,1) .* sin(theta_rad(i,j)) + true_T(i,3) .* cos(theta_rad(i,j)))) ./ SID;
Xp(i,j) = (true_T(i,1) .* cos(theta_rad(i,j)) - true_T(i,3) .* sin(theta_rad(i,j))) ./ f_theta;
Yp(i,j) = true_T(i,2) ./ f_theta;
Xp(i,j)=Xp(i,j) + sig*randn;
Yp(i,j)=Yp(i,j) + sig*randn;
end
end
%% Step 4: Estimate distribution parameters (Appendix of Poulsen et al., 2009).
% Matrix LvecArray is nine unknowns vector.
% My unknowns are 3 means, 3 standard deviations, and 3 correlations:
% [mx, my, mz, sx, sy, sz, rxy, ryz, rzx].
Final_Vec_opt = computeError(Xp, Yp, SAD, SID, alpha);
Iteration Func-count f(x) Procedure
0 1 8619.35
1 10 7974.99 initial simplex
2 11 7974.99 reflect
3 12 7974.99 reflect
4 13 7974.99 reflect
5 14 7974.99 reflect
6 15 7974.99 reflect
7 16 7974.99 reflect
8 17 7974.99 reflect
9 18 7974.99 reflect
10 20 7589.13 expand
11 21 7589.13 reflect
12 22 7589.13 reflect
13 23 7589.13 reflect
14 25 7201.26 expand
15 26 7201.26 reflect
16 27 7201.26 reflect
17 28 7201.26 reflect
18 30 6717.09 expand
19 31 6717.09 reflect
20 32 6717.09 reflect
21 34 6289.29 expand
22 35 6289.29 reflect
23 36 6289.29 reflect
24 38 5851.48 expand
25 39 5851.48 reflect
26 40 5851.48 reflect
27 42 5200.62 expand
28 43 5200.62 reflect
29 44 5200.62 reflect
30 45 5200.62 reflect
31 47 4684.1 expand
32 48 4684.1 reflect
33 49 4684.1 reflect
34 50 4684.1 reflect
35 52 4381.69 expand
36 53 4381.69 reflect
37 55 4020.94 expand
38 56 4020.94 reflect
39 57 4020.94 reflect
40 58 4020.94 reflect
41 60 4004.97 reflect
42 61 4004.97 reflect
43 62 4004.97 reflect
44 64 4004.97 contract inside
45 65 4004.97 reflect
46 67 3905.98 expand
47 69 3905.98 contract inside
48 71 3815.96 expand
49 72 3815.96 reflect
50 74 3709.4 expand
51 76 3494.74 expand
52 77 3494.74 reflect
53 78 3494.74 reflect
54 79 3494.74 reflect
55 81 3214.3 expand
56 82 3214.3 reflect
57 83 3214.3 reflect
58 85 2942.63 expand
59 86 2942.63 reflect
60 87 2942.63 reflect
61 88 2942.63 reflect
62 89 2942.63 reflect
63 90 2942.63 reflect
64 92 2498.89 expand
65 93 2498.89 reflect
66 94 2498.89 reflect
67 95 2498.89 reflect
68 96 2498.89 reflect
69 97 2498.89 reflect
70 99 2319.05 expand
71 100 2319.05 reflect
72 102 2031.24 expand
73 103 2031.24 reflect
74 104 2031.24 reflect
75 105 2031.24 reflect
76 106 2031.24 reflect
77 108 1896.67 expand
78 109 1896.67 reflect
79 111 1790.95 expand
80 112 1790.95 reflect
81 113 1790.95 reflect
82 114 1790.95 reflect
83 115 1790.95 reflect
84 117 1739.92 expand
85 118 1739.92 reflect
86 119 1739.92 reflect
87 121 1737.17 reflect
88 122 1737.17 reflect
89 123 1737.17 reflect
90 125 1735.64 reflect
91 126 1735.64 reflect
92 127 1735.64 reflect
93 129 1735.64 contract outside
94 131 1735.64 contract inside
95 133 1735.64 contract inside
96 135 1735.64 contract inside
97 136 1735.64 reflect
98 138 1729.84 expand
99 139 1729.84 reflect
100 141 1729.84 contract outside
101 142 1729.84 reflect
102 143 1729.84 reflect
103 145 1729.84 contract inside
104 147 1729.84 contract inside
105 148 1729.84 reflect
106 150 1729.5 reflect
107 151 1729.5 reflect
108 152 1729.5 reflect
109 154 1723.58 expand
110 155 1723.58 reflect
111 157 1723.58 contract inside
112 159 1723.58 contract inside
113 160 1723.58 reflect
114 161 1723.58 reflect
115 162 1723.58 reflect
116 163 1723.58 reflect
117 164 1723.58 reflect
118 166 1721.83 expand
119 167 1721.83 reflect
120 169 1721.83 contract inside
121 171 1717.56 expand
122 172 1717.56 reflect
123 173 1717.56 reflect
124 174 1717.56 reflect
125 175 1717.56 reflect
126 177 1717.37 reflect
127 179 1716.75 reflect
128 180 1716.75 reflect
129 182 1715.18 reflect
130 184 1715.18 contract inside
131 186 1712.7 expand
132 187 1712.7 reflect
133 188 1712.7 reflect
134 189 1712.7 reflect
135 191 1712.7 contract inside
136 192 1712.7 reflect
137 194 1712.55 reflect
138 196 1712.05 reflect
139 197 1712.05 reflect
140 198 1712.05 reflect
141 199 1712.05 reflect
142 200 1712.05 reflect
143 201 1712.05 reflect
144 202 1712.05 reflect
145 204 1712.05 contract inside
146 206 1712.05 contract inside
147 208 1712.05 contract inside
148 210 1712.05 contract inside
149 212 1712.05 contract outside
150 214 1712.05 contract inside
151 216 1712.05 contract inside
152 218 1712.05 contract outside
153 220 1712.05 contract inside
154 222 1712.05 contract inside
155 224 1712.05 contract inside
156 226 1712.05 contract inside
157 227 1712.05 reflect
158 228 1712.05 reflect
159 230 1712.03 contract inside
160 232 1712.03 contract inside
161 234 1712.03 contract inside
162 235 1712.03 reflect
163 237 1712.03 contract inside
164 239 1712.03 contract inside
165 241 1712.02 contract inside
166 243 1712.02 contract inside
167 245 1712.02 contract outside
168 247 1712.02 contract inside
169 249 1712.02 contract inside
170 250 1712.02 reflect
171 251 1712.02 reflect
172 253 1712.01 contract inside
173 255 1712.01 contract inside
174 257 1712.01 contract inside
175 258 1712.01 reflect
176 259 1712.01 reflect
177 261 1712 contract inside
178 263 1712 contract inside
179 265 1712 contract inside
180 266 1712 reflect
181 267 1712 reflect
182 268 1712 reflect
183 270 1712 contract inside
184 272 1712 contract inside
185 273 1712 reflect
186 275 1712 contract inside
187 277 1712 contract inside
188 279 1712 contract inside
189 281 1712 contract inside
190 283 1712 contract inside
191 285 1712 contract outside
192 287 1712 contract inside
193 289 1712 contract inside
194 290 1712 reflect
195 292 1712 contract inside
196 293 1712 reflect
197 295 1712 contract inside
198 296 1712 reflect
199 297 1712 reflect
200 299 1712 contract inside
201 301 1712 contract inside
202 303 1712 contract outside
203 304 1712 reflect
204 306 1712 contract inside
205 307 1712 reflect
206 309 1712 contract inside
207 310 1712 reflect
208 311 1712 reflect
209 312 1712 reflect
210 313 1712 reflect
211 315 1712 reflect
212 316 1712 reflect
213 317 1712 reflect
214 319 1712 reflect
215 321 1712 contract inside
216 323 1712 contract inside
217 325 1712 reflect
218 326 1712 reflect
219 328 1712 contract inside
220 329 1712 reflect
221 331 1712 reflect
222 332 1712 reflect
223 334 1712 contract inside
224 336 1712 contract inside
225 338 1712 expand
226 339 1712 reflect
227 340 1712 reflect
228 341 1712 reflect
229 343 1712 contract inside
230 344 1712 reflect
231 345 1712 reflect
232 347 1712 expand
233 348 1712 reflect
234 349 1712 reflect
235 350 1712 reflect
236 351 1712 reflect
237 353 1712 expand
238 354 1712 reflect
239 355 1712 reflect
240 357 1712 expand
241 358 1712 reflect
242 360 1712 expand
243 361 1712 reflect
244 362 1712 reflect
245 364 1712 expand
246 365 1712 reflect
247 367 1711.99 expand
248 368 1711.99 reflect
249 369 1711.99 reflect
250 371 1711.99 expand
251 373 1711.99 expand
252 374 1711.99 reflect
253 375 1711.99 reflect
254 376 1711.99 reflect
255 377 1711.99 reflect
256 379 1711.98 expand
257 380 1711.98 reflect
258 381 1711.98 reflect
259 382 1711.98 reflect
260 383 1711.98 reflect
261 384 1711.98 reflect
262 385 1711.98 reflect
263 387 1711.98 expand
264 388 1711.98 reflect
265 389 1711.98 reflect
266 391 1711.97 expand
267 392 1711.97 reflect
268 393 1711.97 reflect
269 395 1711.97 expand
270 396 1711.97 reflect
271 398 1711.96 expand
272 400 1711.95 expand
273 401 1711.95 reflect
274 402 1711.95 reflect
275 404 1711.94 expand
276 405 1711.94 reflect
277 406 1711.94 reflect
278 408 1711.93 expand
279 409 1711.93 reflect
280 410 1711.93 reflect
281 412 1711.91 expand
282 413 1711.91 reflect
283 414 1711.91 reflect
284 415 1711.91 reflect
285 417 1711.89 expand
286 418 1711.89 reflect
287 420 1711.86 expand
288 421 1711.86 reflect
289 422 1711.86 reflect
290 423 1711.86 reflect
291 424 1711.86 reflect
292 426 1711.82 expand
293 427 1711.82 reflect
294 428 1711.82 reflect
295 429 1711.82 reflect
296 431 1711.77 expand
297 432 1711.77 reflect
298 433 1711.77 reflect
299 435 1711.7 expand
300 436 1711.7 reflect
301 437 1711.7 reflect
302 438 1711.7 reflect
303 439 1711.7 reflect
304 441 1711.6 expand
305 442 1711.6 reflect
306 443 1711.6 reflect
307 444 1711.6 reflect
308 445 1711.6 reflect
309 447 1711.49 expand
310 448 1711.49 reflect
311 449 1711.49 reflect
312 451 1711.42 expand
313 453 1711.29 expand
314 454 1711.29 reflect
315 455 1711.29 reflect
316 456 1711.29 reflect
317 457 1711.29 reflect
318 459 1711.11 expand
319 460 1711.11 reflect
320 461 1711.11 reflect
321 462 1711.11 reflect
322 464 1710.98 expand
323 465 1710.98 reflect
324 466 1710.98 reflect
325 468 1710.92 expand
326 469 1710.92 reflect
327 470 1710.92 reflect
328 472 1710.78 expand
329 473 1710.78 reflect
330 474 1710.78 reflect
331 476 1710.78 reflect
332 477 1710.78 reflect
333 478 1710.78 reflect
334 480 1710.78 contract inside
335 481 1710.78 reflect
336 482 1710.78 reflect
337 483 1710.78 reflect
338 485 1710.77 reflect
339 486 1710.77 reflect
340 487 1710.77 reflect
341 489 1710.75 reflect
342 490 1710.75 reflect
343 492 1710.71 expand
344 494 1710.68 expand
345 495 1710.68 reflect
346 496 1710.68 reflect
347 497 1710.68 reflect
348 499 1710.68 contract inside
349 500 1710.68 reflect
350 502 1710.66 reflect
351 503 1710.66 reflect
352 504 1710.66 reflect
353 505 1710.66 reflect
354 507 1710.66 contract inside
355 508 1710.66 reflect
356 509 1710.66 reflect
357 510 1710.66 reflect
358 512 1710.66 contract inside
359 514 1710.66 contract inside
360 515 1710.66 reflect
361 517 1710.66 contract inside
362 519 1710.66 contract inside
363 520 1710.66 reflect
364 522 1710.66 contract outside
365 524 1710.66 reflect
366 526 1710.66 contract inside
367 528 1710.66 contract inside
368 530 1710.66 contract inside
369 531 1710.66 reflect
370 533 1710.66 contract outside
371 534 1710.66 reflect
372 536 1710.66 contract inside
373 537 1710.66 reflect
374 539 1710.66 contract inside
375 540 1710.66 reflect
376 542 1710.66 contract inside
377 544 1710.66 contract inside
378 546 1710.66 contract inside
379 548 1710.66 contract inside
380 550 1710.66 contract inside
381 552 1710.66 contract outside
382 553 1710.66 reflect
383 555 1710.66 contract inside
384 557 1710.66 contract inside
385 559 1710.66 contract inside
386 561 1710.66 contract inside
387 563 1710.66 contract inside
388 565 1710.66 contract inside
389 567 1710.66 contract inside
390 569 1710.66 contract inside
391 571 1710.66 reflect
392 573 1710.66 reflect
393 575 1710.66 contract inside
394 577 1710.66 contract inside
395 579 1710.66 reflect
396 581 1710.66 contract inside
397 582 1710.66 reflect
398 584 1710.65 reflect
399 586 1710.65 contract inside
400 588 1710.65 contract inside
401 590 1710.65 expand
402 591 1710.65 reflect
403 593 1710.65 contract inside
404 594 1710.65 reflect
405 595 1710.65 reflect
406 596 1710.65 reflect
407 598 1710.65 reflect
408 600 1710.65 expand
409 602 1710.65 expand
410 603 1710.65 reflect
411 604 1710.65 reflect
412 605 1710.65 reflect
413 606 1710.65 reflect
414 608 1710.65 expand
415 609 1710.65 reflect
416 610 1710.65 reflect
417 611 1710.65 reflect
418 612 1710.65 reflect
419 613 1710.65 reflect
420 615 1710.65 expand
421 616 1710.65 reflect
422 617 1710.65 reflect
423 619 1710.65 expand
424 620 1710.65 reflect
425 622 1710.65 expand
426 623 1710.65 reflect
427 625 1710.65 expand
428 626 1710.65 reflect
429 628 1710.65 expand
430 629 1710.65 reflect
431 630 1710.65 reflect
432 632 1710.65 expand
433 633 1710.65 reflect
434 634 1710.65 reflect
435 635 1710.65 reflect
436 637 1710.64 expand
437 639 1710.64 expand
438 640 1710.64 reflect
439 642 1710.64 expand
440 643 1710.64 reflect
441 645 1710.63 expand
442 646 1710.63 reflect
443 647 1710.63 reflect
444 648 1710.63 reflect
445 650 1710.63 expand
446 651 1710.63 reflect
447 652 1710.63 reflect
448 653 1710.63 reflect
449 655 1710.62 expand
450 657 1710.61 expand
451 658 1710.61 reflect
452 659 1710.61 reflect
453 660 1710.61 reflect
454 661 1710.61 reflect
455 662 1710.61 reflect
456 663 1710.61 reflect
457 665 1710.59 expand
458 666 1710.59 reflect
459 667 1710.59 reflect
460 668 1710.59 reflect
461 669 1710.59 reflect
462 670 1710.59 reflect
463 672 1710.56 expand
464 673 1710.56 reflect
465 675 1710.55 expand
466 676 1710.55 reflect
467 677 1710.55 reflect
468 678 1710.55 reflect
469 680 1710.53 expand
470 681 1710.53 reflect
471 683 1710.51 expand
472 685 1710.46 expand
473 686 1710.46 reflect
474 687 1710.46 reflect
475 688 1710.46 reflect
476 689 1710.46 reflect
477 691 1710.43 expand
478 692 1710.43 reflect
479 693 1710.43 reflect
480 694 1710.43 reflect
481 696 1710.38 expand
482 698 1710.32 expand
483 699 1710.32 reflect
484 700 1710.32 reflect
485 701 1710.32 reflect
486 702 1710.32 reflect
487 703 1710.32 reflect
488 704 1710.32 reflect
489 706 1710.27 expand
490 708 1710.24 expand
491 709 1710.24 reflect
492 710 1710.24 reflect
493 712 1710.2 expand
494 713 1710.2 reflect
495 715 1710.11 expand
496 716 1710.11 reflect
497 717 1710.11 reflect
498 718 1710.11 reflect
499 719 1710.11 reflect
500 720 1710.11 reflect
501 721 1710.11 reflect
502 722 1710.11 reflect
503 724 1710.07 expand
504 726 1710.02 expand
505 727 1710.02 reflect
506 728 1710.02 reflect
507 730 1709.9 expand
508 731 1709.9 reflect
509 733 1709.74 expand
510 734 1709.74 reflect
511 735 1709.74 reflect
512 736 1709.74 reflect
513 737 1709.74 reflect
514 739 1709.6 expand
515 740 1709.6 reflect
516 742 1709.28 expand
517 743 1709.28 reflect
518 744 1709.28 reflect
519 745 1709.28 reflect
520 746 1709.28 reflect
521 748 1709.14 expand
522 749 1709.14 reflect
523 751 1708.92 expand
524 753 1708.67 expand
525 754 1708.67 reflect
526 755 1708.67 reflect
527 756 1708.67 reflect
528 758 1708.63 reflect
529 760 1708.19 expand
530 761 1708.19 reflect
531 762 1708.19 reflect
532 764 1707.92 expand
533 766 1707.72 expand
534 767 1707.72 reflect
535 768 1707.72 reflect
536 769 1707.72 reflect
537 770 1707.72 reflect
538 771 1707.72 reflect
539 772 1707.72 reflect
540 773 1707.72 reflect
541 775 1707.5 expand
542 776 1707.5 reflect
543 777 1707.5 reflect
544 778 1707.5 reflect
545 779 1707.5 reflect
546 780 1707.5 reflect
547 781 1707.5 reflect
548 783 1707.5 contract inside
549 784 1707.5 reflect
550 785 1707.5 reflect
551 786 1707.5 reflect
552 787 1707.5 reflect
553 789 1707.46 reflect
554 790 1707.46 reflect
555 791 1707.46 reflect
556 792 1707.46 reflect
557 794 1707.46 contract inside
558 795 1707.46 reflect
559 797 1707.46 contract inside
560 798 1707.46 reflect
561 800 1707.45 contract inside
562 801 1707.45 reflect
563 803 1707.45 contract inside
564 804 1707.45 reflect
565 806 1707.43 contract inside
566 808 1707.43 contract outside
567 810 1707.42 contract inside
568 812 1707.4 contract inside
569 814 1707.39 contract inside
570 815 1707.39 reflect
571 816 1707.39 reflect
572 818 1707.39 contract outside
573 820 1707.39 contract inside
574 822 1707.39 contract outside
575 824 1707.39 contract inside
576 825 1707.39 reflect
577 826 1707.39 reflect
578 828 1707.39 contract inside
579 830 1707.39 contract inside
580 832 1707.39 contract inside
581 834 1707.39 contract inside
582 836 1707.39 contract inside
583 838 1707.39 contract inside
584 839 1707.39 reflect
585 840 1707.39 reflect
586 842 1707.38 contract inside
587 844 1707.38 contract inside
588 846 1707.38 contract inside
589 848 1707.38 contract outside
590 850 1707.38 contract inside
591 851 1707.38 reflect
592 853 1707.38 contract inside
593 854 1707.38 reflect
594 855 1707.38 reflect
595 857 1707.38 contract inside
596 859 1707.38 contract inside
597 861 1707.38 contract inside
598 863 1707.38 contract inside
599 865 1707.38 contract inside
600 867 1707.38 contract outside
601 869 1707.38 contract inside
602 870 1707.38 reflect
603 871 1707.38 reflect
604 873 1707.38 reflect
605 875 1707.38 contract inside
606 877 1707.38 contract inside
607 879 1707.38 contract inside
608 880 1707.38 reflect
609 882 1707.38 contract inside
610 883 1707.38 reflect
611 885 1707.38 contract inside
612 887 1707.38 contract inside
613 889 1707.38 contract inside
614 891 1707.38 contract inside
615 893 1707.38 reflect
616 895 1707.38 contract inside
617 896 1707.38 reflect
618 898 1707.38 contract inside
619 900 1707.38 reflect
620 901 1707.38 reflect
621 902 1707.38 reflect
622 903 1707.38 reflect
623 905 1707.38 reflect
624 907 1707.38 contract inside
625 908 1707.38 reflect
626 909 1707.38 reflect
627 911 1707.38 contract inside
628 913 1707.38 contract inside
629 915 1707.38 reflect
630 916 1707.38 reflect
631 918 1707.38 reflect
632 919 1707.38 reflect
633 921 1707.38 contract inside
634 923 1707.38 contract outside
635 924 1707.38 reflect
636 925 1707.38 reflect
637 926 1707.38 reflect
638 927 1707.38 reflect
639 928 1707.38 reflect
640 929 1707.38 reflect
641 930 1707.38 reflect
642 932 1707.38 reflect
643 934 1707.38 expand
644 935 1707.38 reflect
645 936 1707.38 reflect
646 937 1707.38 reflect
647 938 1707.38 reflect
648 939 1707.38 reflect
649 940 1707.38 reflect
650 941 1707.38 reflect
651 943 1707.38 reflect
652 944 1707.38 reflect
653 945 1707.38 reflect
654 946 1707.38 reflect
655 947 1707.38 reflect
656 949 1707.38 contract inside
657 950 1707.38 reflect
658 952 1707.38 reflect
659 953 1707.38 reflect
660 954 1707.38 reflect
661 955 1707.38 reflect
662 957 1707.38 contract inside
663 958 1707.38 reflect
664 960 1707.38 reflect
665 961 1707.38 reflect
666 962 1707.38 reflect
667 963 1707.38 reflect
668 964 1707.38 reflect
669 966 1707.38 contract inside
670 968 1707.38 contract inside
671 970 1707.38 contract inside
672 971 1707.38 reflect
673 973 1707.38 contract inside
674 975 1707.38 contract inside
675 976 1707.38 reflect
676 978 1707.38 contract inside
677 980 1707.38 reflect
678 982 1707.38 contract inside
679 984 1707.38 reflect
680 985 1707.38 reflect
681 986 1707.38 reflect
682 988 1707.38 contract inside
683 989 1707.38 reflect
684 991 1707.38 contract inside
685 992 1707.38 reflect
686 993 1707.38 reflect
687 994 1707.38 reflect
688 996 1707.38 contract outside
689 998 1707.38 reflect
690 1000 1707.38 contract inside
691 1001 1707.38 reflect
692 1002 1707.38 reflect
693 1004 1707.38 contract inside
694 1006 1707.38 contract inside
695 1007 1707.38 reflect
696 1008 1707.38 reflect
697 1009 1707.38 reflect
698 1011 1707.38 contract inside
699 1013 1707.38 contract inside
700 1014 1707.38 reflect
701 1016 1707.38 contract outside
702 1018 1707.38 contract inside
703 1020 1707.38 reflect
704 1021 1707.38 reflect
705 1022 1707.38 reflect
706 1024 1707.38 contract inside
707 1025 1707.38 reflect
708 1026 1707.38 reflect
709 1028 1707.38 reflect
710 1029 1707.38 reflect
711 1030 1707.38 reflect
712 1031 1707.38 reflect
713 1033 1707.38 contract outside
714 1035 1707.38 contract inside
715 1036 1707.38 reflect
716 1038 1707.38 contract inside
717 1040 1707.38 contract outside
718 1042 1707.38 contract inside
719 1044 1707.38 expand
720 1045 1707.38 reflect
721 1046 1707.38 reflect
722 1047 1707.38 reflect
723 1049 1707.38 contract inside
724 1050 1707.38 reflect
725 1051 1707.38 reflect
726 1052 1707.38 reflect
727 1053 1707.38 reflect
728 1054 1707.38 reflect
729 1055 1707.38 reflect
730 1056 1707.38 reflect
731 1057 1707.38 reflect
732 1059 1707.38 expand
733 1060 1707.38 reflect
734 1061 1707.38 reflect
735 1063 1707.38 expand
736 1064 1707.38 reflect
737 1065 1707.38 reflect
738 1066 1707.38 reflect
739 1067 1707.38 reflect
740 1068 1707.38 reflect
741 1070 1707.38 expand
742 1071 1707.38 reflect
743 1072 1707.38 reflect
744 1074 1707.38 expand
745 1076 1707.38 expand
746 1077 1707.38 reflect
747 1078 1707.38 reflect
748 1079 1707.38 reflect
749 1081 1707.38 expand
750 1082 1707.38 reflect
751 1083 1707.38 reflect
752 1084 1707.38 reflect
753 1086 1707.38 expand
754 1087 1707.38 reflect
755 1088 1707.38 reflect
756 1089 1707.38 reflect
757 1090 1707.38 reflect
758 1092 1707.38 expand
759 1093 1707.38 reflect
760 1094 1707.38 reflect
761 1096 1707.38 expand
762 1097 1707.38 reflect
763 1098 1707.38 reflect
764 1099 1707.38 reflect
765 1101 1707.38 expand
766 1103 1707.38 expand
767 1104 1707.38 reflect
768 1105 1707.38 reflect
769 1107 1707.38 expand
770 1108 1707.38 reflect
771 1109 1707.38 reflect
772 1110 1707.38 reflect
773 1112 1707.38 expand
774 1113 1707.38 reflect
775 1115 1707.38 expand
776 1116 1707.38 reflect
777 1117 1707.38 reflect
778 1119 1707.38 expand
779 1120 1707.38 reflect
780 1121 1707.38 reflect
781 1123 1707.38 expand
782 1124 1707.38 reflect
783 1125 1707.38 reflect
784 1127 1707.38 expand
785 1128 1707.38 reflect
786 1129 1707.38 reflect
787 1130 1707.38 reflect
788 1132 1707.38 expand
789 1133 1707.38 reflect
790 1134 1707.38 reflect
791 1135 1707.38 reflect
792 1137 1707.38 expand
793 1138 1707.38 reflect
794 1139 1707.38 reflect
795 1141 1707.38 expand
796 1142 1707.38 reflect
797 1143 1707.38 reflect
798 1145 1707.38 expand
799 1146 1707.38 reflect
800 1147 1707.38 reflect
801 1148 1707.38 reflect
802 1150 1707.38 expand
803 1151 1707.38 reflect
804 1152 1707.38 reflect
805 1153 1707.38 reflect
806 1155 1707.37 expand
807 1156 1707.37 reflect
808 1157 1707.37 reflect
809 1158 1707.37 reflect
810 1160 1707.37 expand
811 1162 1707.37 expand
812 1163 1707.37 reflect
813 1164 1707.37 reflect
814 1166 1707.37 expand
815 1167 1707.37 reflect
816 1168 1707.37 reflect
817 1169 1707.37 reflect
818 1170 1707.37 reflect
819 1171 1707.37 reflect
820 1173 1707.37 expand
821 1174 1707.37 reflect
822 1175 1707.37 reflect
823 1176 1707.37 reflect
824 1177 1707.37 reflect
825 1178 1707.37 reflect
826 1179 1707.37 reflect
827 1181 1707.37 expand
828 1183 1707.37 expand
829 1184 1707.37 reflect
830 1185 1707.37 reflect
831 1187 1707.37 expand
832 1188 1707.37 reflect
833 1190 1707.36 expand
834 1191 1707.36 reflect
835 1192 1707.36 reflect
836 1193 1707.36 reflect
837 1195 1707.36 expand
838 1196 1707.36 reflect
839 1197 1707.36 reflect
840 1198 1707.36 reflect
841 1199 1707.36 reflect
842 1201 1707.36 expand
843 1202 1707.36 reflect
844 1204 1707.36 expand
845 1205 1707.36 reflect
846 1206 1707.36 reflect
847 1208 1707.35 expand
848 1209 1707.35 reflect
849 1210 1707.35 reflect
850 1212 1707.35 expand
851 1213 1707.35 reflect
852 1214 1707.35 reflect
853 1216 1707.35 expand
854 1218 1707.35 expand
855 1220 1707.34 expand
856 1221 1707.34 reflect
857 1222 1707.34 reflect
858 1223 1707.34 reflect
859 1224 1707.34 reflect
860 1225 1707.34 reflect
861 1226 1707.34 reflect
862 1227 1707.34 reflect
863 1228 1707.34 reflect
864 1229 1707.34 reflect
865 1230 1707.34 reflect
866 1232 1707.34 expand
867 1233 1707.34 reflect
868 1234 1707.34 reflect
869 1236 1707.33 expand
870 1237 1707.33 reflect
871 1238 1707.33 reflect
872 1239 1707.33 reflect
873 1241 1707.33 expand
874 1242 1707.33 reflect
875 1243 1707.33 reflect
876 1244 1707.33 reflect
877 1245 1707.33 reflect
878 1247 1707.32 expand
879 1248 1707.32 reflect
880 1249 1707.32 reflect
881 1251 1707.31 expand
882 1252 1707.31 reflect
883 1253 1707.31 reflect
884 1254 1707.31 reflect
885 1256 1707.3 expand
886 1257 1707.3 reflect
887 1259 1707.3 expand
888 1260 1707.3 reflect
889 1262 1707.29 expand
890 1263 1707.29 reflect
891 1264 1707.29 reflect
892 1265 1707.29 reflect
893 1267 1707.28 expand
894 1268 1707.28 reflect
895 1269 1707.28 reflect
896 1271 1707.28 reflect
897 1272 1707.28 reflect
898 1273 1707.28 reflect
899 1275 1707.26 expand
900 1276 1707.26 reflect
901 1277 1707.26 reflect
902 1278 1707.26 reflect
903 1279 1707.26 reflect
904 1280 1707.26 reflect
905 1282 1707.26 contract inside
906 1283 1707.26 reflect
907 1284 1707.26 reflect
908 1285 1707.26 reflect
909 1287 1707.25 expand
910 1288 1707.25 reflect
911 1289 1707.25 reflect
912 1291 1707.24 reflect
913 1293 1707.21 expand
914 1294 1707.21 reflect
915 1295 1707.21 reflect
916 1296 1707.21 reflect
917 1297 1707.21 reflect
918 1298 1707.21 reflect
919 1299 1707.21 reflect
920 1300 1707.21 reflect
921 1301 1707.21 reflect
922 1303 1707.2 reflect
923 1305 1707.17 expand
924 1306 1707.17 reflect
925 1307 1707.17 reflect
926 1308 1707.17 reflect
927 1309 1707.17 reflect
928 1310 1707.17 reflect
929 1311 1707.17 reflect
930 1313 1707.15 expand
931 1315 1707.11 expand
932 1316 1707.11 reflect
933 1317 1707.11 reflect
934 1318 1707.11 reflect
935 1319 1707.11 reflect
936 1321 1707.11 reflect
937 1322 1707.11 reflect
938 1323 1707.11 reflect
939 1325 1707.05 expand
940 1326 1707.05 reflect
941 1328 1707.02 expand
942 1329 1707.02 reflect
943 1330 1707.02 reflect
944 1331 1707.02 reflect
945 1332 1707.02 reflect
946 1333 1707.02 reflect
947 1334 1707.02 reflect
948 1336 1707.02 reflect
949 1338 1706.98 expand
950 1339 1706.98 reflect
951 1341 1706.92 expand
952 1342 1706.92 reflect
953 1343 1706.92 reflect
954 1344 1706.92 reflect
955 1345 1706.92 reflect
956 1347 1706.91 expand
957 1349 1706.9 reflect
958 1351 1706.9 reflect
959 1353 1706.82 expand
960 1354 1706.82 reflect
961 1356 1706.74 expand
962 1357 1706.74 reflect
963 1359 1706.65 expand
964 1360 1706.65 reflect
965 1361 1706.65 reflect
966 1362 1706.65 reflect
967 1363 1706.65 reflect
968 1365 1706.56 expand
969 1366 1706.56 reflect
970 1367 1706.56 reflect
971 1368 1706.56 reflect
972 1369 1706.56 reflect
973 1370 1706.56 reflect
974 1371 1706.56 reflect
975 1373 1706.54 reflect
976 1374 1706.54 reflect
977 1375 1706.54 reflect
978 1377 1706.54 contract inside
979 1378 1706.54 reflect
980 1380 1706.54 reflect
981 1381 1706.54 reflect
982 1382 1706.54 reflect
983 1383 1706.54 reflect
984 1385 1706.5 reflect
985 1386 1706.5 reflect
986 1388 1706.5 contract outside
987 1389 1706.5 reflect
988 1391 1706.5 contract inside
989 1393 1706.5 contract inside
990 1394 1706.5 reflect
991 1395 1706.5 reflect
992 1397 1706.5 contract outside
993 1398 1706.5 reflect
994 1399 1706.5 reflect
995 1401 1706.5 contract inside
996 1402 1706.5 reflect
997 1403 1706.5 reflect
998 1404 1706.5 reflect
999 1406 1706.45 expand
1000 1407 1706.45 reflect
1001 1408 1706.45 reflect
1002 1409 1706.45 reflect
1003 1411 1706.45 contract outside
1004 1413 1706.45 expand
1005 1415 1706.45 reflect
1006 1416 1706.45 reflect
1007 1418 1706.44 reflect
1008 1420 1706.41 expand
1009 1422 1706.36 expand
1010 1423 1706.36 reflect
1011 1424 1706.36 reflect
1012 1425 1706.36 reflect
1013 1426 1706.36 reflect
1014 1427 1706.36 reflect
1015 1429 1706.31 expand
1016 1430 1706.31 reflect
1017 1431 1706.31 reflect
1018 1433 1706.25 expand
1019 1434 1706.25 reflect
1020 1435 1706.25 reflect
1021 1436 1706.25 reflect
1022 1437 1706.25 reflect
1023 1439 1706.24 reflect
1024 1441 1706.2 expand
1025 1442 1706.2 reflect
1026 1443 1706.2 reflect
1027 1445 1706.19 reflect
1028 1446 1706.19 reflect
1029 1448 1706.12 expand
1030 1449 1706.12 reflect
1031 1450 1706.12 reflect
1032 1451 1706.12 reflect
1033 1452 1706.12 reflect
1034 1453 1706.12 reflect
1035 1454 1706.12 reflect
1036 1456 1706.04 expand
1037 1457 1706.04 reflect
1038 1458 1706.04 reflect
1039 1460 1706.04 contract outside
1040 1462 1705.99 expand
1041 1463 1705.99 reflect
1042 1464 1705.99 reflect
1043 1465 1705.99 reflect
1044 1466 1705.99 reflect
1045 1467 1705.99 reflect
1046 1469 1705.98 reflect
1047 1470 1705.98 reflect
1048 1471 1705.98 reflect
1049 1472 1705.98 reflect
1050 1473 1705.98 reflect
1051 1475 1705.95 reflect
1052 1477 1705.95 contract outside
1053 1479 1705.95 contract inside
1054 1480 1705.95 reflect
1055 1481 1705.95 reflect
1056 1482 1705.95 reflect
1057 1484 1705.95 contract inside
1058 1486 1705.95 reflect
1059 1487 1705.95 reflect
1060 1488 1705.95 reflect
1061 1489 1705.95 reflect
1062 1491 1705.95 contract inside
1063 1493 1705.89 expand
1064 1494 1705.89 reflect
1065 1496 1705.89 contract inside
1066 1497 1705.89 reflect
1067 1499 1705.89 contract inside
1068 1500 1705.89 reflect
1069 1501 1705.89 reflect
1070 1503 1705.89 contract inside
1071 1504 1705.89 reflect
1072 1505 1705.89 reflect
1073 1506 1705.89 reflect
1074 1507 1705.89 reflect
1075 1508 1705.89 reflect
1076 1509 1705.89 reflect
1077 1510 1705.89 reflect
1078 1511 1705.89 reflect
1079 1512 1705.89 reflect
1080 1513 1705.89 reflect
1081 1515 1705.89 contract inside
1082 1516 1705.89 reflect
1083 1517 1705.89 reflect
1084 1518 1705.89 reflect
1085 1520 1705.89 contract inside
1086 1522 1705.89 contract inside
1087 1524 1705.89 contract inside
1088 1525 1705.89 reflect
1089 1527 1705.89 contract inside
1090 1528 1705.89 reflect
1091 1530 1705.89 contract outside
1092 1532 1705.89 contract inside
1093 1534 1705.89 contract inside
1094 1536 1705.88 contract inside
1095 1538 1705.88 contract inside
1096 1539 1705.88 reflect
1097 1540 1705.88 reflect
1098 1542 1705.88 contract inside
1099 1544 1705.88 reflect
1100 1546 1705.88 contract inside
1101 1547 1705.88 reflect
1102 1548 1705.88 reflect
1103 1549 1705.88 reflect
1104 1551 1705.88 contract inside
1105 1553 1705.88 contract inside
1106 1555 1705.88 contract outside
1107 1557 1705.88 contract inside
1108 1558 1705.88 reflect
1109 1560 1705.88 contract inside
1110 1561 1705.88 reflect
1111 1563 1705.88 contract inside
1112 1564 1705.88 reflect
1113 1566 1705.88 contract outside
1114 1568 1705.88 contract inside
1115 1569 1705.88 reflect
1116 1570 1705.88 reflect
1117 1572 1705.88 contract inside
1118 1573 1705.88 reflect
1119 1575 1705.88 contract inside
1120 1576 1705.88 reflect
1121 1578 1705.88 contract inside
1122 1580 1705.88 contract inside
1123 1581 1705.88 reflect
1124 1583 1705.88 contract inside
1125 1585 1705.88 contract inside
1126 1586 1705.88 reflect
1127 1588 1705.88 contract inside
1128 1590 1705.88 contract inside
1129 1592 1705.88 contract inside
1130 1594 1705.88 contract inside
1131 1595 1705.88 reflect
1132 1597 1705.88 contract inside
1133 1599 1705.88 contract inside
1134 1601 1705.88 contract inside
1135 1603 1705.88 contract inside
1136 1605 1705.88 contract inside
1137 1607 1705.88 contract outside
1138 1609 1705.88 contract inside
1139 1610 1705.88 reflect
1140 1612 1705.88 contract inside
1141 1614 1705.88 contract inside
1142 1616 1705.88 contract inside
1143 1618 1705.88 contract outside
1144 1620 1705.88 contract inside
1145 1622 1705.88 contract inside
1146 1624 1705.88 reflect
1147 1625 1705.88 reflect
1148 1626 1705.88 reflect
1149 1628 1705.88 contract inside
1150 1630 1705.88 contract inside
1151 1632 1705.88 contract inside
1152 1633 1705.88 reflect
1153 1635 1705.88 reflect
1154 1636 1705.88 reflect
1155 1638 1705.88 reflect
1156 1640 1705.88 contract inside
1157 1641 1705.88 reflect
1158 1642 1705.88 reflect
1159 1644 1705.88 contract inside
1160 1646 1705.88 contract inside
1161 1648 1705.88 contract inside
1162 1649 1705.88 reflect
1163 1651 1705.88 contract inside
1164 1652 1705.88 reflect
1165 1654 1705.88 contract inside
1166 1656 1705.88 contract inside
1167 1657 1705.88 reflect
1168 1659 1705.88 contract inside
1169 1660 1705.88 reflect
1170 1661 1705.88 reflect
1171 1662 1705.88 reflect
1172 1664 1705.88 reflect
1173 1665 1705.88 reflect
1174 1667 1705.88 contract inside
1175 1669 1705.88 contract inside
1176 1671 1705.88 contract inside
1177 1672 1705.88 reflect
1178 1674 1705.88 contract inside
1179 1675 1705.88 reflect
1180 1677 1705.88 contract inside
1181 1679 1705.88 contract inside
1182 1681 1705.88 contract inside
1183 1683 1705.88 contract inside
1184 1685 1705.88 contract inside
1185 1686 1705.88 reflect
1186 1688 1705.88 contract inside
1187 1690 1705.88 contract outside
1188 1692 1705.88 contract inside
1189 1693 1705.88 reflect
1190 1695 1705.88 contract inside
1191 1696 1705.88 reflect
1192 1697 1705.88 reflect
1193 1699 1705.88 contract inside
1194 1701 1705.88 contract inside
1195 1702 1705.88 reflect
1196 1703 1705.88 reflect
1197 1705 1705.88 contract inside
1198 1707 1705.88 contract inside
1199 1709 1705.88 contract inside
1200 1711 1705.88 contract inside
1201 1713 1705.88 contract inside
1202 1715 1705.88 reflect
1203 1716 1705.88 reflect
1204 1718 1705.88 contract inside
1205 1719 1705.88 reflect
1206 1721 1705.88 contract inside
1207 1723 1705.88 contract inside
1208 1724 1705.88 reflect
1209 1725 1705.88 reflect
1210 1726 1705.88 reflect
1211 1728 1705.88 reflect
1212 1729 1705.88 reflect
1213 1731 1705.88 contract inside
1214 1732 1705.88 reflect
1215 1734 1705.88 contract inside
1216 1736 1705.88 contract outside
1217 1738 1705.88 contract inside
1218 1739 1705.88 reflect
1219 1741 1705.88 contract inside
1220 1742 1705.88 reflect
1221 1743 1705.88 reflect
1222 1745 1705.88 reflect
1223 1747 1705.88 contract inside
1224 1748 1705.88 reflect
1225 1750 1705.88 contract inside
1226 1752 1705.88 contract inside
1227 1753 1705.88 reflect
1228 1754 1705.88 reflect
1229 1756 1705.88 reflect
1230 1758 1705.88 contract inside
1231 1760 1705.88 contract inside
1232 1761 1705.88 reflect
1233 1763 1705.88 contract inside
1234 1765 1705.88 reflect
1235 1767 1705.88 contract inside
1236 1768 1705.88 reflect
1237 1769 1705.88 reflect
1238 1770 1705.88 reflect
1239 1772 1705.88 contract inside
1240 1774 1705.88 contract inside
1241 1775 1705.88 reflect
1242 1777 1705.88 expand
1243 1779 1705.88 expand
1244 1780 1705.88 reflect
1245 1781 1705.88 reflect
1246 1782 1705.88 reflect
1247 1783 1705.88 reflect
1248 1784 1705.88 reflect
1249 1786 1705.88 expand
1250 1788 1705.88 expand
1251 1789 1705.88 reflect
1252 1790 1705.88 reflect
1253 1791 1705.88 reflect
1254 1792 1705.88 reflect
1255 1794 1705.88 expand
1256 1795 1705.88 reflect
1257 1796 1705.88 reflect
1258 1798 1705.88 expand
1259 1799 1705.88 reflect
1260 1801 1705.88 expand
1261 1802 1705.88 reflect
1262 1803 1705.88 reflect
1263 1805 1705.88 expand
1264 1806 1705.88 reflect
1265 1808 1705.88 expand
1266 1809 1705.88 reflect
1267 1810 1705.88 reflect
1268 1812 1705.88 expand
1269 1813 1705.88 reflect
1270 1814 1705.88 reflect
1271 1816 1705.88 expand
1272 1818 1705.88 expand
1273 1820 1705.88 expand
1274 1821 1705.88 reflect
1275 1822 1705.88 reflect
1276 1823 1705.88 reflect
1277 1824 1705.88 reflect
1278 1825 1705.88 reflect
1279 1827 1705.88 reflect
1280 1828 1705.88 reflect
1281 1830 1705.88 expand
1282 1831 1705.88 reflect
1283 1832 1705.88 reflect
1284 1833 1705.88 reflect
1285 1835 1705.88 expand
1286 1836 1705.88 reflect
1287 1837 1705.88 reflect
1288 1838 1705.88 reflect
1289 1840 1705.88 expand
1290 1841 1705.88 reflect
1291 1842 1705.88 reflect
1292 1843 1705.88 reflect
1293 1844 1705.88 reflect
1294 1846 1705.88 expand
1295 1847 1705.88 reflect
1296 1848 1705.88 reflect
1297 1850 1705.88 expand
1298 1851 1705.88 reflect
1299 1852 1705.88 reflect
1300 1853 1705.88 reflect
1301 1854 1705.88 reflect
1302 1855 1705.88 reflect
1303 1857 1705.88 reflect
1304 1859 1705.88 expand
1305 1860 1705.88 reflect
1306 1861 1705.88 reflect
1307 1863 1705.88 expand
1308 1865 1705.88 expand
1309 1866 1705.88 reflect
1310 1868 1705.88 expand
1311 1869 1705.88 reflect
1312 1870 1705.88 reflect
1313 1872 1705.88 expand
1314 1873 1705.88 reflect
1315 1874 1705.88 reflect
1316 1876 1705.88 expand
1317 1877 1705.88 reflect
1318 1878 1705.88 reflect
1319 1879 1705.88 reflect
1320 1881 1705.88 reflect
1321 1883 1705.88 contract inside
1322 1885 1705.88 expand
1323 1886 1705.88 reflect
1324 1887 1705.88 reflect
1325 1889 1705.88 expand
1326 1891 1705.88 expand
1327 1893 1705.88 expand
1328 1895 1705.88 expand
1329 1896 1705.88 reflect
1330 1898 1705.88 expand
1331 1899 1705.88 reflect
1332 1900 1705.88 reflect
1333 1902 1705.88 expand
1334 1903 1705.88 reflect
1335 1904 1705.88 reflect
1336 1905 1705.88 reflect
1337 1907 1705.88 expand
1338 1909 1705.88 expand
1339 1910 1705.88 reflect
1340 1911 1705.88 reflect
1341 1912 1705.88 reflect
1342 1913 1705.88 reflect
1343 1914 1705.88 reflect
1344 1916 1705.88 reflect
1345 1918 1705.88 expand
1346 1919 1705.88 reflect
1347 1920 1705.88 reflect
1348 1921 1705.88 reflect
1349 1922 1705.88 reflect
1350 1924 1705.88 expand
1351 1926 1705.88 expand
1352 1927 1705.88 reflect
1353 1928 1705.88 reflect
1354 1930 1705.88 expand
1355 1931 1705.88 reflect
1356 1932 1705.88 reflect
1357 1933 1705.88 reflect
1358 1935 1705.88 expand
1359 1936 1705.88 reflect
1360 1937 1705.88 reflect
1361 1938 1705.88 reflect
1362 1940 1705.88 expand
1363 1941 1705.88 reflect
1364 1942 1705.88 reflect
1365 1944 1705.88 expand
1366 1945 1705.88 reflect
1367 1946 1705.88 reflect
1368 1947 1705.88 reflect
1369 1949 1705.88 expand
1370 1950 1705.88 reflect
1371 1952 1705.88 expand
1372 1953 1705.88 reflect
1373 1954 1705.88 reflect
1374 1955 1705.88 reflect
1375 1957 1705.88 expand
1376 1958 1705.88 reflect
1377 1959 1705.88 reflect
1378 1961 1705.88 expand
1379 1962 1705.88 reflect
1380 1963 1705.88 reflect
1381 1964 1705.88 reflect
1382 1965 1705.88 reflect
1383 1967 1705.88 expand
1384 1968 1705.88 reflect
1385 1970 1705.88 expand
1386 1971 1705.88 reflect
1387 1972 1705.88 reflect
1388 1973 1705.88 reflect
1389 1974 1705.88 reflect
1390 1975 1705.88 reflect
1391 1977 1705.88 expand
1392 1978 1705.88 reflect
1393 1979 1705.88 reflect
1394 1980 1705.88 reflect
1395 1981 1705.88 reflect
1396 1983 1705.88 reflect
1397 1985 1705.88 expand
1398 1986 1705.88 reflect
1399 1987 1705.88 reflect
1400 1989 1705.88 contract inside
1401 1990 1705.88 reflect
1402 1991 1705.88 reflect
1403 1992 1705.88 reflect
1404 1993 1705.88 reflect
1405 1994 1705.88 reflect
1406 1996 1705.88 expand
1407 1997 1705.88 reflect
1408 1999 1705.88 expand
1409 2000 1705.88 reflect
1410 2001 1705.88 reflect
1411 2002 1705.88 reflect
1412 2003 1705.88 reflect
1413 2005 1705.88 expand
1414 2006 1705.88 reflect
1415 2007 1705.88 reflect
1416 2009 1705.88 expand
1417 2010 1705.88 reflect
1418 2011 1705.88 reflect
1419 2012 1705.88 reflect
1420 2014 1705.88 expand
1421 2015 1705.88 reflect
1422 2016 1705.88 reflect
1423 2017 1705.88 reflect
1424 2018 1705.88 reflect
1425 2020 1705.88 expand
1426 2022 1705.88 expand
1427 2024 1705.88 expand
1428 2025 1705.88 reflect
1429 2027 1705.88 expand
1430 2028 1705.88 reflect
1431 2029 1705.88 reflect
1432 2030 1705.88 reflect
1433 2031 1705.88 reflect
1434 2033 1705.88 contract inside
1435 2035 1705.88 expand
1436 2036 1705.88 reflect
1437 2037 1705.88 reflect
1438 2038 1705.88 reflect
1439 2040 1705.88 expand
1440 2041 1705.88 reflect
1441 2043 1705.88 contract inside
1442 2044 1705.88 reflect
1443 2046 1705.88 expand
1444 2047 1705.88 reflect
1445 2048 1705.88 reflect
1446 2049 1705.88 reflect
1447 2050 1705.88 reflect
1448 2052 1705.88 reflect
1449 2054 1705.88 reflect
1450 2055 1705.88 reflect
1451 2056 1705.88 reflect
1452 2058 1705.88 reflect
1453 2060 1705.88 expand
1454 2061 1705.88 reflect
1455 2063 1705.88 contract outside
1456 2064 1705.88 reflect
1457 2065 1705.88 reflect
1458 2066 1705.88 reflect
1459 2068 1705.88 expand
1460 2069 1705.88 reflect
1461 2070 1705.88 reflect
1462 2071 1705.88 reflect
1463 2073 1705.88 expand
1464 2075 1705.88 reflect
1465 2077 1705.88 reflect
1466 2078 1705.88 reflect
1467 2080 1705.88 expand
1468 2082 1705.88 expand
1469 2083 1705.88 reflect
1470 2084 1705.88 reflect
1471 2085 1705.88 reflect
1472 2086 1705.88 reflect
1473 2087 1705.88 reflect
1474 2089 1705.88 reflect
1475 2091 1705.88 expand
1476 2093 1705.88 expand
1477 2094 1705.88 reflect
1478 2096 1705.88 expand
1479 2098 1705.88 expand
1480 2100 1705.88 reflect
1481 2101 1705.88 reflect
1482 2103 1705.88 reflect
1483 2104 1705.88 reflect
1484 2106 1705.88 reflect
1485 2108 1705.88 contract outside
1486 2110 1705.88 expand
1487 2111 1705.88 reflect
1488 2112 1705.88 reflect
1489 2113 1705.88 reflect
1490 2114 1705.88 reflect
1491 2115 1705.88 reflect
1492 2116 1705.88 reflect
1493 2117 1705.88 reflect
1494 2118 1705.88 reflect
1495 2119 1705.88 reflect
1496 2121 1705.88 reflect
1497 2122 1705.88 reflect
1498 2124 1705.88 reflect
1499 2125 1705.88 reflect
1500 2127 1705.88 reflect
1501 2128 1705.88 reflect
1502 2129 1705.88 reflect
1503 2131 1705.88 reflect
1504 2132 1705.88 reflect
1505 2133 1705.88 reflect
1506 2135 1705.88 contract inside
1507 2136 1705.88 reflect
1508 2138 1705.88 contract inside
1509 2140 1705.88 expand
1510 2141 1705.88 reflect
1511 2142 1705.88 reflect
1512 2143 1705.88 reflect
1513 2144 1705.88 reflect
1514 2146 1705.88 expand
1515 2147 1705.88 reflect
1516 2149 1705.87 expand
1517 2150 1705.87 reflect
1518 2151 1705.87 reflect
1519 2152 1705.87 reflect
1520 2153 1705.87 reflect
1521 2155 1705.87 reflect
1522 2156 1705.87 reflect
1523 2158 1705.87 reflect
1524 2159 1705.87 reflect
1525 2161 1705.87 reflect
1526 2163 1705.87 reflect
1527 2164 1705.87 reflect
1528 2165 1705.87 reflect
1529 2166 1705.87 reflect
1530 2168 1705.87 expand
1531 2169 1705.87 reflect
1532 2171 1705.87 reflect
1533 2172 1705.87 reflect
1534 2173 1705.87 reflect
1535 2175 1705.87 reflect
1536 2176 1705.87 reflect
1537 2178 1705.87 expand
1538 2179 1705.87 reflect
1539 2180 1705.87 reflect
1540 2181 1705.87 reflect
1541 2183 1705.87 reflect
1542 2184 1705.87 reflect
1543 2186 1705.87 reflect
1544 2188 1705.87 reflect
1545 2190 1705.87 reflect
1546 2191 1705.87 reflect
1547 2193 1705.87 expand
1548 2194 1705.87 reflect
1549 2195 1705.87 reflect
1550 2196 1705.87 reflect
1551 2197 1705.87 reflect
1552 2199 1705.87 reflect
1553 2200 1705.87 reflect
1554 2201 1705.87 reflect
1555 2203 1705.87 expand
1556 2204 1705.87 reflect
1557 2205 1705.87 reflect
1558 2206 1705.87 reflect
1559 2207 1705.87 reflect
1560 2208 1705.87 reflect
1561 2210 1705.87 reflect
1562 2212 1705.87 reflect
1563 2214 1705.87 expand
1564 2215 1705.87 reflect
1565 2217 1705.87 expand
1566 2218 1705.87 reflect
1567 2219 1705.87 reflect
1568 2220 1705.87 reflect
1569 2221 1705.87 reflect
1570 2223 1705.86 expand
1571 2224 1705.86 reflect
1572 2226 1705.86 expand
1573 2227 1705.86 reflect
1574 2228 1705.86 reflect
1575 2229 1705.86 reflect
1576 2230 1705.86 reflect
1577 2231 1705.86 reflect
1578 2233 1705.86 expand
1579 2234 1705.86 reflect
1580 2235 1705.86 reflect
1581 2236 1705.86 reflect
1582 2237 1705.86 reflect
1583 2239 1705.85 expand
1584 2241 1705.85 expand
1585 2242 1705.85 reflect
1586 2243 1705.85 reflect
1587 2245 1705.84 expand
1588 2246 1705.84 reflect
1589 2247 1705.84 reflect
1590 2248 1705.84 reflect
1591 2249 1705.84 reflect
1592 2251 1705.84 expand
1593 2252 1705.84 reflect
1594 2253 1705.84 reflect
1595 2254 1705.84 reflect
1596 2255 1705.84 reflect
1597 2256 1705.84 reflect
1598 2258 1705.83 expand
1599 2260 1705.82 expand
1600 2261 1705.82 reflect
1601 2262 1705.82 reflect
1602 2264 1705.82 contract inside
1603 2266 1705.82 expand
1604 2267 1705.82 reflect
1605 2268 1705.82 reflect
1606 2269 1705.82 reflect
1607 2271 1705.8 expand
1608 2272 1705.8 reflect
1609 2273 1705.8 reflect
1610 2274 1705.8 reflect
1611 2275 1705.8 reflect
1612 2276 1705.8 reflect
1613 2278 1705.79 expand
1614 2279 1705.79 reflect
1615 2280 1705.79 reflect
1616 2282 1705.79 expand
1617 2283 1705.79 reflect
1618 2285 1705.77 expand
1619 2286 1705.77 reflect
1620 2287 1705.77 reflect
1621 2289 1705.77 expand
1622 2290 1705.77 reflect
1623 2291 1705.77 reflect
1624 2292 1705.77 reflect
1625 2294 1705.77 reflect
1626 2295 1705.77 reflect
1627 2297 1705.74 expand
1628 2298 1705.74 reflect
1629 2299 1705.74 reflect
1630 2300 1705.74 reflect
1631 2301 1705.74 reflect
1632 2303 1705.73 expand
1633 2304 1705.73 reflect
1634 2305 1705.73 reflect
1635 2306 1705.73 reflect
1636 2307 1705.73 reflect
1637 2309 1705.69 expand
1638 2310 1705.69 reflect
1639 2311 1705.69 reflect
1640 2312 1705.69 reflect
1641 2313 1705.69 reflect
1642 2314 1705.69 reflect
1643 2316 1705.68 expand
1644 2318 1705.65 expand
1645 2319 1705.65 reflect
1646 2321 1705.61 expand
1647 2322 1705.61 reflect
1648 2323 1705.61 reflect
1649 2324 1705.61 reflect
1650 2325 1705.61 reflect
1651 2327 1705.57 expand
1652 2328 1705.57 reflect
1653 2329 1705.57 reflect
1654 2331 1705.53 expand
1655 2332 1705.53 reflect
1656 2334 1705.5 expand
1657 2336 1705.44 expand
1658 2337 1705.44 reflect
1659 2338 1705.44 reflect
1660 2339 1705.44 reflect
1661 2341 1705.42 expand
1662 2342 1705.42 reflect
1663 2343 1705.42 reflect
1664 2345 1705.25 expand
1665 2346 1705.25 reflect
1666 2347 1705.25 reflect
1667 2348 1705.25 reflect
1668 2349 1705.25 reflect
1669 2350 1705.25 reflect
1670 2351 1705.25 reflect
1671 2352 1705.25 reflect
1672 2353 1705.25 reflect
1673 2355 1705.14 expand
1674 2357 1705.01 expand
1675 2358 1705.01 reflect
1676 2359 1705.01 reflect
1677 2360 1705.01 reflect
1678 2361 1705.01 reflect
1679 2363 1704.79 expand
1680 2364 1704.79 reflect
1681 2365 1704.79 reflect
1682 2366 1704.79 reflect
1683 2367 1704.79 reflect
1684 2368 1704.79 reflect
1685 2370 1704.55 expand
1686 2371 1704.55 reflect
1687 2372 1704.55 reflect
1688 2374 1704.42 expand
1689 2375 1704.42 reflect
1690 2377 1704.27 expand
1691 2378 1704.27 reflect
1692 2380 1703.71 expand
1693 2381 1703.71 reflect
1694 2382 1703.71 reflect
1695 2383 1703.71 reflect
1696 2385 1703.32 expand
1697 2386 1703.32 reflect
1698 2388 1702.89 expand
1699 2389 1702.89 reflect
1700 2391 1702.24 expand
1701 2392 1702.24 reflect
1702 2393 1702.24 reflect
1703 2394 1702.24 reflect
1704 2396 1701.4 expand
1705 2397 1701.4 reflect
1706 2398 1701.4 reflect
1707 2400 1700.53 expand
1708 2401 1700.53 reflect
1709 2402 1700.53 reflect
1710 2404 1699.23 expand
1711 2405 1699.23 reflect
1712 2406 1699.23 reflect
1713 2407 1699.23 reflect
1714 2408 1699.23 reflect
1715 2409 1699.23 reflect
1716 2411 1698.41 expand
1717 2412 1698.41 reflect
1718 2413 1698.41 reflect
1719 2415 1697.13 expand
1720 2416 1697.13 reflect
1721 2417 1697.13 reflect
1722 2418 1697.13 reflect
1723 2419 1697.13 reflect
1724 2421 1695.91 expand
1725 2422 1695.91 reflect
1726 2424 1695.91 contract inside
1727 2426 1695.88 reflect
1728 2427 1695.88 reflect
1729 2429 1694.73 expand
1730 2430 1694.73 reflect
1731 2431 1694.73 reflect
1732 2433 1693.24 expand
1733 2434 1693.24 reflect
1734 2435 1693.24 reflect
1735 2437 1692.48 expand
1736 2438 1692.48 reflect
1737 2439 1692.48 reflect
1738 2440 1692.48 reflect
1739 2441 1692.48 reflect
1740 2442 1692.48 reflect
1741 2444 1692.47 reflect
1742 2446 1692.12 reflect
1743 2448 1691.87 reflect
1744 2450 1691.14 reflect
1745 2451 1691.14 reflect
1746 2452 1691.14 reflect
1747 2453 1691.14 reflect
1748 2454 1691.14 reflect
1749 2455 1691.14 reflect
1750 2456 1691.14 reflect
1751 2458 1691.14 contract inside
1752 2460 1689.82 expand
1753 2461 1689.82 reflect
1754 2462 1689.82 reflect
1755 2463 1689.82 reflect
1756 2464 1689.82 reflect
1757 2465 1689.82 reflect
1758 2467 1689.58 reflect
1759 2468 1689.58 reflect
1760 2470 1688.81 reflect
1761 2472 1688.81 contract inside
1762 2473 1688.81 reflect
1763 2475 1688.25 reflect
1764 2476 1688.25 reflect
1765 2477 1688.25 reflect
1766 2478 1688.25 reflect
1767 2480 1687.97 reflect
1768 2481 1687.97 reflect
1769 2482 1687.97 reflect
1770 2484 1687.69 reflect
1771 2485 1687.69 reflect
1772 2487 1687.05 reflect
1773 2489 1687.05 contract outside
1774 2491 1687.05 contract inside
1775 2492 1687.05 reflect
1776 2494 1685.99 expand
1777 2495 1685.99 reflect
1778 2496 1685.99 reflect
1779 2497 1685.99 reflect
1780 2498 1685.99 reflect
1781 2500 1685.97 reflect
1782 2502 1684.67 expand
1783 2503 1684.67 reflect
1784 2504 1684.67 reflect
1785 2506 1684.63 reflect
1786 2508 1684.38 reflect
1787 2509 1684.38 reflect
1788 2510 1684.38 reflect
1789 2512 1681.36 expand
1790 2513 1681.36 reflect
1791 2514 1681.36 reflect
1792 2515 1681.36 reflect
1793 2516 1681.36 reflect
1794 2517 1681.36 reflect
1795 2518 1681.36 reflect
1796 2519 1681.36 reflect
1797 2521 1678.55 expand
1798 2522 1678.55 reflect
1799 2523 1678.55 reflect
1800 2524 1678.55 reflect
1801 2525 1678.55 reflect
1802 2527 1675.75 expand
1803 2528 1675.75 reflect
1804 2529 1675.75 reflect
1805 2530 1675.75 reflect
1806 2532 1671.53 expand
1807 2533 1671.53 reflect
1808 2534 1671.53 reflect
1809 2535 1671.53 reflect
1810 2536 1671.53 reflect
1811 2537 1671.53 reflect
1812 2539 1664.82 expand
1813 2540 1664.82 reflect
1814 2541 1664.82 reflect
1815 2542 1664.82 reflect
1816 2543 1664.82 reflect
1817 2544 1664.82 reflect
1818 2546 1663.36 expand
1819 2548 1659.79 expand
1820 2549 1659.79 reflect
1821 2551 1651.58 expand
1822 2552 1651.58 reflect
1823 2553 1651.58 reflect
1824 2554 1651.58 reflect
1825 2555 1651.58 reflect
1826 2557 1650.28 reflect
1827 2558 1650.28 reflect
1828 2560 1649.57 reflect
1829 2562 1647.06 reflect
1830 2563 1647.06 reflect
1831 2565 1644.11 expand
1832 2567 1644.11 contract inside
1833 2569 1642.84 expand
1834 2571 1641.96 reflect
1835 2572 1641.96 reflect
1836 2574 1640.12 reflect
1837 2575 1640.12 reflect
1838 2576 1640.12 reflect
1839 2577 1640.12 reflect
1840 2579 1640.12 contract inside
1841 2580 1640.12 reflect
1842 2581 1640.12 reflect
1843 2583 1638.82 reflect
1844 2585 1638.82 contract inside
1845 2586 1638.82 reflect
1846 2587 1638.82 reflect
1847 2589 1637.38 reflect
1848 2591 1637.38 contract outside
1849 2593 1637.38 contract inside
1850 2594 1637.38 reflect
1851 2595 1637.38 reflect
1852 2596 1637.38 reflect
1853 2598 1633.55 expand
1854 2599 1633.55 reflect
1855 2600 1633.55 reflect
1856 2601 1633.55 reflect
1857 2602 1633.55 reflect
1858 2604 1631.6 expand
1859 2605 1631.6 reflect
1860 2606 1631.6 reflect
1861 2607 1631.6 reflect
1862 2608 1631.6 reflect
1863 2610 1630.69 reflect
1864 2611 1630.69 reflect
1865 2613 1630.69 contract inside
1866 2614 1630.69 reflect
1867 2615 1630.69 reflect
1868 2616 1630.69 reflect
1869 2618 1629.95 reflect
1870 2619 1629.95 reflect
1871 2621 1627.28 expand
1872 2622 1627.28 reflect
1873 2623 1627.28 reflect
1874 2625 1627.28 contract inside
1875 2626 1627.28 reflect
1876 2627 1627.28 reflect
1877 2628 1627.28 reflect
1878 2629 1627.28 reflect
1879 2630 1627.28 reflect
1880 2632 1626.54 reflect
1881 2634 1626.32 reflect
1882 2635 1626.32 reflect
1883 2637 1624.56 reflect
1884 2639 1624.56 contract inside
1885 2640 1624.56 reflect
1886 2641 1624.56 reflect
1887 2642 1624.56 reflect
1888 2643 1624.56 reflect
1889 2645 1623.25 reflect
1890 2647 1623.25 contract outside
1891 2648 1623.25 reflect
1892 2649 1623.25 reflect
1893 2650 1623.25 reflect
1894 2652 1623.25 contract inside
1895 2653 1623.25 reflect
1896 2655 1622.99 reflect
1897 2656 1622.99 reflect
1898 2658 1622.99 contract inside
1899 2660 1622.99 contract inside
1900 2662 1622.99 contract inside
1901 2664 1622.99 contract inside
1902 2665 1622.99 reflect
1903 2666 1622.99 reflect
1904 2668 1622.88 reflect
1905 2669 1622.88 reflect
1906 2671 1622.88 contract inside
1907 2672 1622.88 reflect
1908 2673 1622.88 reflect
1909 2675 1622.69 reflect
1910 2676 1622.69 reflect
1911 2677 1622.69 reflect
1912 2678 1622.69 reflect
1913 2679 1622.69 reflect
1914 2681 1622.69 contract inside
1915 2683 1622.69 contract inside
1916 2684 1622.69 reflect
1917 2686 1622.52 reflect
1918 2687 1622.52 reflect
1919 2688 1622.52 reflect
1920 2690 1622.42 reflect
1921 2691 1622.42 reflect
1922 2693 1622.35 reflect
1923 2695 1622.08 reflect
1924 2697 1622.08 contract inside
1925 2699 1622.08 contract outside
1926 2700 1622.08 reflect
1927 2701 1622.08 reflect
1928 2702 1622.08 reflect
1929 2704 1622.08 contract inside
1930 2706 1622.08 contract inside
1931 2707 1622.08 reflect
1932 2708 1622.08 reflect
1933 2709 1622.08 reflect
1934 2711 1622.07 reflect
1935 2712 1622.07 reflect
1936 2714 1622.03 reflect
1937 2715 1622.03 reflect
1938 2717 1622.03 contract inside
1939 2719 1622.03 contract inside
1940 2721 1622 reflect
1941 2722 1622 reflect
1942 2723 1622 reflect
1943 2725 1622 contract inside
1944 2727 1622 contract inside
1945 2728 1622 reflect
1946 2730 1621.99 contract inside
1947 2731 1621.99 reflect
1948 2732 1621.99 reflect
1949 2733 1621.99 reflect
1950 2734 1621.99 reflect
1951 2736 1621.98 contract inside
1952 2737 1621.98 reflect
1953 2738 1621.98 reflect
1954 2740 1621.97 contract inside
1955 2742 1621.95 contract inside
1956 2744 1621.95 contract inside
1957 2745 1621.95 reflect
1958 2747 1621.95 contract inside
1959 2748 1621.95 reflect
1960 2750 1621.95 contract inside
1961 2752 1621.95 contract inside
1962 2753 1621.95 reflect
1963 2755 1621.95 contract inside
1964 2756 1621.95 reflect
1965 2758 1621.95 contract inside
1966 2760 1621.95 contract inside
1967 2761 1621.95 reflect
1968 2763 1621.94 contract outside
1969 2764 1621.94 reflect
1970 2766 1621.94 contract inside
1971 2767 1621.94 reflect
1972 2769 1621.94 contract inside
1973 2770 1621.94 reflect
1974 2772 1621.94 contract inside
1975 2773 1621.94 reflect
1976 2775 1621.94 contract inside
1977 2777 1621.94 contract inside
1978 2779 1621.94 contract inside
1979 2781 1621.94 contract inside
1980 2782 1621.94 reflect
1981 2784 1621.94 contract inside
1982 2786 1621.94 contract inside
1983 2788 1621.94 contract outside
1984 2790 1621.94 contract outside
1985 2792 1621.94 contract inside
1986 2793 1621.94 reflect
1987 2794 1621.94 reflect
1988 2796 1621.93 contract inside
1989 2797 1621.93 reflect
1990 2798 1621.93 reflect
1991 2800 1621.93 contract inside
1992 2802 1621.93 reflect
1993 2804 1621.93 contract inside
1994 2806 1621.93 contract inside
1995 2808 1621.93 contract outside
1996 2809 1621.93 reflect
1997 2811 1621.93 contract inside
1998 2813 1621.93 reflect
1999 2815 1621.93 contract inside
2000 2816 1621.93 reflect
Exiting: Maximum number of iterations has been exceeded
- increase MaxIter option.
Current function value: 1621.934098
Iteration Func-count f(x) Procedure
0 1 8619.35
1 10 7974.99 initial simplex
2 11 7974.99 reflect
3 12 7974.99 reflect
4 13 7974.99 reflect
5 14 7974.99 reflect
6 15 7974.99 reflect
7 16 7974.99 reflect
8 17 7974.99 reflect
9 18 7974.99 reflect
10 20 7589.13 expand
11 21 7589.13 reflect
12 22 7589.13 reflect
13 23 7589.13 reflect
14 25 7201.26 expand
15 26 7201.26 reflect
16 27 7201.26 reflect
17 28 7201.26 reflect
18 30 6717.09 expand
19 31 6717.09 reflect
20 32 6717.09 reflect
21 34 6289.29 expand
22 35 6289.29 reflect
23 36 6289.29 reflect
24 38 5851.48 expand
25 39 5851.48 reflect
26 40 5851.48 reflect
27 42 5200.62 expand
28 43 5200.62 reflect
29 44 5200.62 reflect
30 45 5200.62 reflect
31 47 4684.1 expand
32 48 4684.1 reflect
33 49 4684.1 reflect
34 50 4684.1 reflect
35 52 4381.69 expand
36 53 4381.69 reflect
37 55 4020.94 expand
38 56 4020.94 reflect
39 57 4020.94 reflect
40 58 4020.94 reflect
41 60 4004.97 reflect
42 61 4004.97 reflect
43 62 4004.97 reflect
44 64 4004.97 contract inside
45 65 4004.97 reflect
46 67 3905.98 expand
47 69 3905.98 contract inside
48 71 3815.96 expand
49 72 3815.96 reflect
50 74 3709.4 expand
51 76 3494.74 expand
52 77 3494.74 reflect
53 78 3494.74 reflect
54 79 3494.74 reflect
55 81 3214.3 expand
56 82 3214.3 reflect
57 83 3214.3 reflect
58 85 2942.63 expand
59 86 2942.63 reflect
60 87 2942.63 reflect
61 88 2942.63 reflect
62 89 2942.63 reflect
63 90 2942.63 reflect
64 92 2498.89 expand
65 93 2498.89 reflect
66 94 2498.89 reflect
67 95 2498.89 reflect
68 96 2498.89 reflect
69 97 2498.89 reflect
70 99 2319.05 expand
71 100 2319.05 reflect
72 102 2031.24 expand
73 103 2031.24 reflect
74 104 2031.24 reflect
75 105 2031.24 reflect
76 106 2031.24 reflect
77 108 1896.67 expand
78 109 1896.67 reflect
79 111 1790.95 expand
80 112 1790.95 reflect
81 113 1790.95 reflect
82 114 1790.95 reflect
83 115 1790.95 reflect
84 117 1739.92 expand
85 118 1739.92 reflect
86 119 1739.92 reflect
87 121 1737.17 reflect
88 122 1737.17 reflect
89 123 1737.17 reflect
90 125 1735.64 reflect
91 126 1735.64 reflect
92 127 1735.64 reflect
93 129 1735.64 contract outside
94 131 1735.64 contract inside
95 133 1735.64 contract inside
96 135 1735.64 contract inside
97 136 1735.64 reflect
98 138 1729.84 expand
99 139 1729.84 reflect
100 141 1729.84 contract outside
101 142 1729.84 reflect
102 143 1729.84 reflect
103 145 1729.84 contract inside
104 147 1729.84 contract inside
105 148 1729.84 reflect
106 150 1729.5 reflect
107 151 1729.5 reflect
108 152 1729.5 reflect
109 154 1723.58 expand
110 155 1723.58 reflect
111 157 1723.58 contract inside
112 159 1723.58 contract inside
113 160 1723.58 reflect
114 161 1723.58 reflect
115 162 1723.58 reflect
116 163 1723.58 reflect
117 164 1723.58 reflect
118 166 1721.83 expand
119 167 1721.83 reflect
120 169 1721.83 contract inside
121 171 1717.56 expand
122 172 1717.56 reflect
123 173 1717.56 reflect
124 174 1717.56 reflect
125 175 1717.56 reflect
126 177 1717.37 reflect
127 179 1716.75 reflect
128 180 1716.75 reflect
129 182 1715.18 reflect
130 184 1715.18 contract inside
131 186 1712.7 expand
132 187 1712.7 reflect
133 188 1712.7 reflect
134 189 1712.7 reflect
135 191 1712.7 contract inside
136 192 1712.7 reflect
137 194 1712.55 reflect
138 196 1712.05 reflect
139 197 1712.05 reflect
140 198 1712.05 reflect
141 199 1712.05 reflect
142 200 1712.05 reflect
143 201 1712.05 reflect
144 202 1712.05 reflect
145 204 1712.05 contract inside
146 206 1712.05 contract inside
147 208 1712.05 contract inside
148 210 1712.05 contract inside
149 212 1712.05 contract outside
150 214 1712.05 contract inside
151 216 1712.05 contract inside
152 218 1712.05 contract outside
153 220 1712.05 contract inside
154 222 1712.05 contract inside
155 224 1712.05 contract inside
156 226 1712.05 contract inside
157 227 1712.05 reflect
158 228 1712.05 reflect
159 230 1712.03 contract inside
160 232 1712.03 contract inside
161 234 1712.03 contract inside
162 235 1712.03 reflect
163 237 1712.03 contract inside
164 239 1712.03 contract inside
165 241 1712.02 contract inside
166 243 1712.02 contract inside
167 245 1712.02 contract outside
168 247 1712.02 contract inside
169 249 1712.02 contract inside
170 250 1712.02 reflect
171 251 1712.02 reflect
172 253 1712.01 contract inside
173 255 1712.01 contract inside
174 257 1712.01 contract inside
175 258 1712.01 reflect
176 259 1712.01 reflect
177 261 1712 contract inside
178 263 1712 contract inside
179 265 1712 contract inside
180 266 1712 reflect
181 267 1712 reflect
182 268 1712 reflect
183 270 1712 contract inside
184 272 1712 contract inside
185 273 1712 reflect
186 275 1712 contract inside
187 277 1712 contract inside
188 279 1712 contract inside
189 281 1712 contract inside
190 283 1712 contract inside
191 285 1712 contract outside
192 287 1712 contract inside
193 289 1712 contract inside
194 290 1712 reflect
195 292 1712 contract inside
196 293 1712 reflect
197 295 1712 contract inside
198 296 1712 reflect
199 297 1712 reflect
200 299 1712 contract inside
201 301 1712 contract inside
202 303 1...
%% Step 5: Evalute the Results from the Estimated Final_Vec_opt and Real Data
A_matrix = covariance_matrix(xt,yt,zt);
Covariance Matrix A_matrix From Real Data:
1.4596 -4.1346 2.0059
-4.1346 12.8095 -6.3908
2.0059 -6.3908 3.3402
Estimated_A_matrix = A_matrix_From_Estimation (Final_Vec_opt);
Covariance Matrix A_matrix From Estimation:
9.8561 8.0626 6.5648
8.0626 22.8886 7.2260
6.5648 7.2260 10.3970
%% Step 6: Estimate 3D coordinates from projection
[Estimate_3D_X, Estimate_3D_Y, Estimate_3D_Z] = Estimate_3D_coordinates_from_Final_Vec_opt (Xp, Yp, ...
SID, SAD, alpha, Final_Vec_opt, num_projections);
%% Step 7: Calculate RMSE value in each direction
RMSE_x = Calculate_RMSR (xt,Estimate_3D_X);
RMSE_y = Calculate_RMSR (yt,Estimate_3D_Y);
RMSE_z = Calculate_RMSR (zt,Estimate_3D_Z);
fprintf(['RMSE for X, Y, Z Direction(mm): ' ...
'[%.2f, %.2f, %.2f] mm\n'], RMSE_x, RMSE_y, RMSE_z);
RMSE for X, Y, Z Direction(mm): [34.78, 3.78, 34.66] mm
%% Step 7: Plot Estimated vs Real Data
Plot_results(Time, xt, yt, zt, Estimate_3D_X, Estimate_3D_Y, Estimate_3D_Z);

toc
Elapsed time is 45.514871 seconds.
function Estimated_A_matrix = A_matrix_From_Estimation (Final_Vec_opt)
% This function calculate the A_matrix (covariance matrix) from the
% estimation value of the Final_Vec_opt.
% Given Final_Vec_opt = [mx, my, mz, sx, sy, sz, rxy, ryz, rzx]
mx = Final_Vec_opt(1); % Mean value of the X direction
my = Final_Vec_opt(2); % Mean value of the Y direction
mz = Final_Vec_opt(3); % Mean value of the Z direction
sx = Final_Vec_opt(4); % Standard deviation of X
sy = Final_Vec_opt(5); % Standard deviation of Y
sz = Final_Vec_opt(6); % Standard deviation of Z
rxy = Final_Vec_opt(7); % Correlation between X and Y
ryz = Final_Vec_opt(8); % Correlation between Y and Z
rzx = Final_Vec_opt(9); % Correlation between Z and X
% Compute covariance values
Cov_x_y = rxy * sx * sy; % Covariance between X and Y Direction
Cov_y_z = ryz * sy * sz; % Covariance between Y and Z Direction
Cov_z_x = rzx * sz * sx; % Covariance between X and Z Direction
% Construct covariance matrix A
Estimated_A_matrix = [sx^2, Cov_x_y, Cov_z_x;
Cov_x_y, sy^2, Cov_y_z;
Cov_z_x, Cov_y_z, sz^2];
% Display matrix
disp('Covariance Matrix A_matrix From Estimation:');
disp(Estimated_A_matrix);
end
function RMSE = Calculate_RMSR (True_value,Estimated_value)
% Calculate RMSE
e1 = (True_value(:)-Estimated_value(:)).^2;
RMSE = sqrt(mean(e1,'omitnan'));
end
function LvecArray = computeError(Xp, Yp, SAD, SID, alpha)
% "computeError" Estimate unknown parameters for markers, from projection data.
% For one marker, estimate mean position and standard deviations and
% correlations of movement, using method of Poulsen et al., 2009.
% Input data is projections of 3D marker positions onto 2D image planes.
% First scenario: There is one marker (N = 1) and Npos positions of the image plane.
% The image plane rotates about the y-axis. See Fig.9 in Poulsen et al., 2009.
% Inputs
% Xp=marker X-coordinates on image plane, Npos x N (cm)
% Yp=marker Y-coordinates on image plane, Npos x N (cm)
% SAD=source-axis distance (cm)
% SID=source-image plane distance (cm)
% alpha=projection angles, 1 x Npos (radians)
% Output
% LvecArray=estimated marker parameters.
% LvecArray=[mux,muy,muz,sdx,sdy,sdz,pxy,ryz,rzx]
% where mux,y,z=estim.mean position (cm), sdx,y,z=estim. st.dev. (cm), and
% rxy,etc=estim.correlation between instantaneous x,y position, etc.
% Function(s) called
% Objective(x, Xp, Yp, SAD, SID, alpha) returns F_MLE.
[Npos,N]=size(Xp); % determine number of targets and projections from Xp
% error checking
if size(Xp)~=size(Yp)
error('Error: size(Yp) must = size(Xp).');
end
if length(alpha)~=Npos
error('Error: length(alpha) must = number of rows in Xp.')
end
LvecArray=zeros(N,9); % allocate array for results
% LvecINit and lb and ub are the same on every loop pass.
% lb, ub are bounds for [mux,muy,muz,sdx,sdy,sdz,pxy,ryz,rzx].
LvecInit=[0,0,0,1,1,1,0,0,0]; % initial guess for Lvec
lb=[-10 -10 -10 -10 -10 -10 -10 -10 -10]; % lower bounds
ub=[10 10 10 10 10 10 10 10 10]; % upper bounds
% For Methods 2 and 3 (Nelder-Mead optimization [simple and with constraint])
% Set optimization options to improve convergence
options = optimset('fminsearch');
options.MaxIter = 2000; % Increase max iterations
options.MaxFunEvals = 4000; % Increase function evaluations
options.TolFun = 1e-10; % Reduce function tolerance
options.TolX = 1e-10; % Reduce solution tolerance
options.Display = 'iter'; % Show iterations
for i=1:N
% Find 1x9 vector Lvec that minimizes F_MLE for marker i.
xpv = Xp(:,i); % column vector, length Np
ypv = Yp(:,i); % column vector, length Np
% fun=@(x) Objective(x, xpv, ypv, SAD, SID, alpha); % function to
% minimize (Not included matrix B is positive definite).
fun=@(x) Objective_1(x, xpv, ypv, SAD, SID, alpha); % function to
% minimize (Included matrix B is positive definite).
%% Methods to Optimize Objective Function
% Lvec = fmincon(fun,LvecInit,[],[],[],[],lb,ub); % Method 1: Use the fmincon to calculate the Lvec
% Lvec = fminsearch(fun, LvecInit, options); % Method 2: Perform Nelder-Mead (simple) optimization using fminsearch
% Method 3: Perform Nelder-Mead (with constraint) optimization using
% fminsearch + add constraint to store best solution found.
% Multi-start strategy: Run multiple times with different initial guesses
num_restarts = 5; % Number of restarts
best_Lvec = [];
best_fval = Inf;
for j = 1:num_restarts
% Run Nelder-Mead optimization
[Lvec, fval] = fminsearch(fun, LvecInit, options);
% Store best solution found
if fval < best_fval
best_fval = fval;
best_Lvec = Lvec;
end
end
LvecArray(i,:) = Lvec; % save Lvec in row i of LvecArray
end
end
function A_matrix = covariance_matrix(xt,yt,zt)
% This function calculate the A_matrix (covariance matrix) from the real
% motion data.
% Calculate the Variance
Var_x = var(xt); % X Direction
Var_y = var(yt); % Y Direction
Var_z = var(zt); % Z Direction
% Calculate the Covariance
Cov_x_y = cov(xt,yt);
Cov_x_y = Cov_x_y(1,2); % Covariance between X and Y Direction
Cov_x_z = cov(xt,zt);
Cov_x_z = Cov_x_z(1,2); % Covariance between X and Z Direction
Cov_y_z = cov(yt,zt);
Cov_y_z = Cov_y_z(1,2); % Covariance between Y and Z Direction
% Construct covariance matrix (A_matrix)
A_matrix = [Var_x, Cov_x_y, Cov_x_z;
Cov_x_y, Var_y, Cov_y_z;
Cov_x_z, Cov_y_z, Var_z];
% Display matrix
disp('Covariance Matrix A_matrix From Real Data:');
disp(A_matrix);
end
function [Estimate_3D_X, Estimate_3D_Y, Estimate_3D_Z] = Estimate_3D_coordinates_from_Final_Vec_opt (xp, yp, ...
SDD, SAD, alpha, Final_Vec_opt, num_projections)
% @ Payam Samadi (2025.3.21). Estimate_3D_coordinates_from_Final_Vec_opt is
% used to estimate 3D coordinates based on the Poulsen et al., 2009 (See page 4035).
% The Final_Vec_opt is [mux,muy,muz] for eahc marker (i).
% Np refers to the number of projections.
Number_of_target=length(xp); % number of targets
Estimate_3D_X = zeros(num_projections,1);
Estimate_3D_Y = zeros(num_projections,1);
Estimate_3D_Z = zeros(num_projections,1);
for i=1:num_projections
p=[xp(i)'.*cos(alpha(i))-(SDD-SAD)*sin(alpha(i));...
yp(i)';...
-xp(i)'.*sin(alpha(i))-(SDD-SAD)*cos(alpha(i))]; % Projection Point (Eq. A.4)
f=SAD.*[sin(alpha(i)); 0; cos(alpha(i))]; % Focal point (Eq. A.5)
e_hat=(f-p)/norm(f-p); % Unit vector "e_hat" (Eq. A.6)
% Estimate 3D Position (Eq. A-7)
Estimate_3D_X (i) = p(1) + e_hat(1) * Final_Vec_opt (1);
Estimate_3D_Y (i) = p(2) + e_hat(2) * Final_Vec_opt (2);
Estimate_3D_Z (i) = p(3) + e_hat(3) * Final_Vec_opt (3);
end
end
function FMLE = Objective(x, xp, yp, SAD, SID, alpha)
% "Objective" Compute FMLE for observations of one marker.
% Compute FMLE=neg.log likelihood of the observed marker positions, for
% a marker whose observed positions xp,yp are random samples from the
% multivariate normal distribution specified by the values in x.
% The marker is in 3D space. It is observed Np times, each time
% projected onto a 2D image plane. The x-ray source and image plane
% rotate about the y axis (Poulsen Fig.9).
% See Poulsen et al., 2009, especially Appendix.
% Inputs
% x=[mx,my,mz,sdx,sdy,sdz,rxy,ryz,rzx]=1x9 vector with parameters of
% the marker's statistical distribution. The means and SDs are in
% cm; the correlations rxy,... are dimensionless.
% xp=observed marker x-values (Np x 1) (cm)
% yp=observed marker y-values (Np x 1) (cm)
% SAD=source-axis distance (cm)
% SID=source-image plane distance (cm)
% alpha=orientation of source and image plane (1 x Np) (radian)
% Output
% FMLE=sum(fMLE)
mx=x(1); my=x(2); mz=x(3); % extract values from x
sdx=x(4); sdy=x(5); sdz=x(6);
rxy=x(7); ryz=x(8); rzx=x(9);
%% Calculate FMLE
r0=[mx;my;mz]; % theoretical mean position
Np=length(xp); % number of projections
A=[sdx^2, rxy*sdx*sdy, rzx*sdz*sdx;... % theo. covariance matrix
rxy*sdx*sdy, sdy^2, ryz*sdy*sdz;...
rzx*sdz*sdx, ryz*sdy*sdz, sdz^2];
B=inv(A); % inverse covariance matrix
K=zeros(Np,1); % allocate K
sigma=zeros(Np,1); % allocate sigma
for i=1:Np
p=[xp(i)*cos(alpha(i))-(SID-SAD)*sin(alpha(i));... % p=3D coords of(Xp,Yp)
yp(i);...
-xp(i)*sin(alpha(i))-(SID-SAD)*cos(alpha(i))]; % A.4
f=SAD*[sin(alpha(i)); 0; cos(alpha(i))]; % A.5 focal point
ehat=(f-p)/norm(f-p); % A.6 unit vector
sigma(i)=1/sqrt(ehat'*B*ehat); % A.8
mu=((r0-p)'*B*ehat)/(ehat'*B*ehat); % A.9
K(i)=((sqrt(det(B))/((2*pi)^(3/2))))*...
exp(((-1/2)*(p+ehat*mu-r0)'*B*(p+ehat*mu-r0))); % A.10
end
fMLE=-log(sqrt(2*pi)*K.*sigma); % A.12
FMLE=sum(fMLE); % A.12
end
function FMLE = Objective_1(x, xp, yp, SAD, SID, alpha)
% "Objective_1" Compute FMLE for observations of one marker.
% Compute FMLE=neg.log likelihood of the observed marker positions, for
% a marker whose observed positions xp,yp are random samples from the
% multivariate normal distribution specified by the values in x.
% The marker is in 3D space. It is observed Np times, each time
% projected onto a 2D image plane. The x-ray source and image plane
% rotate about the y axis (Poulsen Fig.9).
% See Poulsen et al., 2009, especially Appendix.
% Inputs
% x=[mx,my,mz,sdx,sdy,sdz,rxy,ryz,rzx]=1x9 vector with parameters of
% the marker's statistical distribution. The means and SDs are in
% cm; the correlations rxy,... are dimensionless.
% xp=observed marker x-values (Np x 1) (cm)
% yp=observed marker y-values (Np x 1) (cm)
% SAD=source-axis distance (cm)
% SID=source-image plane distance (cm)
% alpha=orientation of source and image plane (1 x Np) (radian)
% Output
% FMLE=sum(fMLE)
% Ensures that matrix B (inverse covariance matrix) is positive definite.
mx=x(1); my=x(2); mz=x(3); % extract values from x
sdx=x(4); sdy=x(5); sdz=x(6);
rxy=x(7); ryz=x(8); rzx=x(9);
%% Calculate FMLE
r0=[mx;my;mz]; % theoretical mean position
Np=length(xp); % number of projections
% Construct the covariance matrix A
A=[sdx^2, rxy*sdx*sdy, rzx*sdz*sdx;...
rxy*sdx*sdy, sdy^2, ryz*sdy*sdz;...
rzx*sdz*sdx, ryz*sdy*sdz, sdz^2];
% Ensure positive definiteness using regularization
epsilon = 1e-10; % Small positive value
A = A + epsilon * eye(3); % Adds a small value to the diagonal to ensure positive definiteness
% Compute inverse covariance matrix B
B=inv(A);
% Verify B is positive definite
if any(eig(B) <= 0)
error('Matrix B is not positive definite. Adjusting A may be needed.');
end
K=zeros(Np,1); % allocate K
sigma=zeros(Np,1); % allocate sigma
for i=1:Np
p=[xp(i)*cos(alpha(i))-(SID-SAD)*sin(alpha(i));... % p=3D coords of (Xp,Yp)
yp(i);...
-xp(i)*sin(alpha(i))-(SID-SAD)*cos(alpha(i))]; % A.4
f=SAD*[sin(alpha(i)); 0; cos(alpha(i))]; % A.5 focal point
ehat=(f-p)/norm(f-p); % A.6 unit vector
sigma(i)=1/sqrt(ehat'*B*ehat); % A.8
mu=((r0-p)'*B*ehat)/(ehat'*B*ehat); % A.9
K(i)=((sqrt(det(B))/((2*pi)^(3/2))))*...
exp(((-1/2)*(p+ehat*mu-r0)'*B*(p+ehat*mu-r0))); % A.10
end
fMLE=-log(sqrt(2*pi)*K.*sigma); % A.12
FMLE=sum(fMLE); % A.12
end
function Plot_results (Time, xt, yt, zt, Estimate_3D_X, Estimate_3D_Y, Estimate_3D_Z)
figure('WindowState', 'maximized')
subplot(3,1,1);
plot(Time, Estimate_3D_X,'r-','LineWidth',2);
hold on;
plot(Time, xt,'bo');
legend ('Estimate', 'Real');
title ('X Direction')
xlabel ('Time (s)');
ylabel ('Motion (mm)')
hold off;
subplot(3,1,2);
plot(Time, Estimate_3D_Y,'r-','LineWidth',2);
hold on;
plot(Time, yt,'bo');
legend ('Estimate', 'Real');
title ('Y Direction')
xlabel ('Time (s)');
ylabel ('Motion (mm)')
hold off;
subplot(3,1,3);
plot(Time, Estimate_3D_Z,'r-','LineWidth',2);
hold on;
plot(Time, zt,'bo');
legend ('Estimate', 'Real');
title ('Z Direction')
xlabel ('Time (s)');
ylabel ('Motion (mm)')
hold off;
end
Matt J
on 22 Mar 2025
Edited: Matt J
on 22 Mar 2025
One thing to test for in regads to local minimum is to run the optimization with a known global solution, with the intial x0 chosen at the known solution and again also with x0 near the known solution. When initialized at the known solution, it should stop right away. When initialized near it, it should quickly move to the solution, without getting stuck.
payam samadi
on 23 Mar 2025
Dear Matt,
Thanks again for your tip.
As you suggested,
1. I used this as the initial value (computeError.m):
LvecInit=[1.5,12.1,3.1,1.2082,3.579,1.8276,-0.9499,-0.9788,0.9167];
but it quickly stopped and gave me the following error:
Iteration Func-count f(x) Procedure
0 1 Inf
Error using Objective_1
Matrix B is not positive definite. Adjusting A may be needed.
(1.1) I changed the following line in the Objective_1.m function since it appears in some projections, I have some Inf.
% FMLE=sum(fMLE); % A.12
FMLE = sum(fMLE(~isinf(fMLE))); % A.12
But this time I get:
Iteration Func-count f(x) Procedure
0 1 70093.4
Error using Objective_1
Matrix B is not positive definite. Adjusting A may be needed.
2. In following, I used this as the initial value (computeError.m):
LvecInit=[1.5,12.1,3.1,1.2082,3.579,1.8276,-0.9499,-0.9788,0.9167]; but, this time, I used the Objective.m function [+ FMLE = sum(fMLE(~isinf(fMLE))); % A.12], and it ran without any error and returned the following results:
Covariance Matrix A_matrix From Real Data:
1.4596 -4.1346 2.0059
-4.1346 12.8095 -6.3908
2.0059 -6.3908 3.3402
Covariance Matrix A_matrix From Estimation:
1.5161 -4.3544 1.9808
-4.3544 13.3040 -6.5812
1.9808 -6.5812 3.2642
RMSE for X, Y, Z Direction(mm): [34.43, 2.74, 33.41] mm
Elapsed time is 6.029993 seconds.
The covariance Matrix for both real and estimation data is close to each other, but why are the calculated RMSEs in the X and Z directions so large?
Please let me know if you come up with any ideas.
Thanks in advance for your time.
Matt J
on 23 Mar 2025
Edited: Matt J
on 23 Mar 2025
Please let me know if you come up with any ideas.
It is not clear to me whether the advice from my last comment was followed. Do any of these choices of Lvecinit correspond to the known ground truth solution of simulated data, as I advised?
A few random observations though:
(1) fminsearch will usually perform poorly for a problem with 9 unknown variables. There is no theoretical gaurantee that it will converge for more than 1 variable. Empirically, it does okay for about 6, but 9 is pushing it.
(2) Your expression for the covariance matrix requires rxy,ryz,rzx to all satisfy abs( r )<=1, if it is supposed to give you a positive semidefinite matrix. It doesn't appear that you have chosen lb,ub to ensure this. That is in addition to the fact that you are using fminsearch, which does not enforce bounds at all.
payam samadi
on 23 Mar 2025
It is not clear to me whether the advice from my last comment was followed. Do any of these choices of Lvecinit correspond to the known ground truth solution of simulated data, as I advised?
As you see, in my previous comment, it works in some conditions (part 2):
2. In the following, I used this as the initial value (computeError.m):
LvecInit=[1.5,12.1,3.1,1.2082,3.579,1.8276,-0.9499,-0.9788,0.9167]; but, this time, I used the Objective.m function [+ FMLE = sum(fMLE(~isinf(fMLE))); % A.12], and it ran without any error and returned the following results:
Covariance Matrix A_matrix From Real Data:
1.4596 -4.1346 2.0059
-4.1346 12.8095 -6.3908
2.0059 -6.3908 3.3402
Covariance Matrix A_matrix From Estimation:
1.5161 -4.3544 1.9808
-4.3544 13.3040 -6.5812
1.9808 -6.5812 3.2642
RMSE for X, Y, Z Direction(mm): [34.43, 2.74, 33.41] mm
Elapsed time is 6.029993 seconds.
The condition is that I used very close LvecInit, and as you predicted, it quickly ran and gave me results close to it.
(2) Your expression for the covariance matrix requires rxy,ryz,rzx to all satisfy abs( r )<=1, if it is supposed to give you a positive semidefinite matrix. It doesn't appear that you have chosen lb,ub to ensure this. That is in addition to the fact that you are using fminsearch, which does not enforce bounds at all.
Could you please provide more specific details that I can try?
Matt J
on 23 Mar 2025
Edited: Matt J
on 23 Mar 2025
The condition is that I used very close LvecInit, and as you predicted, it quickly ran and gave me results close to it.
My advice, though, was to choose Lvecinit to be the known global minimum. In other words, I am asking you to choose an LvecTrue and use it to generate hypothetical projection data xp,yp. When you run the optimizer with Lvecinit=LvecTrue, the optimizer should be able to immediately recognize LvecInit as a solution and stop.
The values of LvecInit that you have selected in your first test do not seem to be the global minimum because they produce inf values. You suppressed the infs with sum(fMLE(~isinf(fMLE))), but why would there be any Infs to suppress if LvecInit was the global minimum?
Could you please provide more specific details that I can try?
I have provided specific details. I specifically told you not to use fminsearch. Your code is already set up to use fmincon instead, and that is what you should do. Also, I told you that you need to set your lb, ub to bound to ensure that -1<=[rxy,ryz,rzx]<=1.
Also, remove the line,
fMLE=sum(fMLE(~isinf(fMLE)))
It makes your objective discontinuous, which violates the assumptions of fmincon.
Matt J
on 23 Mar 2025
Edited: Matt J
on 23 Mar 2025
Another possible way to deal with the covariance being non-positive definite is to reparametrize as below. With this method, you do not need to put bounds on x(4:9) or even to construct A at all.
mx=x(1); my=x(2); mz=x(3); %Extract mean values
L=zeros(3);
L([1,2,3,5,6,9]0=x(4:9); %Form a lower triangular matrix
B=L*L'; % Construct inverse covariance matrix directly
I would also recommend some changes to the main loop that computes the FMLE. In particular, I think you should compute negative loglikelihood terms directly,
%% Calculate FMLE
r0=[mx;my;mz]; % theoretical mean position
Np=length(xp); % number of projections
mahalanobisDist=zeros(Np,1); % allocate K
sigma=zeros(Np,1); % allocate sigma
for i=1:Np
p=[xp(i)*cos(alpha(i))-(SID-SAD)*sin(alpha(i));... % p=3D coords of (Xp,Yp)
yp(i);...
-xp(i)*sin(alpha(i))-(SID-SAD)*cos(alpha(i))]; % A.4
f=SAD*[sin(alpha(i)); 0; cos(alpha(i))]; % A.5 focal point
ehat=(f-p)/norm(f-p); % A.6 unit vector
sigma(i)=1/sqrt(ehat'*B*ehat); % A.8
mu=((r0-p)'*B*ehat)/(ehat'*B*ehat); % A.9
mahalanobisDist(i) = (p+ehat*mu-r0)'*B*(p+ehat*mu-r0) ; % A.10
end
FMLE = -Np*log(det(B)) + sum(mahalanobisDist); % A.12
This avoids potential numerical problems with evaluating log(exp(___)).
payam samadi
on 24 Mar 2025
Dear Matt,
Thanks for your time.
I defined the the new objective function (Objective_2.m) based on your opinion, and ran the code with the following conditions:
LvecInit=[1.5,12.1,3.1,1.2082,3.579,1.8276,-0.9499,-0.9788,0.9167];
lb=[-1 -1 -1 -1 -1 -1 -1 -1 -1]; % lower bounds (also changed it to nine 2, 10)
ub=[1 1 1 1 1 1 1 1 1]; % upper bounds (also changed it to nine 2, 10)
Lvec = fmincon(fun,LvecInit,[],[],[],[],lb,ub);
Still, the results are so far from our expectations.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the value of the optimality tolerance,
and constraints are satisfied to within the value of the constraint tolerance.
<stopping criteria details>
Covariance Matrix A_matrix From Real Data:
1.4596 -4.1346 2.0059
-4.1346 12.8095 -6.3908
2.0059 -6.3908 3.3402
Covariance Matrix A_matrix From Estimation:
0.0068 -0.0050 8.2470
-0.0050 0.0268 -16.3644
8.2470 -16.3644 100.0000
RMSE for X, Y, Z Direction(mm): [35.38, 3.95, 36.96] mm
Elapsed time is 0.953997 seconds.
I also check your other comments (Ensure std > 0 and correlations between -1 and 1).
LvecInit=[1.5,12.1,3.1,1.2082,3.579,1.8276,-0.9499,-0.9788,0.9167];
lb = [0, 0, 0, 0.01, 0.01, 0.01, -1, -1, -1];
ub = [0, 0, 0, 0, 0, 0, 1, 1, 1];
fun=@(x) Objective_2(x, xpv, ypv, SAD, SID, alpha);
Lvec = fmincon(fun,LvecInit,[],[],[],[],lb,ub);
It quickly gave me this:
Exiting due to infeasibility: at least one lower bound exceeds the corresponding upper bound.
Covariance Matrix A_matrix From Real Data:
1.4596 -4.1346 2.0059
-4.1346 12.8095 -6.3908
2.0059 -6.3908 3.3402
Covariance Matrix A_matrix From Estimation:
1.4597 -4.1075 2.0242
-4.1075 12.8092 -6.4023
2.0242 -6.4023 3.3401
RMSE for X, Y, Z Direction(mm): [34.45, 2.72, 33.40] mm
Elapsed time is 0.614902 seconds.
(1) fminsearch will usually perform poorly for a problem with 9 unknown variables. There is no theoretical guarantee that it will converge for more than 1 variable. Empirically, it does okay for about 6, but 9 is pushing it.
Do you think other power optimization methods such as GA and gravity search could handle and optimize these nine parameters?
Matt J
on 24 Mar 2025
Edited: Matt J
on 24 Mar 2025
Do you think other power optimization methods such as GA and gravity search could handle and optimize these nine parameters?
It might help with the local minima, but I feel like this problem should be easy to come up with a good Lvecinit. I don't know how you are deriving your Lvecinit currently.
Still, the results are so far from our expectations.
In Objective_2 you have imposed bounds on x(4:9) which I said you should not have. You can impose bounds on x(1:3), but I don't know where you are getting them. In your test data, it looks like the target point drifts more than a centimeter from isocenter, so +/-10 is the least I would choose.
Aside from all that, you still don't appear to have run the experiment initializing at ground truth. I will take a break from this thread until you do.
payam samadi
on 25 Mar 2025
Edited: Walter Roberson
on 29 Mar 2025 at 0:35
Dear Matt,
Many thanks for your reply.
To be honest, I got completely confused.
I don't know how you are deriving your Lvecinit currently.
For each CBCT scan, three optimizations with three sets of starting points for (σ LR, σ CC, σ AP) and (ρ LR-CC, ρ LR-AP, and ρ CC-AP) were performed and the one resulting in the highest likelihood was selected.
Therefore, I used the Multi-start strategy (attached computeError.m here): Run multiple times with different initial guesses for Avoiding Local Minima (the following code is added to the computeError.m):
LvecInit=[5,1,0,2,8,1,0,5,-4]; % initial guess for Lvec
ub = 2* ones (1,9); % lower bounds
lb = -2*ones (1,9); % upper bounds
% For Method 4 (Method 4 + fmincon)
options = optimoptions('fmincon', ...
'Algorithm', 'sqp', ... % Algorithm choice 'sqp', 'sqp-legacy', 'interior-point', 'active-set'
'MaxIterations', 1000, ... % Maximum number of iterations
'MaxFunctionEvaluations', 5000, ... % Maximum function evaluations
'OptimalityTolerance', 1e-12, ... % Tolerance for stopping
'StepTolerance', 1e-12, ... % Minimum step size before stopping
'Display', 'iter', ... % Display output at each iteration
'UseParallel', true);
for i=1:N
% Find 1x9 vector Lvec that minimizes F_MLE for marker i.
xpv = Xp(:,i); % column vector, length Np
ypv = Yp(:,i); % column vector, length Np
fun=@(x) Objective_3(x, xpv, ypv, SAD, SID, alpha); % function to
% minimize (Included matrix B is positive definite) + Recommended by Matt + Modified by Payam.
%% Methods to Optimize Objective Function
% Multi-start strategy: Run multiple times with different initial guesses
num_restarts = 5; % Number of restarts
best_Lvec = [];
best_fval = Inf;
for j = 1:num_restarts
% Run Nelder-Mead optimization
% [Lvec, fval] = fminsearch(fun, LvecInit, options);
% [Lvec, fval] = fminunc(fun, LvecInit, options);
if j == 1
[Lvec, fval] = fmincon(fun, LvecInit, [], [], [], [], lb, ub, [], options); % Method 4 + fmincon
else
[Lvec, fval] = fmincon(fun, best_Lvec, [], [], [], [], lb, ub, [], options); % Method 4 + fmincon
end
% Store best solution found
if fval < best_fval
best_fval = fval;
best_Lvec = Lvec;
end
end
LvecArray(i,:) = best_Lvec; % save Lvec in row i of LvecArray
end
For the first iteration, the model runs, but for the next iterations, it gives:
Local minimum possible. Constraints satisfied.
fmincon stopped because the size of the current step is less than
the value of the step size tolerance and constraints are
satisfied to within the value of the constraint tolerance.
My propsoed strategy is correct for this statement.
For each CBCT scan, three optimizations with three sets of starting points for (σ LR, σ CC, σ AP) and (ρ LR-CC, ρ LR-AP, and ρ CC-AP) were performed and the one resulting in the highest likelihood was selected.
Also, I told you that you need to set your lb, ub to bound to ensure that -1<=[rxy,ryz,rzx]<=1.
I applied this to Objective_3.m (attached here) with different methods to make sure that the Matrix B is positive definite (please see Objective_3.m).
mx=x(1); my=x(2); mz=x(3); % extract values from x
sdx=x(4); sdy=x(5); sdz=x(6);
rxy=x(7); ryz=x(8); rzx=x(9);
%% Ensure Proper Bounds on Correlations (ρxy, ρyz, ρzx)
% If the correlation coefficients rxy, ryz, and rzx are outside the
% valid range (-1 ≤ ρ ≤ 1), A may become a non-positive definite:
rxy = max(min(rxy, 1), -1);
ryz = max(min(ryz, 1), -1);
rzx = max(min(rzx, 1), -1);
%% Calculate FMLE
r0=[mx;my;mz]; % theoretical mean position
Np=length(xp); % number of projections
% Construct the covariance matrix A
A=[sdx^2, rxy*sdx*sdy, rzx*sdz*sdx;...
rxy*sdx*sdy, sdy^2, ryz*sdy*sdz;...
rzx*sdz*sdx, ryz*sdy*sdz, sdz^2];
% Method 6: Combining Multiple Techniques
A = (A + A') / 2; % Method 2
[~, p] = chol(A); % Method 5
if p > 0 % If A is not positive definite
A = A + (abs(min(eig(A))) + 1e-1) * eye(3); % Increase diagonal elements
end
A = A + 1e-10 * eye(3); % Step 1: Final regularization
I think, for now, I see the problem with the local minima.
More Answers (2)
Torsten
on 17 Mar 2025
Edited: Torsten
on 17 Mar 2025
You can add a multiple of the vector you obtain by the below command "double(null(A))" to "estimated_T", and you will still get a solution to your linear system of two equations. The system is underdetermined and there exist infinitly many solutions for it.
% @ Payam Samadi (2025.3.15) NLSP (Nonlinear least squares optimization)
% In step 3, the 2D projection data was extracted from the 3D data at
% different projections.
% In step4, the objective function is defined.
% In step 5, the Nonlinear least squares optimization is used to minimize
% the objective function.
% Algorithm:
% 1. 'levenberg-marquardt' : [1.21, 0.17, 1.39] mm,
% 2. 'trust-region-reflective' : [1.21, 0.17, 1.39] mm,
% 3. 'interior-point' : [1.18, 0.16, 1.33] mm
% Note: It is important to carefully consider the initial guesses for
% target locations, as well as the lower bounds (lb) and upper bounds (ub).
tic;
clc;
clear;
close all;
%% Step 1: Load xls file (3D Tumor position)
Load_Data = xlsread('Sample 1.xlsx'); % Data include 12 (sec)
% Load_Data = xlsread('Sample 2.xlsx'); % Data include 60 (sec)
Time = Load_Data(:,1); % Time (s)
xt=Load_Data(:,2); % xt for targets
yt=Load_Data(:,3); % yt for targets
zt=Load_Data(:,4); % zt for targets
true_T=[xt,yt,zt]; % target locations
[~,numT]=size(true_T); % number of targets
%% Step 2: Define imaging system parameters
SAD = 100; % source-axis distance (cm)
SID = 150; % source-image plane distance (cm)
num_projections = length(Time); % number of different views
% Generate projection angles
alpha = linspace(0, 360, num_projections);
% alpha=30;
theta_rad = deg2rad(alpha); % view angles (radians)
%% Step 3: Projection Model: Compute 2D projections
Xp=zeros(1,num_projections); % allocate array
Yp=zeros(1,num_projections);
for i=1:num_projections
f_theta = (SAD - (true_T(i,1) .* sin(theta_rad(i)) + true_T(i,3) .* cos(theta_rad(i)))) ./ SID;
Xp(1, i) = (true_T(i,1) .* cos(theta_rad(i)) - true_T(i,3) .* sin(theta_rad(i))) ./ f_theta;
Yp(1, i) = true_T(i,2) ./ f_theta;
end
xp = Xp';
yp = Yp';
% Run optimization for each projection
estimated_T = zeros(3, num_projections);
T = sym('T',[3 1]);
for i = 1:num_projections
f_theta = (SAD - (T(1) .* sin(theta_rad(i)) + T(3) .* cos(theta_rad(i))))./ SID;
eqn1 = xp(i)*f_theta - (T(1) .* cos(theta_rad(i)) - T(3) .* sin(theta_rad(i)))==0;
eqn2 = yp(i)*f_theta - T(2)==0;
[A,b] = equationsToMatrix([eqn1,eqn2]);
double(null(A))
estimated_T(:, i) = double(A)\double(b);
end
%% Step 6: Calculate RMSE value
% Estimated Tumor Position in X, Y, and Z Direction
Estimate_3D_X = estimated_T(1,:);
Estimate_3D_Y = estimated_T(2,:);
Estimate_3D_Z = estimated_T(3,:);
RMSE_x = Calculate_RMSR (xt,Estimate_3D_X);
RMSE_y = Calculate_RMSR (yt,Estimate_3D_Y);
RMSE_z = Calculate_RMSR (zt,Estimate_3D_Z);
fprintf(['RMSE for X, Y, Z Direction(mm): ' ...
'[%.2f, %.2f, %.2f] mm\n'], RMSE_x, RMSE_y, RMSE_z);
%% Step 7: Plot Estimated vs Real Data
Plot_results (Time, xt, yt, zt, Estimate_3D_X, Estimate_3D_Y, Estimate_3D_Z);
toc;
function RMSE = Calculate_RMSR (True_value,Estimated_value)
% Calculate RMSE
e1 = (True_value(:)-Estimated_value(:)).^2;
RMSE = sqrt(mean(e1,'omitnan'));
end
function Plot_results (Time, xt, yt, zt, Estimate_3D_X, Estimate_3D_Y, Estimate_3D_Z)
figure('WindowState', 'maximized')
subplot(3,1,1);
plot(Time, Estimate_3D_X,'r');
hold on;
plot(Time, xt,'b');
legend ('Estimate', 'Real');
title ('X Dierction')
xlabel ('Time (s)');
ylabel ('Motion (mm)')
hold off;
subplot(3,1,2);
plot(Time, Estimate_3D_Y,'r');
hold on;
plot(Time, yt,'b');
legend ('Estimate', 'Real');
title ('Y Dierction')
xlabel ('Time (s)');
ylabel ('Motion (mm)')
hold off;
subplot(3,1,3);
plot(Time, Estimate_3D_Z,'r');
hold on;
plot(Time, zt,'b');
legend ('Estimate', 'Real');
title ('Z Dierction')
xlabel ('Time (s)');
ylabel ('Motion (mm)')
hold off;
end
6 Comments
Matt J
on 17 Mar 2025
The system is underdetermined and there exist infinitly many solutions for it.
Only because equationsToMatrix is being used here on each projection individually. When you combine the equations from multiple, widely separated projection angles, you get a well-determined system.
Torsten
on 17 Mar 2025
Edited: Torsten
on 17 Mar 2025
When you combine the equations from multiple, widely separated projection angles, you get a well-determined system.
Yes, but the original code also solves for each projection individually. The variable "num_projections" in function "computeProjectionError" is set to 1.
payam samadi
on 18 Mar 2025
The variable "num_projections" in the function "computeProjectionError" is set to 1.
I noticed that I made a mistake and the number "1" should be "num_projections".
Torsten
on 18 Mar 2025
Edited: Torsten
on 18 Mar 2025
I noticed that I made a mistake and the number "1" should be "num_projections".
After replacing 1 by num_projections, your code throws an error. In function "computeProjectionError", you try to access theta_rad(i) for 1 <= i <= num_projections in your loop, but you only pass theta_rad(i) to the function which is a single scalar value.
payam samadi
on 18 Mar 2025
I made a change in step 5 and defined a new function called "computeProjectionError_b." However, I got some unexpected results that are quite confusing. I'm not sure where I went wrong, but here's what I'm trying to do: In the first loop, I used only the initial guess. For the following iterations, I used the estimated results to update the variables. I should mention that this might not be the best approach, but it was the idea that came to mind.
Any help or alternative methods would be greatly appreciate
payam samadi
on 28 Mar 2025
Edited: payam samadi
on 28 Mar 2025
Dear Matt,
I have carefully reviewed the code and made several refinements. While I observed noticeable improvements compared to the previous version, the results are still not fully meeting my expectations. Below is a summary of my findings and ongoing challenges:
1. Ensuring Matrix B is Positive Definite:
- I tested 24 different methods to enforce positive definiteness on Matrix B. However, only methods 9 and 10 produced meaningful results (see Objective_3.m, lines 57-213).
- To validate this, I had a colleague test the code using a Gravitational Search Algorithm (GSA) for optimization. Interestingly, modifying the method for ensuring B's positive definiteness led to wildly different results (Test 6-GSA.zip file).
- Although multiple methods exist (to make sure Matrix B is positive definite), methods 9 and 10 performed best (though not optimally). However, since they rely on L=zeros(3) or L = tril(randn(3)), enforcing proper bounds on correlation coefficients (ρxy, ρyz, ρzx) becomes ineffective.
2. Improved Mahalanobis-Based Approach (Method 2):
- To address numerical instability due to high condition numbers (nearly singular B), I implemented an improved Mahalanobis-based approach (see Objective_3.m, lines 236-239).
- This modification aims to stabilize computations and enhance reliability.
- Initial Guess for LvecInit:
- Currently, I am using [0,0,0,1,1,1,-0.9,-0.9,0.9] as the initial guess across different samples [1-5].
- While this yields reasonable results, further refinement may improve convergence and accuracy.
3. Bounding Mean Tumor Motion (mx, my, mz):
- I incorporated constraints into Objective_3.m to ensure that mean tumor motion (mx, my, mz) remains within the range -10 ≤ m ≤ 10.
- This helps maintain realistic motion estimations while improving numerical stability.
4. To avoid getting into the local minima:
- Two functions computeError and computeError_1 are proposed to avoid getting into the local minima. The computeError_1 is better, and included two different optimzation; strating with fminsearch and then for the next iteration fmincon is used.
Overall, these updates have resulted in improved stability, but there is still room for this code. Let me know your thoughts on the next steps or if you have any suggestions.
Here is results of the code

See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)