Questions about the use of built-in Mathematica functions, including pure functions.

learn more… | top users | synonyms

0
votes
0answers
62 views

what is the difference between these definitions? [duplicate]

I define 2 functions: g[s_][x_,y_] := the gaussian (1) g1[s_,x_,y_] := the gaussian (2) I get the same answer using ...
0
votes
1answer
333 views

Computing the fundamental matrix and its monodromy matrix

Assume $\dot x(t)=v(x,t)$ is a $T$-periodic, with respect to $t$ dynamical system. That is $x\in\mathbb R^n,\quad t\in\mathbb R,\qquad v(x,t+T)=v(x,t)$. Let $x_0$ be a periodic solution, and in ...
3
votes
0answers
88 views

Finding the argument set for internal functions in Mathematica v9.0

I've recently run into a problem with importing TIF stacks in Mathematica: Slow import of multigigabyte TIF image stacks On the advice of Simon Woods and others, I've been looking into the behavior ...
0
votes
1answer
188 views

Calling functions which take their arguments interactively

Lets say I have a file named test.m containing some functions. ...
6
votes
1answer
238 views

solve ODE with divergencies

The solutions of the second order differential equation $$\frac{1}{\eta}\frac{d}{d\eta}\left(\eta \frac{df}{d\eta}\right)+\left(1-\frac{s^2}{\eta^2}\right)f-f^3=0$$ is shown in Fig. 5.2 below, for ...
0
votes
1answer
62 views

Extracting function variables from a list [duplicate]

Evaluating the following func[x_, y_] := x^2 + y^2 listn = {{a, b}, {c, d}, {e, f}}; Map[func[##] &, listn, {1}] yields {func[{a, b}], func[{c, d}], ...
7
votes
3answers
314 views

Find names of the functions defined in a file

Lets say I have a file named file.m that contains: test[] := ( Print["test"] ) How would I go about extracting the function ...
1
vote
4answers
895 views

Solve trigonometric equation

I'm looking for a solution (graphic, numeric or analytic) for a function of the form: $$a^2\tanh(x)=\tan(ax),\quad a ≥ 1,\ x > 0$$ preferably using Mathematica. Any advice?
4
votes
2answers
427 views

How can I find the range of my function

I am trying to find the range of (3 Sin[x] - 3)/(2 Cos[x] + 10), I tried this, ...
3
votes
1answer
319 views

How do I draw a credible velocity vs. time graph using Locators?

This is partly a math question, partly a Mathematica question. For educational purposes, I'm making a simple demonstration to create a velocity over time graph from six locators. On the basis of ...
3
votes
1answer
148 views

Circle as a function parameter

What I want to do is to find a circle which is tanget to the three big ones. I tried the code below: findSmallCircle[c1_Circle, c2_Circle, c3_Circle] := ...
0
votes
1answer
79 views

Function or script which maxes out the CPUs?

I've been using Mathematica for awhile now and have never come even close to maxing out my CPU cycles. Are there any functions which consume lots of CPU cycles? Right now I am running a script which ...
4
votes
1answer
444 views

What do the hashtags represent in the result of Solve, and how should I use them? [duplicate]

There is a function that I'm trying to get the inverse of. My function is a simple polynomial: Tn[T_] := 4/9 T^3/Tc^2 + 5/9 T Now I tried to find ...
0
votes
2answers
180 views

Is there a better way to approximate some graphs of integrals than interpolation?

I'm still pretty new to Mathematica so my apologies if this is a dumb question. I wanted to plot some integrals of functions for no particularly good reason, but the only decent way I could come up ...
0
votes
2answers
78 views

How would I add together any list of arguments as a pure function?

Let's say I have a list of arguments, of any length. How would I add them all together? f = Evaluate[Plus @@ Array[Slot, 3]] & f[1, 2, 3] This would add ...
2
votes
1answer
450 views

How to take the derivative w.r.t. an arbitrary function?

EDIT: The answer posted by @Jens works for built-in functions only. However I'm starting to wonder if this is related to my Mathematica install somehow. I have version 7. Here is an example in the ...
2
votes
1answer
565 views

How could I define a function as the solution of equations in Mathematica?

I have posed a specific question yesterday but it may be too trivial to answer. I think the question could be asked in a more general way so it is easier to answer. Then I could solve the original ...
1
vote
1answer
82 views

How can I transform parts of an Integer list to a String list

There is a sorted list of Integers. ilist = PadRight[Sort[ RandomSample[Range[1, 99999], 3], Less], 5] It should become string area codes like: ...
-1
votes
1answer
1k views

Why won't my function show in my plot? [closed]

I defined a function f as f[x_] := x^3/(x^2 + 1); and a function F as ...
1
vote
0answers
23 views

valuation to a function using a list [duplicate]

What I want to do is to evaluate a function as shown below: LessQ[n_] := LessQ[n] = l[n] < 61 In some cases, when I am sure that on a list the ...
2
votes
1answer
117 views

making a function of fit results

I have 13*25 datasets consisting each of around 40 points. They are all linear I can easily fit them using fit function but my problem is when I want to call them I want them to be functions. I want ...
4
votes
1answer
227 views

How to check if a given expression is an “explicit algebraic number”?

The documentation for PossibleZeroQ says: With the setting Method...
5
votes
2answers
157 views

How to check an algebraic number for membership in a list

I need to check an algebraic number for membership in a list of algebraic numbers. The numbers can be expressed in different forms (combinations of radicals, Root ...
-1
votes
2answers
211 views

How do I generate a table of data points from a function and add random noise? [duplicate]

I am trying to generate a table of data for the function: ...
2
votes
2answers
172 views

Restarting an Animate animation after variable in Manipulate changes

I've been trying to restart an animation after variables change from Manipulate PopUpMenus. My animation takes the form: ...
1
vote
1answer
153 views

Derivative inside a function

I am trying a problem that should be simple: to create a function that contains a derivative. I need to do a more complex example, but even with the simplest I'm having trouble: Let's consider ...
7
votes
2answers
129 views

How do I invoke the default complexity function?

Documentation on ComplexityFunction says: With the default setting ComplexityFunction->Automatic, forms are ranked ...
1
vote
1answer
129 views

Recursive function taking functions as arguments

I'm trying to implement Lie brackets and derivatives of nth order. For doing this, I've stumbled upon something I don't understand. Here is an illustration: First I define the functions: ...
9
votes
1answer
315 views

Is it possible to find a limit of a sequence given by its recurrence relation?

I need to calculate a limit of a sequence given by its recurrence relation. I tried the following: ...
6
votes
3answers
263 views

How to get the correct answer when solve this equation?

I want to find the values of the parameter $m$ to the graph of the funtion $$x^4 - 2 m x^2 + m + 1$$ has three extremal points make an equilateral triangle. I tried ...
7
votes
2answers
131 views

Change some option of a function when calling it [duplicate]

Say I have defined some function like f[p_] := Plot[Sin[p*x], {x, 0, 2 Pi}] Now in most cases, I just need to specify the value of ...
4
votes
2answers
179 views

Using Element[]

Can the Element[] function only be used for the domains given in the documentation? I am trying to use it to determine if a value is contained in a previously defined list. Thanks!
-1
votes
1answer
213 views

How to define a pure function with a Module?

I was not able to use a self defined (using Module and For loops) piecewise function to fit data. It seems that the problem is that I have to define a pure function. I would like to learn how to ...
1
vote
1answer
146 views

Find a sequence of integers which give max in each step

I would like to write a program in Mathematica to look for the integer $n$ such that the following definition holds for any $1 < m < n $ $$\frac{f(n)}{f(m)}>1+\frac{\log(n/m)}{\log(n) ...
23
votes
1answer
217 views

What does Internal`InheritedBlock do?

What does the function Internal`InheritedBlock do? How is it different from the regular Block?
0
votes
1answer
59 views

Have the kernel load a user-defined function by default [duplicate]

I wrote a very simple function that I would like to act as if it were one of the default functions that came with Mathematica, so that you don't have to load or import any package before you make use ...
6
votes
1answer
102 views

create function that behaves like continuedFraction [duplicate]

I'm just starting to learn Mathematica and I got stuck at this question. This a noob question but please help. I need to define a function named continuedFraction that takes user input of type list ...
29
votes
5answers
884 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 ...
3
votes
2answers
508 views

Function returning Null along with other unexpected expressions

When I use some function, at the end along with the output I get some NULLs returned that I don't understand the reason for and are highly undesirable. For example, when I define the reversal of list ...
1
vote
0answers
79 views

Does Graphics`Mesh`SimplePolygonQ[] work for you?

Graphics`Mesh`SimplePolygonQ is an undocumented function. I'm using Mathematica 7, and when I try: ...
2
votes
4answers
625 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. ...
2
votes
1answer
110 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 ...
0
votes
1answer
76 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 ...
9
votes
1answer
146 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
142 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 ...
31
votes
2answers
902 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
1answer
298 views
0
votes
1answer
108 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
202 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
146 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 ...