Recent content by a.mlw.walker

  1. A

    Java How to Adapt the Nelder Mead Algorithm for a Custom Function in Java?

    Thanks Office_Shredder, so now it compiles and converges, however it converges to the wrong value. I have a paper that gets the result as 0.0068 and My MATLAB program also gets that value, however this seems to converge to -0.32 I now have simplex setup as: {{ 0.006, 0.0}, {0.0, 0.0}}; i.e...
  2. A

    Java How to Adapt the Nelder Mead Algorithm for a Custom Function in Java?

    Is this in the wrong place? Could an admin move it please? Perhaps general engineering would be better?
  3. A

    Java How to Adapt the Nelder Mead Algorithm for a Custom Function in Java?

    Hi This is a question somewhere between maths and numerical methods... I am using the algorithm for Nelder Mead found here: http://www.ssl.berkeley.edu/~mlampton/neldermead.java in java. It works nicely with the two example functions - rosen and parab. I am trying to adjust it to my function...
  4. A

    Levenberg marquardt C coding algorithm

    HI guys. Haven't been here in a while... I have an algorithm attached that uses the levenberg marquardt non linear curve fitting alogrithm to fit a surface. My C coding skills are reasonable, however I am struggling to adjust the model so that I can fit my curve to it. I want to use this...
  5. A

    Designing a Peristaltic Pump

    Hi Guys, Been researching peristaltic pumps, but can't find an industry standard in designing them. Wiki (http://en.wikipedia.org/wiki/Peristaltic_pump) has a little bit of maths on the occlusion, and a basic idea on calculating the flow rate and this article explains a little of the theory...
  6. A

    MATLAB Minimizing function in Matlab and C

    Hey how are you, been a while. I am working more with the levenberg marquardt code now. I am trying to get it to use just single precision - this is an option in levmar.h Out of interest, what happens if a variable has been declared as double but in levmar.h i state i want single precision? when...
  7. A

    MATLAB Minimizing function in Matlab and C

    I found the problem. z is getting there howere the maths is going haywire! v0 is not being calculated correctly - is this because of a problem with multiplying floats and doubles?
  8. A

    MATLAB Minimizing function in Matlab and C

    Neldermead function is like this: status NelderMeadSimplexMethod(n, f, xinit, length, fopt, timeout, eps, array1) my function that is failing is like this: static double rotor_function(int n, double z[],float ti[6])//equations for parameters eta, phi and omega^2 that hold wheel properties {...
  9. A

    MATLAB Minimizing function in Matlab and C

    Hi so I have integrated the levmar and neldermead into one program so that I can use levmar to solve function1 and neldermead to solve function 2.What about prototypes tho? When do you need them and when do you not. For instance my functions function() and function2() don't have prototypes...
  10. A

    MATLAB Minimizing function in Matlab and C

    Im getting an error on this line: double *Actual_Data[5] = (double *)adata; Invalid Initializer.This function (my other function) runs but produces very different values from the matlab void function2(double *p, double *x, int m, int n, void *data)//equations for parameters eta, phi and omega^2...
  11. A

    MATLAB Minimizing function in Matlab and C

    I have the green line is the new fit, the red is the matlab. I trust our new levmar one now more! So this *data pointer can pass the variables required by the function. Do you know how its used? Also I have another minimization I would like to use levmar for, however it is the sum of the modulus...
  12. A

    MATLAB Minimizing function in Matlab and C

    Hey, sorry I did use the correct input, i just showed you the wrong one. So now I am confused, the MATLAB produces a different result, but not a hugely different result. Those values produce a really good fit (matlab plotter). But the original author did not get those numbers. Now to get rid of...
  13. A

    MATLAB Minimizing function in Matlab and C

    I just changed the prototype to void, and initialised infor to zero's by putting it equal to {0}. It runs much more succesfully now - 174 iterations, but stops due to reason 2 - stopped by small Dp. The solution isn't correct though. I have two warnings from GCC Compiler now, but both are...
  14. A

    MATLAB Minimizing function in Matlab and C

    definitions out side of functions: #define pi 3.141592653589793238462643 double Input[5] = {0, 1, 2, 3, 4}; double Actual_Output[5] = {1.2, 2.693, 4.325, 6.131, 8.125}; Function static double function(double *p, double *x, int m, int n, void *data) { double Fitted_Curve[5] =...
Back
Top