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

learn more… | top users | synonyms

34
votes
2answers
770 views

Why is the new PositionIndex horribly slow?

This issue has largely been mitigated in 10.0.1. New timings for the final test below are: ...
2
votes
1answer
66 views

Find constants in a function? [closed]

Let's say I have a function f[x] with n constants, e.g. f[x] = c1 * x + c2*x^2 + ... + cn *x^n I also have n conditions to find those constants, e.g ...
5
votes
0answers
170 views

Strange behaviour of MMA in derivatives of some standard functions

There are some peculiar things to be discovered in derivatives of some standard functions in MMA: Strange behaviour Example 1: Abs We have ...
9
votes
1answer
213 views

Limit of sequence of functions behaving strange

I'm trying to determine the limit of the sequence of functions $$f_n(x)=\left(\frac{1}{\pi}\arctan(n x) + 1/2\right)^n. $$ I define ...
3
votes
0answers
64 views

Listable on first level

I have some function which take List as input. f[l_List]:=someActions[l] I need apply this function to a list of lists. Now I ...
1
vote
1answer
39 views

Strange behaviour of Set and Part when given a sequence

Consider this example: lis1 = {a, b, c}; lis1[[2]] = Sequence[e, f]; lis1 (*{a, e, f, c}*) lis1[[2]] (*e*) lis1[[2]] = Sequence[g, h]; lis1 (*{a, g, h, c}*) It ...
6
votes
2answers
184 views

Is there a built-in function which detects singularities in a function?

Given a function f[x] and a region M in the complex x-plane, how can I find singularities of f in this region, i.e., issue a ...
13
votes
6answers
895 views

Will Version 9 functions all work in Version 10?

Having developed a substantial code base in Mathematica 9, leads me to ask these important questions prior to downloading and installing Mathematica 10. Will any Mathematica functions from the ...
3
votes
0answers
124 views

Generating function for Newton series?

The function GeneratingFunction gives generating function for Taylor series. Is there a similar function for Newton's series? $$f(x) = \sum_{k=0}^\infty \binom{x}k \Delta^k [f]\left (0\right)$$
5
votes
2answers
153 views

Strange Behavior when making Equal Listable in Pick

While trying to make this problem more efficient I tried different methods and dabbled with making Greater and Equal ...
1
vote
1answer
74 views

How can I export numerical data in a calculation-favorable format?

I am exporting some data into the txt file but since the values exported to this txt file expresses 10^6 to be *^6, I cannot use these numbers in calculations in other programs.. For instance, when I ...
1
vote
1answer
94 views

How do I link the txt file data sheet to mathematica and extract exact elements that I would like to use in solving for x? [closed]

I am trying to solve for a numerical solution for an equation which contains variables that evolves as index i incrreases. The actual equation that I am using to extract solution for x with an ongoing ...
3
votes
2answers
89 views

Wrapping Interval Notation for Take

I'm trying to implement the solution to a math problem in Mathematica, but my code can't handle a particular boundary case. I think that I could implement a function that would do what I want it to, ...
0
votes
0answers
31 views

System of Nonlinear equations with Gamma and Incomplete Gamma function

The next two nonlinear equations are cumulative ratios of a production system. The mathematical model includes two essential parameters (n, tau) that can be obtained by solving this system. I'm ...
0
votes
1answer
158 views

Finding real roots for an eigth-degree polynomial

The context for this problem is identical to my first question. Unfortunately my previous result for $L$ was inexact since it was a relatively simple approximation. This time I have managed to produce ...
7
votes
4answers
443 views

Solving $L=\frac{3}{2} \sqrt{4 \pi ^2 A^2+W^2}-\frac{\sqrt{5 W \sqrt{4 \pi ^2 A^2+W^2}+6 \pi ^2 A^2+3 W^2}}{\sqrt{2}}+\frac{3 W}{2}$ for $W$

When I solve the aforementioned equation for $W$ or $A$ on Mathematica I get a long and ugly equation in return, namely one of the solutions for $W$ is: (attempt to read at your own health) ...
10
votes
1answer
133 views

Why won't SparseArray let me store values with the head List?

When you attempt to define a SparseArray with elements that have the head List it complains: ...
3
votes
2answers
160 views

Get domain for a given function (including e.g. singularities)

I am new to Mathematica and this is probably a simple question, but I can't figure it out at the moment... f[x_]:=1/(x-3) Clearly the vertical asymptote is at ...
3
votes
2answers
227 views

What would be the inverse function for the following condition?

I tried the problem but i couldn't take above condition in question in terms of f(x)
4
votes
3answers
141 views

How to Nest a Function with three Arguments?

I have two functions with three arguments $f_x(a,b,t)$ and $f_y(a,b,t)$. And i need a nesting like this ...
6
votes
4answers
1k views

Use Mathematica to calculate the area enclosed between two curves

use mathematica Hence, calculate the exact area enclosed by these curves using Mathematica. $f(x)=x^3$ and $g(x)=x^5 - 2 x^3 - 3 x$ i have got the graph...now I'm stuck with finding the area
10
votes
4answers
494 views

Set of integers not divisible by smaller set of primes

Let $p_n$ be the sequence of prime numbers, and $s(x,n)=$ the set of integers less or equal than $x$ that are not divisible by $p_1,\dots,p_n.$ I can define it as follows: ...
8
votes
5answers
379 views

What is my problem with MeshFunction?

I want plot the max value in a sine plot. We can use the following code ...
10
votes
4answers
1k 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} ...
8
votes
2answers
633 views

Can you apply the Cellular Automata function to a grid containing numbers?

Im attempting to simulate a simple evacuation model using cellular automata theory.My study aims to determine whether Cellular Automata can effectively represent how people would behave in a fire ...
4
votes
4answers
234 views

implement the ZOH in mathematica [closed]

well I'm trying to implement the ZOH in Mathematica, but I can't. Take a look, this is my script: ...
17
votes
5answers
6k views

How to find the domain and range of a function with Mathematica?

I'm studying calculus and in some exercises I am asked to find the domain and range of a function. Does Mathematica have already a built-in function for this? I can imagine some ways of doing so, ...
1
vote
1answer
97 views

Horizontally compress a picture with varying compression ratio [closed]

I have a function c[x] whose domain and range are both [0,1]. And I have a picture with width W, height ...
2
votes
3answers
263 views

How can I get the function of a plotted trajectory? [closed]

I solved two ODEs, which are a function of t, numerically. The first ODE is the vertical equation of motion and the second one is the horizontal equation of that ...
1
vote
2answers
54 views

How to use the output we see of expression when this expression is inside Dynamic

Consider this example: Manipulate[status = Dynamic[If[a < b, Yes, No]], {a, 2}, {b, 5}] The output of this calculation is ...
1
vote
1answer
82 views

Attaching functions to movable locators

I'm trying to create a manipulate plot showing the electric field due to a collection of point charges. At the moment I've created such a plot which allows the x and y positions of each charge to be ...
10
votes
2answers
225 views

Why isn't Lookup treated like other symbols?

With Mathematica 10, I wanted to overload Lookup using TagSetDelayed, but it doesn't work. For instance, if I define two objects ...
21
votes
2answers
455 views

Why is Query so much slower than Part?

Time for another of these(1),(2) as yet another new-in-10 function appears to have poor performance compared to older alternatives. This time: Query appears to be ...
1
vote
1answer
147 views

How to apply a tensor to a list of arguments

The problem I have is the following: Let C be a list of coordinates, say, C = {x1, x2, ..., xn} and ...
2
votes
1answer
132 views

RegionPlot3D run forever when plotting 3D ParametricRegion

when working with 2D, RegionPlot works fine with ParametricRegion as can be seen in this example: ...
3
votes
2answers
460 views

How to plot several functions without jumping? (multiple eigenvalues of a system as functions of 2 parameters)

I've been working on this research problem for months with some success by no global/proper solution to the problem. So I have square, Hermitian matrices of various sizes ($8,20,38$ dimensions) with ...
1
vote
2answers
90 views

How to define logical expressions for platonic solids?

A more general question would be: How to find logical expressions for 3D-objects described by closed polygon sets? Finally a simple question is more prolific, therefore: How to define logical ...
3
votes
5answers
283 views

How to add periodicity to condition?

Is it possible to set the following function f[a], where a can be any real number? $$ f(\alpha) = \begin{cases} 1 ...
0
votes
2answers
247 views

$RecursionLimit::reclim: Recursion problem

Please, find bellow my original question. Here is all my code: ...
2
votes
1answer
106 views

Define PolyLog so that positive reals evaluate on upper edge of branch cut

Generalizing the previous question: Define Log so that negative reals evaluate on lower edge of branch For real positive values $x>1$, Mathematica's polylogarithm function ...
2
votes
1answer
192 views

Finding average error of the data

Considering I have some data, and I want to fit the data to a linear fit and find the average error from the linear fit, how can I do that using Mathematica? I have ...
0
votes
0answers
27 views

How to prevent function from substituting the part of the parameter name if it has a subscript? [duplicate]

I have the following problem, when defining and using a function, that's supposed to have an outside parameter xmin: A[x_] := Exp[-x/Subscript[x, min]] A[5] ...
-2
votes
1answer
60 views

Compile Determinant [closed]

I would like to determine the determinant of a 4x4 matrix with the entries a[i,j] being functions of $i$ and $j$. I used Compile with code: ...
5
votes
1answer
188 views

How can I make a “self-referential” replacement operation self-contained?

Fairly often I find use for replacement rules that call themselves on the right-hand side of the rule, e.g.: ...
1
vote
0answers
89 views

How do I choose only one branch of ArcTan?

I have a problem concerning ArcTan drawing a graph using ListPlot. I import a table of data: ...
2
votes
0answers
37 views

Evaluating standard functions of general quaternions symbolically

Mathematica can easily compute exponentials and logarithms of concrete quaternions: ...
2
votes
1answer
99 views

How to explain the behavior of Rule inside these functions [duplicate]

I'm trying to define a function that takes an expression and spits out a pure function involving a replacement rule of that function's variable. An example would be a function ...
0
votes
0answers
24 views

Use FindRoot solution as number in function [duplicate]

I would like to save a number that I gain with FindRoot so that I can use it in another function. I tried: ...
-1
votes
1answer
122 views

Find minimum function value in data and give coordinates of minimum

I create with Table an array containing the function value of some function and the n1and ...
1
vote
1answer
108 views

Remove curly brackets _completely_ to map a function to the elements of a list [duplicate]

Most list manipulations can be done with Flatten, Partition and Take. I didn't managed to ...