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

learn more… | top users | synonyms

0
votes
1answer
36 views

Rigging a function to output a distinct value every nth call

There's some fixed script I am unable to alter (keeping things simple: Table[f[i], {i, 1, 10}]), , however, I can alter a function that the script calls (again, ...
0
votes
1answer
33 views

Trouble definining a function to use only certain heads

I'm trying to write a function that accepts only a particular Head (for example, prints only Symbols) using pattern matching. However, the following code has me a bit of confused. ...
4
votes
4answers
90 views

CoefficientRules for negative powers

CoefficientRules acts like the following. ...
4
votes
1answer
237 views

Mathematica doesn't simplify a simple expression

The question is simple as that. I have: ...
0
votes
0answers
41 views

How can I mix // with a function of two arguments? [duplicate]

I often find myself using // when playing around with expressions, but it is always cumbersome to have to switch to the full notation just to apply a function of ...
1
vote
0answers
33 views

Analog of GeneratingFunction for Newton series [duplicate]

GeneratingFunction gives the generating function for Maclauren series. I wonder if there a similar function for Newton series. If $$g(x)=\sum_{k=0}^{\infty}\frac{x^k}{k!}f(k)$$ Then g(x) is ...
1
vote
2answers
73 views

How to define a function that counts the exponents

I want to define a function $F$ described as follows: The input of $F$ is a polynomial such as m*u*x^4*y + n*v*x^2*y^3 where $m$ and $n$ are constants, and ...
1
vote
1answer
25 views

Expand Expression with Nested Special Functions [closed]

I am trying to study the following sequence for $a=1$, $n \ge 1$: $$\alpha_n=(1-aq^{2n})\sum_{j=0}^{n}\frac{(aq;q)_{n+j-1}(-1)^{n-j}q^{\binom{n-j}{2}}}{(q;q)_{n-j}(q;q)_j^3}$$ using Mathematica, where ...
0
votes
2answers
157 views

Time value of Money Functions combined

I am trying to combine multiple functions into one. I have defined following functions: (PV refers to Present value, FV refers to Future value, i or IPER refers to interest per period, pmt refers to ...
1
vote
0answers
35 views

Central binomial coefficient [closed]

I am tasked with creating a recursive definition of the binomial coefficients that stores previously calculated values. this is what I have: ...
0
votes
1answer
67 views

Applying natural log to a table of values [closed]

I know this is a simple question, but I am new to Mathematica. How do I go about natural log to a table of values? I tried this: ...
8
votes
2answers
179 views

Is there a way to revert to the built-in function after overwritting it using Unprotect

When using Unprotect, we can overwrite a functions definition: Unprotect[Sqrt] Sqrt[x_]="blahblah" Protect[Sqrt] Once this is done, can we revert to the built-in ...
21
votes
3answers
969 views

Visualisation of a recursive function

Is there a way to nicely visualize recursive functions? (diagrams/plots) More specifically I'm looking for a way to make contrast (visually) between e.g. the cosine function which if continuously ...
4
votes
5answers
223 views

Replacing columns of a matrix with zeros

I am to create a function that replaces columns 'm' through till 'n' with zeros. Here is what I have so far: ...
2
votes
2answers
286 views

Will Parallelize in this programme help it run faster? [closed]

I have a programme, and inside it this line of code. ...
0
votes
1answer
52 views

How to use “Compile” function when argument is array of size 500? [closed]

How to use "Compile" function when argument is array of size 500? The examples in the Mathematica help is just with one argument belonging to the real numbers. Any help would be appreciated. ;)
3
votes
1answer
124 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 ...
13
votes
3answers
658 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
110 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
2answers
128 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
67 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
81 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
2answers
190 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 ...
6
votes
5answers
449 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. ...
1
vote
2answers
103 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 ...
3
votes
1answer
105 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
24 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 ...
4
votes
1answer
77 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 ...
12
votes
2answers
271 views

Extracting the function from InterpolatingFunction object

I've used Interpolation[] to generate an InterpolatingFunction object from a list of integers. ...
1
vote
0answers
60 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 ...
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 ...
1
vote
3answers
97 views

Can I find constants in a function?

Let's say, I have a function with a constant, e.g. $y(x)=x+c$, and a condition $y(0) = 5$. I want to type in something like Solve[{y[x]=x+c, y[0] =5}, {c}] and get ...
1
vote
1answer
119 views

StreamPlot in Mathematica

A $2\times 2$ linear ODE system can be visualized by StreamPlot in Mathematica. For example: ...
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 ...
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 ...
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)$$
0
votes
3answers
63 views

Complement[] changes order of elements?

Consider this example: Complement[{a, y, c, d, e}, {a, c}, {d}] (*{e, y}*) However, I was expecting the result to be: ...
6
votes
2answers
185 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 ...
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 ...
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 ...
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 ...
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
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)
14
votes
2answers
227 views

A bug in Commonest in version 10

Bug introduced in 10.0.0 and fixed in 10.0.2 m_goldberg demonstrated that in Mathematica 10 Commonest does not behave as the documentation indicates that it ...
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