Gabriel Landi
Reputation
916
Next privilege 1,000 Rep.
See vote count; VIP usercard
 Aug14 comment LeastSquare Solution for the Continuous Time Lyapunov Equation For least squares what I do is write a symbolic symmetric matrix in the sorts of R = Array[r,{n,n}]/.r[i_,j_]/;jr[j,i]. Then I do {b,B} = CoefficientArrays[Flatten[A.R + R.A[Transpose] + G], vars] where vars = DeleteDuplicates@Flatten@R. Finally, I do LeastSquares[B,b]. Aug13 asked LeastSquare Solution for the Continuous Time Lyapunov Equation Aug1 comment Converting other C++ classes to MTensor in LibraryLink @LeonidShifrin I'm sorry Mr. Shifrin. I am still learning about LibraryLink and most of what you said I did not understand. Say I have a 2x2 matrix a[i][j]. Then what I want is to define a 2x2 MTensor m such that m[i][j]=a[i][j]. Hopefully, it would be nice to do this without a double for loop with m[i][j]=a[i][j]. Jul31 comment Converting other C++ classes to MTensor in LibraryLink @LeonidShifrin I have edited the question with a situation where it is possible to access the data via a pointer. In that case, a simple solution exists? Jul31 revised Converting other C++ classes to MTensor in LibraryLink added 290 characters in body Jul31 asked Converting other C++ classes to MTensor in LibraryLink Jul27 comment Efficient Langevin Equation Solver @acl I am not sure how to do this. But I note that it depends strongly on the choice of parameters and, since the equations are non-linear, I am not sure a closed form solution for this has been found. Jul27 comment Methods to speed up numerical NDSolve, NIntegrate, @ruebenko Ok, sure thing! :) Jul27 awarded Editor Jul27 accepted Efficient Langevin Equation Solver Jul27 revised Efficient Langevin Equation Solver Included some nice code from ACL and two implementations for vector systems. Jul27 awarded Teacher Jul27 answered Methods to speed up numerical NDSolve, NIntegrate, Jul26 comment Efficient Langevin Equation Solver I just tried running an index through through the NestList with pre-generated RandomVariate; apparently it is slower. Jul26 awarded Commentator Jul26 comment Efficient Langevin Equation Solver acl, your timing is the same as mine i Think. In the first one you compute two simulations (data1 and data2) and in the second one you compute only one. Both have similar run times, and given the simplicity of NestList + the ability to accept any function, I don't really see much advantage. Jul26 comment Efficient Langevin Equation Solver I don't think so. This only generates the random numbers once. $r$ must be re-computed within each iteration. Ideally this would be done with r = RandomVariate[NormalDistribution[0,s],{m,n}]. But then you can't really nest this matrix; or at least I don't really know how. Jul26 comment Efficient Langevin Equation Solver Hi Jagra. I thought about using a single RandomVariate. But I couldn't really figure out how to efficiently Nest that. Jul26 awarded Nice Question Jul26 asked Efficient Langevin Equation Solver