sebhofer
Reputation
1,888
Top tag
Next privilege 2,000 Rep.
 Nov 20 comment Is the replacement operator associative? As associativity is normally defined as a property of a binary relation I think it would be nicer to have an example such as x + y /. x -> y /. y -> z, which of course shows exactly the same behaviour... Nov 12 answered Problem with ArrayFlatten to concatenate matrix Nov 12 comment Problem with ArrayFlatten to concatenate matrix Huh? Isn't this the same as a = {{1/2 l Sin[\[Gamma][t]], -(1/2) l Cos[\[Gamma][t]]}}; b = IdentityMatrix[2]; ArrayFlatten[{{a}, {b}}] // MatrixForm? @Bendesarts Why do you insist on ArrayFlatten? Nov 12 comment Numeric range: present or not Only works for integers though... Nov 9 comment How to be more efficient/faster with this MatrixExp-vector multiplication? @Lukas Another thing: the Block inside Module is not really important here, I just needed a way to define func. One other way is SetDelayed @@ {func1[res_, t_], MatrixExp[-I*mat, res]} (which, funnily, turns out to be a little slower). Nov 9 comment How to be more efficient/faster with this MatrixExp-vector multiplication? @Lukas Right! Sorry, I wasn't thinking straight there. That was what I meant. Nov 9 comment How to be more efficient/faster with this MatrixExp-vector multiplication? @Lukas Btw, have you tried computing the integral in the exponent instead of doing a Trotter decomposition? Nov 9 answered How to be more efficient/faster with this MatrixExp-vector multiplication? Nov 9 comment How to be more efficient/faster with this MatrixExp-vector multiplication? Sorry, I didn't notice the new initial condition. Nov 9 comment How to be more efficient/faster with this MatrixExp-vector multiplication? I also get the same error message as @MariusLadegårdMeyer and res2 is nonsense. Please check you code again. Nov 9 comment How to be more efficient/faster with this MatrixExp-vector multiplication? I'm a bit confused... Can you explain what the t->3 does in evol1 and evol2? Nov 6 comment Defining stochastic differential equation & simulating a system of three SDEs I just realized that @Gosia's solution does not work for me. You can do rf=RandomFunction[proc, {0., 5., 0.001},20]; Show[ListPlot[rf["PathComponent", 1]], ListPlot[rf["PathComponent", 2]], PlotRange -> All] though. Nov 6 comment Defining stochastic differential equation & simulating a system of three SDEs Yeah, this is not quite obvious. You should look at the TemporalData documentation for all the options. You can select one of the sampled trajectories by doing something like rf=RandomFunction[proc, {0., 5., 0.001}, 20]; rf["Path", 1], which will give you a List of raw data. Note, however, that this is not in the correct format to use with ListPlot directly. So this solution is rather clunky and @Gosia's solution is probably better! Nov 5 comment Defining stochastic differential equation & simulating a system of three SDEs Good you figured it out, but you still haven't posted a sensible set of values, neither in the question nor in your answer! Nov 5 comment Defining stochastic differential equation & simulating a system of three SDEs Also, what's wrong with directly substituting $(dX)_g$ into the other two equations? Am I missing something? Nov 5 comment Defining stochastic differential equation & simulating a system of three SDEs Please ALWAYS provide a COMPLETE code sample! Don't expect others to make up their own set of parameters if they want to help with your question! Nov 1 comment Binding a variable to an unbound variable Plot has the HoldAll attribute, so the second argument will not be evaluated (or any of the arguments for that matter). Try Plot[{f2^2}, Evaluate@{f, 0, 10}]. Oct 26 comment Table: calculate the intermediate variable but not list them Maybe you already know this, but chances are you don't: there is more to ; than one might expect! Oct 23 comment How to solve a linear system by LinearSolve when the variables are duplicate? I agree. It was just that you so confidently calling it "fold-over" in your comment made me feel like I should have known that it was actually a thing :-) Oct 23 comment How to solve a linear system by LinearSolve when the variables are duplicate? Is fold-over the "official" name for this operation?