Questions on assigning and unassigning definitions to names that represent them, including issues raised by context and localization. Use tag [assignment] for issues relating to Set versus SetDelayed.

learn more… | top users | synonyms

0
votes
1answer
113 views

Maximization of a 3-variable function

So I define a 3-variable function $h$ and I want to find the maximum of $h$ in a region $\mathcal{R}$: ...
9
votes
0answers
107 views

Is garbage collection broken in version 10.0.0?

In version 10.0.0 under Windows I am observing the following behavior: Do[Module[{foo}, foo[x_] := 1; foo[0]], {10}] Names["foo$*"] ...
7
votes
0answers
67 views

Maximum number of literal values for SetDelayed?

Under what circumstances should I expect Mathematica to turn a delayed assignment into an immediate assignment? I have put together a minimal example (available here) which demonstrates this behavior. ...
5
votes
0answers
139 views

Context “Unique to This Notebook” makes variables black even if they're not defined?

I'm trying to use this technique to keep variables separated between different notebooks. It seems to be working fine, except that variables turn black as soon as they are evaluated — any ideas why ...
3
votes
0answers
80 views

What's reliable way of finding declared but undefined functions/symbols in several interrelated packages?

I have many packages some of which use some of others. I have many symbols defined in them. Is there a reliable way of finding declared/exported but undefined functions/symbols in several ...
1
vote
0answers
44 views

specifying a list (vector) of arbitrary length

When trying to do symbolic calculations in mathematica involving a space of dimension n, which is arbitrary but fixed, I'd often like to work with vectors that have ...
1
vote
0answers
114 views

Variable scope in nested NMaximize, NMaxValue

I'm trying to use NMaxValue inside other statements (FindRoot and NMinimize). Those statements should bind variable names, but I'm getting weird warnings which seem to indicate that the variables ...
0
votes
0answers
41 views

Coupled ODEs with boundary conditions - DSolve Error

I'm relatively new to mathematica and I can't find the error here. I suspect it has something to do with the fact that vx, vy, vz aren't blue on my mathematica - as in, they already have some assigned ...
0
votes
0answers
72 views

Is there a better way of creating/assigning variables programmatically than using strings and ToExpression?

For quite a while now I've been wondering how to assign variables programmatically, and I have finally figured out one way of doing this. For example in a game where you have a variable number of ...
0
votes
0answers
49 views

How to hide global variables in package?

in the package I'm writing I have a list of global variables which should not be visible from a notebook. Here's an extract of the package: ...
0
votes
0answers
87 views

Local variable names - Is there an easy way?

I apologize first, because this has been asked, like in Treat all variables as local in a module [duplicate] Variable scope similar to other languages But I don't get how to use them. Some codes ...
0
votes
0answers
36 views

Subscripts to a variable; why a letter shoud come before a digit?

I noticed that I cannot create a variable $f_{2s}$ since Mathematica seems to leave a space between the subscripts 2 and s ...
0
votes
0answers
111 views

How to define a variable as a function of another variable?

I want to define a variable q which is a function of t. And I want to define another variable ...