# 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.

80 views

### Finding zero of nonlinear simultaneous equations [closed]

I'm trying to find the zero of nonlinear simultaneous equations defined in myfun1 and myfun2: ...
34 views

### Transform an expression into a function [on hold]

I have a matrix of the form Mat = {{2a, 7a},{5a, 3a},{a, 2a}} (the actual matrix is a hugely complicated one of size 64x64, but the idea is exactly the same). I ...
367 views

### Distributing function arguments with function compositions. How to compute $(f + g^2)(x) = f(x) + g(x)^2$?

Suppose I have two functions f and g. To compute $f + g$ evaluated at a point $x$, I know that one can use ...
56 views

### Defining a function that depends on the length of a number and the $n$-th digit

I have defined the functions F[i][x] for i={1, 2, 3}.. I want to write a number that has only the characters 1, 2, 3, and I want ...
56 views

89 views

33 views

### How to turn a function's input argument into a new function

I want to write a function via a module that takes a user's input and creates a function from the input within the module. That is something like Input: ...
133 views

### How do I get Series[] as a functional, rather than as an expression (i.e. to avoid the dummy variable)?

How can I write an equivalent to Series that doesn't require a dummy variable? Note that the series should be constructed before the evaluation point is supplied, ...
5k views

### Functions with Options

Suppose you want to create a function which has optional arguments. Maeder's book Programming in Mathematica covers the topic extensively up to version 3, but some things have changed/evolved since ...
261 views

### How to check the validity of an option value

I have a user-defined function, func, which takes the following form: func[arg1, arg2, options] Here is the actual code ...
84 views

### How to save the caching produced in processing

As my this previous post.I get a custom function which can help me got some function contain a certain option.And I have put it in my "init.m" file. ...
74 views

### Implementing the Cimmino method [closed]

What am I doing wrong? I am trying to implement the Cimmino method, an iterative method for the solution of linear algebraic systems. The final output should be a vector. Here is a description of the ...
107 views

### Multiple output cells, suppressed by semicolon

I'd like to write a function that outputs multiple cells, as in Multiple output cells, but not when the function is called with a semicolon at the end. Any idea how?
43 views

### Calculate column number from alphabetic column reference in Excel [duplicate]

Here's a fun brain teaser. Can you give me a mathematical equation to calculate the column number of a Microsoft Excel column, given the alphabetic column reference? Let X, Y, & Z represent the ...
60 views

### Catch parameter order and error using functional form

Question: Why does this fail? In:= (Catch[#] &)[Throw[17]] ...
57 views

### Lyapunov Exponent as a function of parameter

I am working at Rossler system and I would like to ask you for some help. This system is described by equations: \begin{array}{ll} \dot{x} = -y - z \\ \dot{y} = x + 0.2y \\ \label{eq:UkladRosSP} \dot{...
108 views

### How to use the built-in function GraphElementData

Very surprise to me.I found this is a built-in function but it is undocumented.Such as this answer's "CurvedArc" and "Curvature",...
464 views

### Gâteaux (directional) derivatives and higher order differentials of a functional

I would like to calculate the Gâteaux 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$ ...
116 views

### Filters on image vs data

I was using GaussianFilter and realized that applying it to an array yields a different result from applying it to an image. For instance: ...
1k views

### Why is there no PositionFunction in Mathematica?

Too often I have seen the programs of inexperienced users greatly slowed by using Position in an iterative fashion, when far faster would have been to compute a ...
62 views

### How to build a ColorFunction that can take a non-numeric value? Blend returns an error

I'm trying to use an external package, defined here. This package has a private function called makeColorFunction that essentially works by taking an input color ...
57 views

### What is this function aimed to do? [closed]

Table[Sum[tmatrix[[i, j]], {i, 1, 2}], {j, 1, 2}] apparently creates some sort of a table, and it evidently works on a matrix....although it is hard for me to understand what should it do beyond ...
187 views

### How to efficiently write code with many functions that have variable number of iterators/arguments/

I am finding myself having to code functions like this: \text{answer} = \sum_{k_0 = 0}^{\color{Blue}n_0} \sum_{k_1=0}^{\color{Blue}n_1}\cdots\sum_{k_{N-1}=0}^{\color{Blue}n_{N-1}} \frac{P_{k_0,k_1,\...
57 views

### How may I repeat this procedure n times?

This is the procedure ...
1k views

### How does a Pringle lose its curvature?

Nom! As part of a bigger project, I've was writing some code to calculate the scalar curvature of surfaces of the form $z = f(x,y)$. This uses a general calculation of the scalar curvature to produce ...
118 views

### Function does not execute commands and fails to evaluate [closed]

The code I am trying to execute: hh[x_, y_] := x + y; hh[{3, 4}] The expected output: 7 However, on output I get ...
79 views

### Remove part within square brackets for function

So I've defined a variable as follows: q = {{x[t]}, {Φ[t]}} V=0.5*x[t]^2*m^2+0.5*Φ[t]^2*I I've had to differentiate with respect to time so: ...
109 views

### Why a function returns two different values if copied into a Notebook or imported with Get from a Wolfram Mathematica Package?

I have some Mathematica code that shows a behaviour I really cannot understand. The code only contains a bunch of function definitions. If I paste it in the Notebook Front End and I evaluate it, I ...