Rank: 124 based on 507 downloads (last 30 days) and 28 files submitted
photo

Miroslav Balda

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Miroslav View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
02 Jun 2014 Screenshot SINIDE - Parameter identification of a sine-wave from a measured signal Frequency, amplitude, phase shift and mean value of the best sinus fit to a sampled signal. Author: Miroslav Balda signal processing, parameter identificat..., harmonic process 18 2
23 Apr 2013 Screenshot LMFnlsq2 Solution of one or more nonlinear equations in the least squares sense. Author: Miroslav Balda nonlinear least squar..., curve fitting, identification, optimization, measurement 26 15
  • 5.0
5.0 | 5 ratings
16 Jul 2012 Screenshot GETK Wait for and identify a pressed key Author: Miroslav Balda waiting, keyboard, keys, control design, measurement, optimization 12 0
25 Feb 2012 Soft interrupting of long computer runs Long run of the program can be interrupted without any loss of data in a workspace. Author: Miroslav Balda run interrupt, cycle interrupt, demo, optimization, simulation, gui 11 0
25 Feb 2012 Screenshot LMFnlsq - Solution of nonlinear least squares Efficient and stable Levenberg-Marquard-Fletcher method for solving of nonlinear equations Author: Miroslav Balda optimization, levenberg, marquardt, fletcher, least squares, fig and separator 74 45
  • 4.6
4.6 | 32 ratings
Comments and Ratings by Miroslav View all
Updated File Comments Rating
18 Aug 2014 Frequency, amplitude, phase and mean value of sine wave The function sinfapm evaluates parameters of sampled sine wave Author: Miroslav Balda

The function sinfapm is not maintained any more. Use the function sinide instead, which is much more stable. See

sinide: www.mathworks.com/matlabcentral/fileexchange/45567

15 Jul 2014 LMFnlsq2 Solution of one or more nonlinear equations in the least squares sense. Author: Miroslav Balda

@Liu
The answer is trivial:
Let you have one set of 12 values of lefthand side, say in the column vector hmnp. Make a function for evaluation of differences (residuals) between righthand sides and lefthand sides, say resid.m in the form

function r = resid(x)
r = [x(1)+x(2)*p+ ... +(x(11)+x(12)*p)*n] - hmnp;

Here x(1) up to x(6) correspond C1 to C6 and x(7) up to x(12) correspon D1 up to D6. The simplest call of the function to solve the problem could be

[x,ssq,cnt] = LMFnlsq2('resid',x0);

A better way would be

[x,ssq,cnt] = LMFnlsq2('resid',x0,'Display',-50);

Of course that you have to supply a good estimate of the solution - coefficients C1, ..., D6. It is very important that you are able to do it, say from a nature of your experiment. The elements of x0 must not be zeros!

Since THe solution of your task has as many unknowns as equations, there is no
any degree of freedom. In consequence of it the solution should yield ssq->0.

I wish you good luck.

Mira

07 Jul 2014 SINIDE - Parameter identification of a sine-wave from a measured signal Frequency, amplitude, phase shift and mean value of the best sinus fit to a sampled signal. Author: Miroslav Balda

@D
Please, read carefully Description and Other requirements paragraphs of File information, where you will find the answer.

23 Jun 2014 LMFnlsq2 Solution of one or more nonlinear equations in the least squares sense. Author: Miroslav Balda

@Mihail
Yes, LMFnlsq2 is able to solve both real and complex problems, however, the complex task should be split into real and imagimary parts in the function for evaluating residuals. Thus, the dimension of the residual vector is double the number of equations, provided there are no additional conditions. The column vector of residuals should be real.

See the function cxroot.m:

www.mathworks.com/matlabcentral/fileexchange/22661

14 Feb 2014 Frequency, amplitude, phase and mean value of sine wave The function sinfapm evaluates parameters of sampled sine wave Author: Miroslav Balda

@Will
I am sorry that the function behaved wrong. A reason for it was a hight sensitivity of the function to inaccurate initial guess of the sought parameters. Since it was impossible to improve it by little modification, I decided to build a new function. It will appear in a short time under the name sinide.m.

Comments and Ratings on Miroslav's Files View all
Updated File Comment by Comments Rating
18 Aug 2014 Frequency, amplitude, phase and mean value of sine wave The function sinfapm evaluates parameters of sampled sine wave Author: Miroslav Balda Balda, Miroslav

The function sinfapm is not maintained any more. Use the function sinide instead, which is much more stable. See

sinide: www.mathworks.com/matlabcentral/fileexchange/45567

15 Jul 2014 LMFnlsq2 Solution of one or more nonlinear equations in the least squares sense. Author: Miroslav Balda Balda, Miroslav

@Liu
The answer is trivial:
Let you have one set of 12 values of lefthand side, say in the column vector hmnp. Make a function for evaluation of differences (residuals) between righthand sides and lefthand sides, say resid.m in the form

function r = resid(x)
r = [x(1)+x(2)*p+ ... +(x(11)+x(12)*p)*n] - hmnp;

Here x(1) up to x(6) correspond C1 to C6 and x(7) up to x(12) correspon D1 up to D6. The simplest call of the function to solve the problem could be

[x,ssq,cnt] = LMFnlsq2('resid',x0);

A better way would be

[x,ssq,cnt] = LMFnlsq2('resid',x0,'Display',-50);

Of course that you have to supply a good estimate of the solution - coefficients C1, ..., D6. It is very important that you are able to do it, say from a nature of your experiment. The elements of x0 must not be zeros!

Since THe solution of your task has as many unknowns as equations, there is no
any degree of freedom. In consequence of it the solution should yield ssq->0.

I wish you good luck.

Mira

15 Jul 2014 LMFnlsq2 Solution of one or more nonlinear equations in the least squares sense. Author: Miroslav Balda Liu

Hi, Balda. Good day.
My curve fitting prblem is to calibrate the model like this:
h(m,n,p)=[C1+C2*P+(C3+C4*P)*m+(C5+C6*P)*n]/)[D1+D2*P+(D3+D4*P)*m+(D5+D6*P)*n]
The parameters to be estimate are C1,C2,C3,C4,C5,C6,D1,D2,D3,D4,D5,D6. And we have obtained 12 sets of data of h(m,n,p). So how to write the L-M expression using the LMFnlsq2.m ?

15 Jul 2014 LMFnlsq2 Solution of one or more nonlinear equations in the least squares sense. Author: Miroslav Balda Liu

Worked flawless for my application, cheers

09 Jul 2014 LMFnlsq - Solution of nonlinear least squares Efficient and stable Levenberg-Marquard-Fletcher method for solving of nonlinear equations Author: Miroslav Balda Grinsted, Aslak

Thank you for this. I use it in imgraft.glaciology.net for optimising camera parameters and it works great. I have also used it in another project where it also delivered a massive performance boost.

Contact us