# Tagged Questions

For questions on writing functions (pure or using Set/SetDelayed) for any purpose, including the features that may be incorporated in those functions, such as options, patterns and conditions.

58 views

### Specifying independence of a variable in a function

I am dealing with a function of a finite number of variables and among the operations I wish to do is to differentiate it repeatedly with respect with any of the variables. Now this function happens ...
71 views

### How do I tweak the input assistant to use string completion on my own functions? [duplicate]

I would like to be able to use Mathematica's string completion feature for subvalues of my own functions. I tend to go for functions that follow the pattern ...
139 views

### Passing function as argument

I've been mucking around with passing functions as arguments to other functions and via trial and error seem to have something that works. I was wondering if someone could have a quick look at some ...
175 views

### Local variables whose definitions depend on each other [duplicate]

Consider the following (pseudo-)function definition: f[l_] := Let[{ a = Length[l], b = First[l], c = b/a, }, c*10] So for ...
48 views

Let ...
262 views

### difficulty abstracting the OptionValue pattern

I am building lots of functions that use Options and OptionValue and wanted to reduce the redundancy in the expressions that ...
126 views

### How to define a nestable Baseform function, BaseForm output becomes BaseForm input

Mathematica won't change a number's BaseForm recursively: 63969 // BaseForm[#, 16] & // BaseForm[#, 8] & // BaseForm[#, 2] & Well, I inspected former ...
185 views

### Account for powers of 0 and 1 when defining function

I have a function that I am defining as (assume m,n,a,b are non-negative integers): myfcn[x_^m_ p_^n_, x_^a_ p_^b_] := basefcn[m, n, a, b]; and then extending to ...
635 views

### Mapping data on Archimedes' spiral

I would like to map my data on Archimedes' spiral and preserve the distance between points on the curve. The test data consists of 20 evenly spaced {x,y} ...
408 views

396 views

### Gateaux (directional) derivatives and higher order differentials of a functional

I would like to calculate the Gateaux derivative of a functional (i.e. a function depending on functions). A simple example for the Dirichlet functional: $L(u(x))=\int_0^1 \frac{1}{2} (u'(x))^2 dx$ ...
93 views

### Creating function with matrix argument

I am completely new to programming, so I apologize in advance for a stupid question. I want to program an algorithm for computing invariant factors of a finitely generated abelian group, so in ...
331 views

### Defining a pure function involving a function argument

I've got an expression involving x and y that I want to use as a MeshFunction: ...
72 views

### Alternatives to indexed variables in Compile

According to the excellent answer given here by @Leonid Shifrin: How to compile effectively?, You can not really use indexed variables in Compile, although it ...