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

learn more… | top users | synonyms

2
votes
1answer
96 views

How do I format Compile[] correctly?

My Mathematica skill is still rusty, so kindly bear with me. I'm having problem formatting expression to compile the function correctly: $\sum _{g=1}^G \sum ...
0
votes
0answers
52 views

Plot x as function of y and y as a function of x [on hold]

I'd like to plot a 2-D graph with "s" on the vertical axis, and "r" on the horizontal axis. But I wish to plot two functions: psi1[s,delta], and psi2[r,delta] where delta is a parameter I wish to ...
11
votes
2answers
384 views

Fitting ellipse to 5 given points on the plane

Five points are required to define a unique ellipse. An ellipse has five degrees of freedom: the $x$ and $y$ coordinates of each focus, and the sum of the distance from each focus to a point on the ...
2
votes
3answers
96 views

Function to Expand exponentials

Is there a function similar to PowerExpand which expand exponentials? This would, for example, take Exp[5(a + b)] and ...
6
votes
5answers
351 views

Find function inverse

I'm trying to find the inverse of a function: (30*x^2 (1 - x)^2) (* where 0<x<1 *) I tried all the following options: 1. ...
6
votes
2answers
92 views

Modifying parameters: Set::setps in the part assignment is not a symbol [duplicate]

Ok, this will probably be a silly question, but I can't get my head around it. I'm making a simple module that, given a list and two integers, will swap the position of the elements in the ...
2
votes
1answer
58 views

JordanDecomposition in Mathematica

I'm trying to find the Jordan Decomposition in Mathematica for $$ A=\left( \begin{matrix} 2& -5& 8&-12\\ 1& -2& 4&-8\\ 0&0&2&-5\\ 0&0&1&-2 \end{matrix} ...
-1
votes
1answer
77 views

Similarity of two plot to each other [closed]

I want get the similarity of two different plot by Percent ... I have many plots for comparison like below : y : ...
5
votes
1answer
117 views
5
votes
2answers
119 views

Biot-Savart Law/Magnetostatics Solution

I am working on solving the Biot-Savart Law equation for the magnetic field around a charged ring of uniform current density. The expression that Mathematica gives is rather nasty, as expected. Notice ...
55
votes
2answers
2k views

Flatten command: matrix as second argument

One thing I could never wrap my head around is how Flatten works when provided with a matrix as the second argument, and the Mathematica help isn't particularly ...
1
vote
1answer
100 views

StreamPlot in Mathematica

A $2\times 2$ linear ODE system can be visualized by StreamPlot in Mathematica. For example: ...
1
vote
0answers
42 views

How to explain NDSolve that functions must be positive only?

I have a simple system of differential equations to solve but both functions should be positive: x[t] > 0 and y[t] > 0 for all t. I was not able to explain NDSolve this fact so it goes x[t] < 0 ...
2
votes
1answer
94 views

Ted's explanation for the 3rd argument of ListCorrelate doesn't apply to the {1, -1} case?

I was reading Ted Ersek's explanation for the usage of ListCorrelate(.nb version can be found here) and noticed something confusing. It's the third example of ...
-1
votes
1answer
20 views

Iterator bounds error when defining function [closed]

It's been a while since I've done any multi-line functions in Mathematica, so maybe I'm just missing something. I've created the following function, and I immediately get an Iterator bounds error when ...
1
vote
2answers
96 views
10
votes
2answers
183 views

Extracting the function from InterpolatingFunction object

I've used Interpolation[] to generate an InterpolatingFunction object from a list of integers. ...
4
votes
1answer
69 views

Possible bug / numerical issues with HypergeometricU — any suggestions for a fast workaround?

I've encountered some problematic behaviour with HypergeometricU. I have a probability distribution on the positive integers that takes the following form after ...
1
vote
0answers
48 views

Inconsistent linearity of inverse Fourier transform

Bug introduced in 8.0.4 or earlier and fixed in 9.0.1 or earlier I am trying to compute the inverse Fourier transform of this expression ...
0
votes
2answers
88 views

Collapsing summation

I am trying to write a command to collapse the sum of terms into an expression with summation. Something like ...
33
votes
2answers
709 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
58 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 ...
-1
votes
0answers
52 views

How can I eliminate “Solve::verif: Potential solution” error message from the Solve function?

I am running a Solve function with some determined variables and some updated functions. The variables with double brackets already have their own values, and the variables with single brackets are ...
4
votes
0answers
151 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 ...
0
votes
0answers
90 views

Defining a Gaussian Distribution Fit to data

I am given a set of data and told ahead of time that the data will need to be fitted to a Gaussian Distribution. I know that Mathematica has preset functions for linear, quadratic, and cubic fits, but ...
9
votes
1answer
196 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
55 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 ...
5
votes
2answers
170 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 ...
12
votes
6answers
791 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 ...
2
votes
0answers
89 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
151 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 ...
0
votes
3answers
45 views

Complement change order of elements

Consider this example: Complement[{a, y, c, d, e}, {a, c}, {d}] (*{e, y}*) I was expecting the result to be (*{y,e}*) why ...
1
vote
1answer
64 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
90 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
82 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
21 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
133 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
369 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) ...
8
votes
1answer
114 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
147 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
217 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)
12
votes
1answer
150 views

A bug in Commonest in version 10

Bug introduced in 10.0.0 m_goldberg demonstrated that in Mathematica 10 Commonest does not behave as the documentation indicates that it will. Concisely: ...
4
votes
3answers
138 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 ...
5
votes
4answers
545 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
469 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
341 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
905 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
556 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
223 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: ...