On this toy problem, METHOD 3 is much faster than the other two, but I would love it if I could speed this up some more. It is MUUUCCH faster!įor this problem it is fast, but for my problem it is much slower (I have a much larger problem). METHOD 3:Elapsed time is 0.000372 seconds.ĬOMMENT/UPDATE #1: This is probably obvious, but using any of the methods above make sure that you pass the Jacobian to the function instead of loading it. METHOD 2:Elapsed time is 0.017192 seconds. METHOD 1:Elapsed time is 0.038066 seconds. THE FOLLOWING IS THE BOTTLENECK, calculated inside optimization, J is loaded each time, x is the set of design variables, X are the symbolic expressions for the the variables.ĭuring optimization something like this is called: x = This part of the code is calculated once and the result J, is saved and then loaded in the next part % symbolic variables I need an analytical Jacobian so that it is accurate (and I was thinking it would be fast, but that is not the case with my current implementation). I calculated the Jacobian analytically from my constraints using MATLAB's symbolic toolbox. I have formulated a optimization problem that requires a very fast evaluation of the Jacobian matrix.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |