Questions tagged [functions]

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

235 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
52 views

Why Plot is not a listable function but still take input as a list?

By using Attributes I can see that the function Plot is not a Listable function. ...
106 views

Map onto function defined by derivative operator

I'm trying to map different values onto the derivatives of a function. To test it, I've tried the following: D[x^5, x] /@ {1} And the output is: ...
369 views

(Basic Question) How to use nested functions properly?

UPDATED PORTION OF QUESTION AT THE BOTTOM First, let me apologize for two things: 1) I'm very new to Mathematica, so this question is certainly very stupid, 2) I looked for the solution to this both ...
104 views

Solving equations involving NIntegrate

First, I have defined some functions like ...
34 views

Confusion over constructing interpolation functions from tables

Suppose I have a set of functions: f[x_] := x^2; g[x_] := (f[x])^2 +2*f[x]; h[x_] := 2*f[x]+5*g[x]; I tabulate the first two functions over ...
292 views

What's the fastest way to find the nearest Positive Definite Matrix?

Let's assume that I have a symmetric matrix $A$. What's the fastest way to find its nearest positive definite matrix in Mathematica? Any help would be appreciated.
58 views

How to apply equivalences in the Limit?

Actually, I have the following expression $a1$: ...
129 views

how to write the Max of this function / How can i use Max[]

Hi every one I really need your help in this question write the function in the picture nction in Mathematica because I need to make graph... ?? could anyone help me ? I'd appreciate some help. ...
76 views

Extracting Data from For Loop

I want to add phases in for loop and after adding a new phase I want to export this data? How can I do this? Can you show me where I do wrong? ...
64 views

Why 3 Different results for same Integral of a series?

I have the integral of a Series. According to some details, I get different outputs and I don't know which to rely on. Can anyone explain me the differences and if I am doing some mistakes? ...
79 views

Why do I get Imaginary unit after Abs and Complex expand?

I am getting an imaginary unit in the output after Abs and saying Complex Expand, why? Then, when I integrate in x and z, I miss beta. I don't get why beta vanishes in the definite integral. ...
55 views

Unset Built-in Functions (Times, Dot, etc)

Yes, I know, I should never actually do this in a package or something. But I'm curious - how could I undefine Times or Plus or the like? I tried Unprotect and Clear, but that didn't seem to work.
79 views

Speed optimisation of consecutive loops

Very simple question, which for some reason I am unable to find a proper solution with Nest or NestWhile. My issue is speed. The idea is simple. 1) Construct a list of length T according to a linear ...
482 views

Polar to Cartesian and Cartesian to Polar Transformation

I have noticed some odd behavior when converting from Polar < -- > Cartesian. For example; https://math.stackexchange.com/questions/290209/diff-eq-transformation-polar-coordinates We want to ...
193 views

Compiling matrix multiplication using a list of matrices

I'm trying to create compiled function which computes a list of Gamma matrices named GammaM and multiply them within the compiled code. ...
75 views

Using RegionFunction with non-trivial Inequality

So I have been using ContourPlot to plot the zero set of a fairly unwieldy function, with many intersecting components. There's really only one of these components ...
79 views

Solving a system of equations with conditional functions

With your help i am getting closer to the solution of my problem. I know that the code is long but most of it is boring definition. At the beginning i am just defining function, which works at the ...
53 views

PolynomialExtendedGCD in 2 variables

Consider a field $R$ and the ring $A=R[y]$. Consider two polynomials $g,h\in A[x]$. I want to obtain $d=\gcd(g,h)\in A[x]$ and two polynomials $s,t\in A[x]$ satisfying the Bézout relation: $sg+th=d$. ...
316 views

Impose a boundary condition to a function

Background I am trying to impose a boundary condition on a function of two variables $u(x_1,x_2)$. The boundary condition is: $u(x_1,0)=A\cos(\omega x_1)$. The same function in mathematica $u(x_1,0)$...
57 views

How to calculate a continuous function once and access values later?

I have a function that involves a numerical calculation: h[v_]:=NIntegrate[f[x]*Log[p[x, v]], {x, -Infinity, Infinity}] I need to visualize how well a bunch of ...
88 views

Using DeleteCases to ignore term of Product

I'd like to calculate $\int_{-\infty}^{\infty}\mathrm{d}x/(1+x^6)$ through a variation of the residue formula, which is $\int_{-\infty}^{\infty}f(x)\mathrm{d}x=2\pi i\sum \text{Res }f$ for Residues in ...
46 views

Obtain a SymmetricReduction of a bivariate (symmetric) function given in Piecewise form

I would like to re-express the following bivariate (symmetric) function (defined over the unit square) ...
67 views

Personal Reminder with Speak capability repeats multiple times

I am trying to create a personal reminder for myself using the Speak function in Mathematica hoping that the computer speaks the task only once at the designated time. However, I have found that the ...
65 views

Constructing a function for expanding general $n$ products

I have the following quantum mechanically motivated product: $\langle0\vert(A_1b_1 + A_2b_2 + A_3b_3)(B_1b_1 + B_2b_2 + B_3b_3)(C_1b_1 + C_2b_2 + C_3b_3)$, where $b_i$ is an annihilation operator ...
256 views

Piecewise function output response interpretation

Piecewise[{{t^2, t <= 0}, {t, t >= 0}}] Outputs: t^2 t <= 0 t t >= 0 0 True What does the last line of output 0 True mean? Sometimes it ...
453 views

simulate a 32-bit signed integer overflow in a recurrence function

Considering the following recurring equation: which is this factorial function: I want to find the value of x where f(x) = 0. Actually, the solution is impossible with Mathematica, and it's pretty ...
59 views

Should this be equal to Gamma function or not?

I define the following function: Nat2[s_] := InverseFourierTransform[FourierTransform[1/t, t, w] (-I w)^(s - 1), w, x]/Cos[Pi (s - 1)] /. x -> 1 I expected ...
130 views

Timing: how make a program to work faster using built in functions and tables

I want to improve my code to make it working faster even for very large numbers. ...
223 views

Financial Derivative european call option

When estimating financial derivatives like a european call option there is a parameter named: dividend paid per time unit. What does this mean, I have not been able to find any more information about ...
108 views

Display functions without dependence?

I'm solving systems of equations with a few different functions of time, t, and so I'm getting output with lots of [t] running around. Is there a way to display these functions without the dependences,...
120 views

creating some smooth density functions

I would like to create some density functions based on some distance measure $D$. As a base density function lets say I have a Gaussian density $f$ with mean $-1$ and variance $1$. I would like to ...
15 views

Changing ticks on axes and full bar legend of density plot

I want to remove the {$5*10^4$,$5*10^5$ and $5*10^6$} ticks from the y-axis as they look like eye-sore. How do I do that? Also my bar legend isn't giving the whole range i.e. 0 to Max range of Lkall (...
167 views

Native function in Mathematica export functions from Mathematica to MATLAB

Is there any native function in Mathematica (not ToMatlab) that I can export a function from Mathematica to MATLAB, to Paraview or to any plotting software? Clarification: I want to export something ...