Questions about the use of built-in Mathematica functions, including pure functions.
1
vote
4answers
113 views
How can I create a list of functions?
Can anyone tell me, how to create a list of functions? I've tried the following code, but it doesn't work.
...
0
votes
1answer
56 views
What does Binomial return for non-integer arguments?
Mathematica returns values for non-integer arguments passed to Binomial.
What is the definition of Binomial for such continuous ...
2
votes
1answer
59 views
Flat function with repeated sequence
There are functions like Join[ ] that accept a variable number of arguments. Join is a flat function, as the order of arguments ...
14
votes
4answers
432 views
Finding Limits in several variables
Is there a way to find a limit of a multivariable function, like
$$\lim_{(x,y)\to (0,0)} f(x,y)$$
with Mathematica?
When $f$ is continuous, we can use
$$\lim_{(x,y)\to (0,0)} ...
6
votes
1answer
47 views
Creating a NearestFunction that returns an index
I use Nearest repeatedly for large data sets. For example
pts = RandomReal[{-1, 1}, {1000, 3}];
Nearest[pts, {0, 0, 0}]
I ...
3
votes
0answers
70 views
Mathlink and multithreading
In order to make my computations faster I have developed a C/C++ application calling Mathematica kernel and performing many operations using Mathematica functions for equation solving.
Now I want to ...
1
vote
1answer
104 views
24
votes
2answers
384 views
Variable naming changes everything
I am having a rather unusual problem I do not understand with Mathematica where renaming one of the variables of my function causes the function to stop "working". Here is the example of the code ...
2
votes
2answers
81 views
Cannot call custom function loaded from script using C/C++ MathLink
I am using MathLink with C/C++ on a Unix system in order to call a Mathematica (version 9) function and get the result.
The function I need to call is a personal function of mine ...
0
votes
1answer
69 views
Taking derivative of Euler relation [closed]
I have defined the following function, which is the Euler relation for $\cos\,x$.
f[x_] := 1/2*(Exp[I*k*x] + Exp[-I*k*x ] )
I want to take the derivative with ...
8
votes
1answer
107 views
Apply a Function Pairwise
I'm new to Mathematica
I'd like to apply Mean pairwise to a list to achieve the following.
...
1
vote
1answer
49 views
How to send a function definition to MathLink from C/C++?
In this tutorial some MathLink concepts are introduced. At page 33 in the last lines the author is talking about sending to MathLink a function definition like ...
4
votes
1answer
204 views
Using DistributionFitTest on custom distributions in Mathematica 8
I originally posted this question on Stack Overflow, but I didn't get any answers, and I'm hoping to have better luck here.
I'm trying to compute the goodness-of-fit of a bi-modal Gaussian ...
6
votes
1answer
85 views
How does `LongestCommonSubsequence` work?
When I recently came across this posting about LongestCommonSubsequence I was curious about how the function worked.
...
0
votes
0answers
14 views
Dumb question, how do I find the image of this function? [migrated]
The function is $Y=2$, the domain is just 2? And the image of it?
I don't think I quiet understand what the image of a function means, the domain is all values that it can assume, correct?
Could you ...
9
votes
2answers
86 views
What are Root objects with multiple polynomials?
In Mathematica 9 a new flavor of Root object with multiple polynomials was introduced. For example,
...
5
votes
1answer
72 views
How do I expand StirlingS2[n, 10] in terms of elementary functions?
I know that it is possible to expand StirlingS2[n, 10] in terms of elementary functions of n. I tried ...
0
votes
0answers
4 views
What does “-2E-07x” means? [migrated]
I'm a programmer who had always been lacking some mathematical skills, yes it's a shame, I know.
I'm making this little software for a biologist friend, and at some point I need to pull out a graph ...
1
vote
1answer
71 views
Finding n-th term of a sequence of functions
Lets say, I have the following series of functions,
$f_1=a+1$
$f_2=a^2+2a+1$
$f_3=a^3+3a^2+3a+1$
Assume that $f_4, f_5,$ and $f_6$ are also known. However $f_n$ is not known as a function of $n$.
...
6
votes
3answers
559 views
How do I plot Thomae's function in Mathematica?
I wanted to plot this function
$$f(x) =\begin{cases}
1 & \text{if } x= 0 \\
\tfrac1{q} & \text{if } x = \tfrac{p}{q}\\
0 & \text{if } x \in \mathbb{R}-\mathbb{Q}
...
-2
votes
0answers
118 views
What does “# & /@” do? [closed]
This code plots a crystal lattice. a and b are the primitive vectors and tauA and tauB are the locations of atoms A and atoms B. So far there's two things I don't understand:
What does the "@@" in ...
7
votes
1answer
115 views
How do I get a general form for n-th derivative of a function? [duplicate]
I tried the following but it basically returns unevaluated:
...
1
vote
0answers
75 views
Notebook UI: Autocompletion - Display function arguments when typing?
Is there a setting to display the required arguments of a function when typing as Visual Studio, Matlab, etc. does?
2
votes
1answer
71 views
Cannot run Mathematica C-interfacing examples 'factor'
I am trying to run a Mathematica example concerning Mathematica interfacing issues with C programs. In particular I am trying to call a Mathematica function from C.
Example ...
2
votes
3answers
141 views
Use elements of Array inside function definition
I'm trying to define a function which modifies and sums over the elements of an array. Here is a very simplified version.
myF[kmax_] = Sum[v[[k]]/k, {k, 1, kmax}]
...
0
votes
1answer
48 views
Don't pollute outside context when solving equation from the outside
This code works fine only if a is not defined in the outside context:
...
1
vote
2answers
61 views
Calling blank arguments using enclosing functions
Is there a way to call a function and have that function use an argument defined in an enclosing function?
e.g.,
...
8
votes
1answer
203 views
Write C/C++ programs calling Mathematica functions
I need to write a C/C++ program and call some functions in Mathematica especially those like Solve or NDSolve. The problem is ...
1
vote
1answer
77 views
Mathematica plots a discontinuity in piecewise function that does not exist [duplicate]
I have the following function defined:
...
1
vote
2answers
192 views
distance between two curves
I try to compute the distance between two curves. I use the EuclideanDistance to do that.
Here my code:
...
2
votes
2answers
211 views
3
votes
2answers
55 views
Generating a list of pure variables
I want to pass a list of pure variables to a function, in which the ordering of the variables matters. For instance, if I want a palindrome, my function might be:
...
0
votes
1answer
76 views
Can Mathematica check if two expressions give the same output for integer input?
Let me give the background for this question. I'm using WebAssign to assign homework problems, and WebAssign has a built-in mechanism which can grade problems using Mathematica commands. For ...
2
votes
5answers
294 views
How to leave function unevaluated programmatically?
Is it possible to write a function in such manner, that it can be either evaluated or left unevaluated?
This is a general question. Sample below is just a sample. No need to find solution for this ...
4
votes
1answer
145 views
Create string from character code
Is it possible to convert a charcode/keycode to a string?
I want to do this to create variables in a generated equation.
0
votes
1answer
62 views
Can I force a function to quit and return some value after a certain amount of time has passed during its evaluation?
Imagine I provide some random input to function like FindInstance[], and I observe that, despite the existence of good solutions, the function will, with some ...
0
votes
1answer
114 views
How do I define the domain of a function?
I have a function of two variables, f[x_, y_], and I would like to restrict the domain to values of x and ...
-1
votes
3answers
197 views
Sqrt — how to get negative branch?
One of the many attractions of Mathematica is that integers are generally treated as exact symbolic entities, and not just as numbers. I was just playing with Sqrt, and was puzzled by what appeared to ...
7
votes
2answers
324 views
Function Interpolation with Automatic / Algorithmic Values Mesh
I have an underlying function f(x,y,z) that is computationally intensive, but is smooth and continuous. I'm needing to find the function values along a line in xyz. Currently, I'm calculating f at ...
3
votes
3answers
181 views
How to sum over a List
list = {11.5575, 11.397, 5.52734, 4.0878, 2.54815, 1.86652, 2.55028,
2.14952, 1.6242, 1.34117}
I have a list of numbers. How do I make a function that creates a ...
0
votes
1answer
70 views
Using undefined function in an expression
I want to use undefined functions in expressions to be simplified. For example.
I want mathematica to simplify this input
$(f^{\prime\prime}(t),g^{\prime\prime}(t))\cdot (-g^\prime(t),f^\prime(t)) $
...
1
vote
1answer
96 views
3D plot of two 2D functions
I would like to plot two 2d functions in a 3d coordinate system. Examples are z = x^2 and z = y^2. Each function has one ...
-1
votes
0answers
52 views
Why is NonlinearModelFit calling the model function with symbolic arguments?
I have a model to fit which is made of numerical functions and so it can give a value for any numerical value of the arguments, but creates an error when called with symbols. ...
2
votes
2answers
68 views
changing a symbol into a function variable
Struggled for a while on this problem and hopefully you can help... I have a mathematical expression that currently has a symbol where I used to have a function variable. How do I make the symbol ...
5
votes
1answer
236 views
What is the difference between prefix/postfix notations and map?
I am new to Mathematica and just experimenting with the different programming constructs. I have been looking at Map and how to evaluate a function for a list of ...
4
votes
3answers
384 views
How to prove an expression by method of mathematical induction?
I want to prove the expression
$$1^2 + 2^2 + 3^2 + \cdots + n^2 = \dfrac{n(n+1)(2n+1)}{6}$$
by method of mathematical induction with Mathematica, but I do not know how to start. How do I tell ...
0
votes
0answers
26 views
How does Plot evaluate its argument? [duplicate]
I have a list of about twenty InterpolatingFunctions that I'd like to plot. They are interpolations from experimental data (frequency spectra between 100 and 5000 ...
8
votes
4answers
197 views
Transform a list of functions to a composition
How do I apply a list of functions in a nested way?
Example:
functionList = {f1,f2,f3}
RequiredCommand[functionList,Pi]
such that the required command returns
...
5
votes
5answers
281 views
Series expansion in terms of Hermite polynomials
I am trying to expand a polynomial in terms of orthogonal polynomials (in my case, Hermite). Maple has a nice built-in function for this, ChangeBasis.
Is there a ...
1
vote
1answer
97 views
Plotting a complex function [duplicate]
What does it mean if this message appears:
{Im[(1-E^Times[<<3>>] f)/(1-Power[<<2>>] f)]-0,Im[(1-E^Times[<<3>>] f)/(1-Power[<<2>>] f)]-0} must be a list of equalities or ...




