Rank: 118 based on 338 downloads (last 30 days) and 10 files submitted
photo

Jonas Lundgren

E-mail
Lat/Long
58.53076171875, 15.03366374969482

Personal Profile:
Professional Interests:
Mathematics

 

Watch this Author's files

 

Files Posted by Jonas View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
08 Mar 2012 Screenshot Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren alpha shape, alpha shapes, alpha hull, delaunay, area, volume 57 15
  • 5.0
5.0 | 9 ratings
23 Feb 2012 Screenshot TSPSEARCH Heuristic method for the Traveling Salesman Problem (TSP) Author: Jonas Lundgren tsp, traveling salesman pr..., optimization 21 5
  • 4.5
4.5 | 4 ratings
02 Dec 2011 Screenshot ZEROBESS Zeros of Bessel functions of 1st and 2nd kind plus zeros of the derivatives. Author: Jonas Lundgren zerobess, mathematics, bessel function, zeros, bessel, derivatives 14 2
  • 5.0
5.0 | 5 ratings
22 Nov 2011 Screenshot SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren approximation, splinefit, cubic spline, spline, noisy data, ppval 207 40
  • 4.54167
4.5 | 24 ratings
21 Nov 2011 ICHOOSE Choose K indices from the set 1:N. Author: Jonas Lundgren choose, combinations, mathematics, nchoosek 3 2
  • 5.0
5.0 | 1 rating
Comments and Ratings by Jonas View all
Updated File Comments Rating
27 Apr 2012 Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren

Jorge Leandro, tilde represents an unused argument. This notation was introduced in MATLAB 2009b. You can safely replace tilde by a dummy variable.

25 Apr 2012 SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren

Maas, I admit that the splinebase function is a bit cryptic (also for the author). Unfortunatelly I can't see any quick fix to achieve the spline base you ask for.

28 Mar 2012 SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren

Michael, splinefit fits a picewise polynomial curve to your data set by least squares. In the cubic case the curve has continuous second derivative. In other cases the regularity will follow the order of the spline. This is achieved by a base of spline curves with minimal support (B-splines). The method is straightforward and I have no specific reference. You can study B-splines and the method of least squares in the textbooks.

The smoothing effect on the noisy data is controlled by the degrees of freedom of the curve, i.e. the number of pieces. A cubic spline with P pieces has P+3 degrees of freedom. If the number of data points is greater than P+3 smoothing will happen.

Splinefit has no support for a desired tolerance or standard deviation. You have to select the number of pieces, see what you get and try again OR write a clever code for the task.

You can find the theory behind csaps/spaps in the documentation.

27 Feb 2012 Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren

Borc, Yes I am aware of these artefacts in the 3D case. Thats why the code only delivers volume and not boundary faces. I will give this some thought.

22 Dec 2011 Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren

Yuri, try the command "axis equal".

Comments and Ratings on Jonas' Files View all
Updated File Comment by Comments Rating
10 Jul 2013 TSPSEARCH Heuristic method for the Traveling Salesman Problem (TSP) Author: Jonas Lundgren Mark

Seems to be an issue with the heuristic and my specific set of "cities". I tried it with uniformly distributed cities in a square area and it seems to behave well. I wish I could remove my previous rating....

10 Jul 2013 TSPSEARCH Heuristic method for the Traveling Salesman Problem (TSP) Author: Jonas Lundgren Pozzi, Francesco

Hi Mark, Jonas's is a heuristic method and it provides random results. But the speed of the algorithm and the efficiency of the path found are amazing compared to other alternatives currently submitted to File Exchange.
Try this simple example:

% Generate a 2D Random Walk with unitary step
N = 1000; % number of nodes
xy = randn(1, 2); % 2D coordinates of nodes
xy(N, 2) = 0;
for hh = 2:N
tmp = randn(2, 1);
tmp = tmp / sqrt(sum(tmp.^2));
xy(hh, 1) = xy(hh - 1, 1) + tmp(1);
xy(hh, 2) = xy(hh - 1, 2) + tmp(2);
end

% Calculate matrix of distances with function distmat from FE#15145
% http://www.mathworks.com/matlabcentral/fileexchange/15145-distance-matrix
distM = distmat(xy);

% Solve TSP problem with tspsearch
tic, [TSP_2OPT_P TSP_2OPT_C] = tspsearch(distM); toc
% Elapsed time is 9.769581 seconds.
% Show total distance / total cost
TSP_2OPT_C
% TSP_2OPT_C = 5.603308638831134e+002

% Have a look at the path: impressive!
figure
plot(xy(:, 1), xy(:, 2), '.b')
for hh = 1:N-1
hold on
plot(xy(TSP_2OPT_P(hh:hh+1), 1), xy(TSP_2OPT_P(hh:hh+1), 2), '-r')
pause(0.1)
end
plot(xy(TSP_2OPT_P([1 N]), 1), xy(TSP_2OPT_P([1 N]), 2), '-r')

% Now solve TSP problem using Yonathan Nativ's FE#24857 function - which is also very good:
tic, [xy_tsp ind_tsp] = solveTSP(xy, 0); toc
% Elapsed time is 9.771463 seconds.
min_cost = distM(ind_tsp(1), ind_tsp(end)) + sum(distM(sub2ind([N, N], ind_tsp(1:end-1), ind_tsp(2:end))))
% min_cost = 5.949210148822580e+002

% Have a look at the path: it's still very efficient! Only the last connection is unreasonable:
figure
plot(xy(:, 1), xy(:, 2), '.b')
for hh = 1:N-1
hold on
plot(xy(ind_tsp(hh:hh+1), 1), xy(ind_tsp(hh:hh+1), 2), '-r')
pause(0.1)
end
plot(xy(ind_tsp([1 N]), 1), xy(ind_tsp([1 N]), 2), '-r')

08 Jul 2013 TSPSEARCH Heuristic method for the Traveling Salesman Problem (TSP) Author: Jonas Lundgren Mark

Is it just me, or does the algorithm seem to hang randomly once you go past ~350 points???

28 May 2013 TSPSEARCH Heuristic method for the Traveling Salesman Problem (TSP) Author: Jonas Lundgren Pozzi, Francesco

Best TSP engine on FE - much better than Yonathan Nativ's FE#24857 (which is now my second best).

09 May 2013 SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren Dang

It works well on my data. Thanks

Top Tags Applied by Jonas
mathematics, approximation, optimization, acceleration, alpha hull
Files Tagged by Jonas View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
08 Mar 2012 Screenshot Alpha shapes Alpha shape of 2D/3D point set. Author: Jonas Lundgren alpha shape, alpha shapes, alpha hull, delaunay, area, volume 57 15
  • 5.0
5.0 | 9 ratings
23 Feb 2012 Screenshot TSPSEARCH Heuristic method for the Traveling Salesman Problem (TSP) Author: Jonas Lundgren tsp, traveling salesman pr..., optimization 21 5
  • 4.5
4.5 | 4 ratings
02 Dec 2011 Screenshot ZEROBESS Zeros of Bessel functions of 1st and 2nd kind plus zeros of the derivatives. Author: Jonas Lundgren zerobess, mathematics, bessel function, zeros, bessel, derivatives 14 2
  • 5.0
5.0 | 5 ratings
22 Nov 2011 Screenshot SPLINEFIT Fit a spline to noisy data. Author: Jonas Lundgren approximation, splinefit, cubic spline, spline, noisy data, ppval 207 40
  • 4.54167
4.5 | 24 ratings
21 Nov 2011 ICHOOSE Choose K indices from the set 1:N. Author: Jonas Lundgren choose, combinations, mathematics, nchoosek 3 2
  • 5.0
5.0 | 1 rating

Contact us