Skip to main content
1-Visitor
January 23, 2015
Question

phase shift

  • January 23, 2015
  • 4 replies
  • 5994 views

Hello Everybody,

Could you please help me with this problem.

In the attached worksheet, there is function sp(k,b), where k is the variable and "b" is the parameters. for different set of parameters, there is a phase shift between sp(k,c1) and sp(k,c2).

How can I find the amount of the phase shift? or minimize the phase difference?

The ultimate goal is to find a new set of parameters as close as possible to the model parameters "c1"

Thank you very much in advance

4 replies

25-Diamond I
January 23, 2015

If you want your solve block to change anything you have to make c2 an argument of residual. Otherwise c3=c2. The values seem to be too small for MAthcad to arrive at c3=c1, though.

Its not clear to me what you are trying to do. If you know c1 it would be trivial to write c3:=c1, no matter what c2 is. If you don't know c1, you cant use your function Residual() as it uses c1.

payman1-VisitorAuthor
1-Visitor
January 23, 2015

Hello Werner,

I used "c1" to generate the signal sp(k,c1). I just have sp(k,c1) as my original signal.

From the experiment I obtained parameters "c2". From the fitting procedure, I want to refine "c2" and obtain a new set as close as possible to "c1'. In other words I want to reconstruct "c1".

25-Diamond I
January 24, 2015

PAYMAN RAJAI wrote:

Hello Werner,

I used "c1" to generate the signal sp(k,c1). I just have sp(k,c1) as my original signal.

From the experiment I obtained parameters "c2". From the fitting procedure, I want to refine "c2" and obtain a new set as close as possible to "c1'. In other words I want to reconstruct "c1".

Yes of course! My fault.

Did you try to add c2 as argument to residual()?

You get just very small changes of your guess values c2 and I am not sure if some scaling would help.

19-Tanzanite
January 24, 2015

Here. It doesn't really help though. The changes to the parameters are very small. That may be because it got stuck in a local minimum though. You have already established that the least squares solution to this problem has very many local minima, and I pointed out that iterative least squares minimization is therefore not a good way to solve this problem.

25-Diamond I
January 24, 2015

Could it be that that something went wrong when deriving the paramters c2? Some sort of index 0 vs index 1 confusion?

At least its noticeable that the shift seems to be close to the difference of subsequent values in k and if you compensate for that the fit looks pretty good.

19-Tanzanite
January 24, 2015

I've looked at this "data" many times now (see Payman's other posts). There is a phase shift between the "data" and the model, but it changes with k. So I can tweak the parameters to reduce the residuals in one region, but they just increase somewhere else. I suspect that this is why the least squares problem has a really large number of local minima (again, look at Payman's other posts). Maybe there's an error in the way the data was created, but I have not gone through the program that creates it because I don't know what it is supposed to do, and therefore it's not possible for me to find any mistake. Or maybe the "data" is correct, and the model is correct (in the sense that the form of the model really is what is required, not that it fully explains the "data"), in which case non-linear least squares is just the wrong way to find the optimal model parameters. It just drops into one of a multitude of local minima and stops. Or maybe the model is just not good enough. Or maybe some combination of the above! Without more information about what this "data" is supposed to represent I fear we will just continue to go in circles.

1-Visitor
January 25, 2015

Points I noted:

It looks like you are looking at the beat frequency of an 800nm light beam within a 50nm square bandwidth.

The use of 'nm' (10^-9) makes the numbers small which can be a difficulty for some of the internal routines which have a hard coded (mathematicians) limit of circa 10^-15 (numerical methods mathematician, unlike scientists and engineers, like numbers to be always near unity 😉

I don't see the parameter b[0 being used in the model equation, which means that mathcad is waggling that value (probably first) to get a minima it will never find (because it has no effect)

You have a couple of terms which are difference scaled (b[1 - b[2) etc. It is the difference that will (most likely) be critical to the solution. Why not reframe the model equation in terms of those deltas (perhaps even pre-scale them!).

The model may be a poor fit for the experiment:: Open questions -

A. Are these real results you took from a real instrument, or results given to you (perhaps from a professor/lecturer) that may actually be from a model they made. If the latter you should be able to get a good match. If the former then your model may be too idealistic.

B. If model data, is this a question about the physics, or about the computation accuracy. The model data will be set up to illustrate the point they require.

Finally, Phase is a tricky concept when applied to broadband signals (rather than super narrow band signals)

Philip

1-Visitor
January 25, 2015

Payman, You left your annotations on, so the source filename is visible for the two layer thin film worksheet.

Though more awkwardly, the symbolic solver for the main equation ends up believing it is a recursive definition. - I was using it to see if the terms simplified. You do have to pre-define k:=k to avoid it trying to compute a vastly large symbolic solution.

The (zr-zs[0) terms are also zero, so these terms disappear - is that what you wanted?

Philip