Tagged Questions

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

learn more… | top users | synonyms

-2
votes
0answers
52 views

Finding the domain of this trigonometric function [migrated]

how can I find the domain of this function? f(x) = (xsin(x) + cos(x) / 1 - cos(x)) + (|X| - 2 / x^2 -4) I assume we don't want the dominator to be zero so f(x)1 ...
0
votes
1answer
26 views

How to rearrange CharacteristicPolynomial[ ] terms?

I have a symbolic matrix A, which I need to find the characteristic polynomial, then order the polynomial in greatest-to-least form. (Ultimately to find the matrix inversion via Cayley-Hamilton ...
2
votes
2answers
45 views

Returning the 3-dimensional vector from a skew symmetric matrix

I'm trying to write a function that takes in a skew symmetric matrix and returns the corresponding vector. When I write the following code, it works when I leave it as variables, but it does not work ...
0
votes
1answer
47 views

How to evaluate a “pure function”? [closed]

I need to evaluate the result of DSolve, e.g. {{y -> Function[{x}, x^2 - x^3]}} at some specific point. I tried y[1] and y /. x -> 1. Hope someone knows how to do it
0
votes
0answers
30 views

Add constraints to a variable number of parameter in Minimize

i want to use Minimize with a variable number of Parameter which works fine: ...
4
votes
2answers
110 views

Can't figure out how to apply these functions repeatedly

I have the following problem, and even though I've tried Fold & Inner, Sow & Reap, et al. I can't figure out the clean way to do this. Here's the problem. I have a list that starts as ...
1
vote
1answer
63 views

C compiler error: the no library could be generated error

I have windows 8, Mathematica 9, and I've just installed Microsoft Visual Studio 2013 with update 3. I'm try to run Compile with the option ...
4
votes
2answers
465 views

How to create a function like in Python

I want to call a function that would perform a function rather than assigning an expression to them. I.e. ...
5
votes
1answer
204 views

Why doesn't this pattern work? [closed]

I want the in-built function Count to count the elements in a list which are greater than a value. Example: Count[{1, 1, 2, 3}, (# > 1.5) &] Why doesn't ...
0
votes
2answers
58 views

How do I get a Do function to create a list?

I have a Do function which gives me a column of expressions. How can I get the Do function to give me these expressions in a list. i.e The do function gives me this: a b c d I would like it do give ...
0
votes
2answers
107 views

Problem in downloading “ToMatLab” package [duplicate]

Iam trying to download "ToMatLab" Package from http://library.wolfram.com/infocenter/MathSource/577/ but it is showing me an error message by showing a big question mark and "File could not be ...
0
votes
1answer
77 views

Functions in functions

I have three functions f(x,y) , g(t) , and h(t) and somehow I have to find (d/dt)f(g(t),h(t)) where t = 0. How would I go about writing this in Mathematica? In this equation g(t) is taking place of x ...
2
votes
3answers
149 views

Extracting coefficients from a power series

I have a function defined explicitly as a power series: $$\sum_{n=0}^\infty{T_n}\frac{x^n}{n!}=\frac{\frac{x^3}{3!}}{e^x-1-x-\frac{x^2}{2!}}$$ and I would like to extract the coefficients $T_k$ as ...
14
votes
6answers
526 views

How can I evaluate only a single step of a recursive function?

Let's say have a simple recursive function for the Fibonacci sequence f[0] := 1 f[1] := 1 f[n_] := f[n - 1] + f[n - 2] but I want to see how it will expand in a ...
2
votes
2answers
63 views

Conditional replace of a column

Im trying to replace the value in the Nth column of a list if a condition is true, returning the modified list. I've tried modifying the answer from 61219 and been through most of related questions ...
0
votes
1answer
52 views

What does this Append expression do? [closed]

I have to understand some code. A part of it is written below. Can someone explain to me what it does: ...
7
votes
3answers
129 views

How to deal with the condition $u_i=u_{i+1}$ in B-Spline basis function?

The defintion of B-Spline basis function as shown below: Let $\vec{U}=\{u_0,u_1,\ldots,u_m\}$ a nondecreasing sequence of real numbers,i.e, $u_i\leq u_{i+1}\quad i=0,1,2\ldots m-1$ $$N_{i,0}(u)= ...
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
31 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
89 views

CoefficientRules for negative powers

CoefficientRules acts like the following. ...
4
votes
1answer
229 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
70 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
24 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
155 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
30 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
63 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
177 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
955 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
220 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
283 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
49 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
122 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
619 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
109 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
112 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
66 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
162 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
420 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
98 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
104 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
23 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
247 views

Extracting the function from InterpolatingFunction object

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

StreamPlot in Mathematica

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