Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions on writing non-trivial programs in Mathematica. Do not use this tag for questions on plotting/graphics or for questions on doing mathematics with Mathematica, where the focus is more on the math than the program.
7
votes
Accepted
Where should global variables be defined in a package?
You could explicitly use Global`b in the definition of MyLagrange:
ClearAll["MyP`*"];
BeginPackage["MyP`"];
MyLagrange;
Begin["`Private`"];
MyLagrange[f_, var_] := Module[{a}, a = D[f, var] + Globa …
7
votes
Sisyphus Random Walk
Another approach would be to formulate this as a DiscreteMarkovProcess. Since DiscreteMarkovProcess only allows a finite state space, we need to truncate at some large distance xmax. Also note that …
93
votes
5
answers
15k
views
What does the construct f[x_] := f[x] = ... mean?
This question mentions "x := x = trickery".
What does defining a function as f[x_] := f[x] = ... do and what is it good for?