Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 MONALISA Compact Straightness Monitor Simulation and Calibration Week 4 Report By Patrick Gloster.

Similar presentations


Presentation on theme: "1 MONALISA Compact Straightness Monitor Simulation and Calibration Week 4 Report By Patrick Gloster."— Presentation transcript:

1 1 MONALISA Compact Straightness Monitor Simulation and Calibration Week 4 Report By Patrick Gloster

2 2 Locating observer coordinates We are looking at identifying where the observer coordinates are using our measurements to many ‘target’ points We only have a rough idea of where each ‘target’ point and each observer coordinate is

3 3 Solving by minimization Before we were really just solving to find the position of 2 coordinates (the x and y coordinates of the target point) each time Now we have to use all of the information at once and solve for every position (even though we are only interested in locating the observer coordinates)

4 4 Example Let’s say we have looked at 300 target points. We therefore have measurements from each target point to each of the 4 observer coordinates We have 608 unknowns We have 1200 measurements We can reduce the number of unknowns to 605 by setting one of the 4 observer coordinates to be the origin, and by defining an x-axis e.g. x 1 =0,y 1 =0 and x 2 =0

5 5 The lsqnonlin function Before writing my own function I experimented with some of the various minimization functions built in to Matlab One is the lsqnonlin function, which is designed to solve non-linear least squares problems Using 300 target points and an error of 1% results were encouraging…

6 6 …however As mentioned last week, we want to be able to solve problems which have some external constraint on the variables This could be that the distance between each observer point is constant The lsqnonlin does not support this Although all of the capabilities we need seem to be present in one function or another in Matlab, there isn’t one which includes them all

7 7 Writing my own function To solve the example in the same way as the simulation I worked on before, we have to find the matrix A; in this case it would be a 605 by 1200 matrix I first wrote a program which would calculate the symbolic form of this matrix This seemed like it would be easy because Matlab has a jacobian function, but it was surprisingly difficult; it turns out programming 605 symbols as variables is harder than it seems

8 8 The jacobian function Thanks to Matlab central, a favourite forum of mine, I managed to complete the program, which gives us the matrix A symbolically, and also worked out how to substitute in for all of the variables I then used the same standard results that I used in my simulation to program the minimization

9 9 Comparison of lsqnonlin with my function y2x3y3x4y4Time taken (s) True position0.21900.04700.67890.67930.9347 lsqnonlin calculated 0.22040.04620.68270.67640.94060.186 My function calculated 0.22040.04630.68270.67640.9405112.5

10 10 Comparison of lsqnonlin with my function Good point – They give the same answer Bad point – My function takes 605 times as long (which is, coincidentally, the number of variables we have) Of course, it is possible to decrease the amount of time my function takes (eradicate the for loops) There is another reason my function is useful

11 11 External Constraints We’ve seen that lsqnonlin is much faster than my function, but it does not allow you to place external constraints on the system This becomes an issue if we can’t eliminate a variable using the constraints My function can easily be adapted to incorporate external constraints

12 12 Where we are now Test my formula with external constraints for the example; instead of using 605 variables, work with 608 but with the constraint that 3 of them are zero. This should give us the same answer Move into the third dimension (exciting!)


Download ppt "1 MONALISA Compact Straightness Monitor Simulation and Calibration Week 4 Report By Patrick Gloster."

Similar presentations


Ads by Google