Gabriel Landi
Reputation
1,001
Next privilege 2,000 Rep.
 Aug 16 accepted Mathematica + Numerical Recipes Aug 16 accepted Circuit drawing in Mathematica Aug 14 comment LeastSquare Solution for the Continuous Time Lyapunov Equation No. I saw that on the documentation for LyapunovSolve but I don't understand the Mathematics of e Kronecker product. Aug 14 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]. Aug 13 asked LeastSquare Solution for the Continuous Time Lyapunov Equation Aug 1 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]. Jul 31 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? Jul 31 revised Converting other C++ classes to MTensor in LibraryLink added 290 characters in body Jul 31 asked Converting other C++ classes to MTensor in LibraryLink Jul 27 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. Jul 27 comment Methods to speed up numerical NDSolve, NIntegrate, @ruebenko Ok, sure thing! :) Jul 27 awarded Editor Jul 27 accepted Efficient Langevin Equation Solver Jul 27 revised Efficient Langevin Equation Solver Included some nice code from ACL and two implementations for vector systems. Jul 27 awarded Teacher Jul 27 answered Methods to speed up numerical NDSolve, NIntegrate, Jul 26 comment Efficient Langevin Equation Solver I just tried running an index through through the NestList with pre-generated RandomVariate; apparently it is slower. Jul 26 awarded Commentator Jul 26 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. Jul 26 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.