Questions tagged [functions]
Questions about the use of built-in Mathematica functions, including pure functions.
3,601
questions
0
votes
1
answer
9
views
LOG transformation
I have data (x,y) with some error bars, and I want to replace each value of y with log(y+1). I tried with Mathematica but it didn't work.
What is the problem with my codes
how can I calculate the ...
3
votes
3
answers
136
views
Approximation of the Fabius function $f(x) = \text{FabiusF}[x+1]\cdot \text{HeavisideTheta}[1-x^2]$ - FabiusF[x] don't works in Wolfram-Alpha
Approximation of the Fabius function $f(x) = \text{FabiusF}[x+1]\cdot \text{HeavisideTheta}[1-x^2]$ - FabiusF[x] don't works in Wolfram-Alpha
I am looking to figure out how well the displaced version ...
5
votes
1
answer
101
views
Adding Edge and Vertices to already made graph?
I have a notebook that generates a hexagonal grid graph and its vertex connectivity, coordinates, and numbers as an input for an FEA program in matlab. I simply want to add members to this shape (or ...
2
votes
1
answer
95
views
Is there a function which tests whether a Boolean expression is an inequality?
For something I am doing in Mathematica, it would be very helpful to have a function f[] which, when applied to an atomic Boolean expression, returns True if the Boolean expression is an inequality, ...
4
votes
1
answer
108
views
Why `AsymptoticSolve` doesn't work for a multivariate implicit function?
I started by defining
...
1
vote
3
answers
154
views
How to write a function in the following form f[a_, b_, c_,...] so that it is flexible with respect to the number of arguments?
@lericr have written under several of my questions that the way I try to modernize the code could be made much simpler. Below is the original part of the code. The remaining parts have similar designs,...
2
votes
1
answer
81
views
How to correctly reassign variables {c11 -> p11, c12 -> p12} using a Table or some other similar structure?
Why is the value of the function Pxx[1,2] is a number but the function Pxxx[1,2] is an expression? Isn't this construction ...
0
votes
1
answer
47
views
Plugging in a value after taking partial derivative [closed]
I am trying to write a code where I have a function of two variables, take the partial derivative with respect to each variable and finally plugs in specific values for the variables. To be more ...
2
votes
2
answers
70
views
How to use sequence of variables (Sequence) correctly?
Why does the function EER[1,2] have a different value than the function EERR[1,2]? Isn't the entry ...
1
vote
2
answers
64
views
Why does Mathematica not see some of the function PxB1[a10_, b10_, qa0_, qb0_, c11_, c12_] variables?
Why does Mathematica not see the c11 and c12 variables in the function PxB1[a10_, b10_, qa0_, qb0_, c11_, c12_]? How to fix it?
...
2
votes
2
answers
72
views
The correct notation of a function that contains an expression with NIntegrate
I tried to set the function Px[a1_, b1_, qa_, qb_]. Why does Px[1.22, 0.44, 1.40, 1.81] not give out a specific number?
...
0
votes
1
answer
32
views
Is it possible to ask Mathematica to order this expression in terms of descending absolute values of the arguments of the exponential functions?
I have the given expression which is a sum of exponential functions with some parameters $a,t,u,y$ where $a>0$.
Question
Is it possible to ask Mathematica to order this expression in terms of ...
3
votes
1
answer
49
views
How can one collect the terms of same power of a variable in a big expression?
In the expression A[x] below, I find it hard with Collect[] to get the terms of the same power of ...
1
vote
1
answer
35
views
Ratio of two functions leads to different limit than expected
Here, numerator seems to go like x^8 and denominator as ...
0
votes
1
answer
42
views
3
votes
6
answers
334
views
Better way to specifying arguments for multivariable function
If I'm working with many dimensions the amount of variables I have to use may get out of hand. I wonder if there's a quicker way to write something like below for example:
...
0
votes
1
answer
39
views
ContourPlot not working [closed]
Im trying to use ContourPlot to plot this function, but it's just giving me a blank graph. What's wrong?
My input:
...
1
vote
2
answers
58
views
Integrate function [closed]
I want to find the constant in front of the term of the integral that only contains $x$ in the following function:
$$f(x) = \frac{(56-15 \sin x + \sin^2 x)^2}{6-5 \sin x + \sin^2 x}$$
This is my input ...
1
vote
1
answer
35
views
Expressing and plotting functions: exploring relationships with x1, x2, and x3 [closed]
Let's consider three functions:
x1 = e^t + 2t^2 - 3;
x2 = t^3 - 2t + 5;
x3 = 2^t / (3t + 8)
How can we express or plot x1 in ...
3
votes
2
answers
147
views
+100
Optimizing execution time and exploring closed form solutions in Mathematica's DSolve
I am encountering two issues while running the following code in Mathematica:
Slow execution: I have been running the code for approximately 30 minutes, but it is still executing. I am using Windows ...
3
votes
2
answers
106
views
Convert comparision function into range
I have function:
f[x_]:=0<=x<=Pi
How do I convert this into range {x,0,Pi} to use for example with plotting:
...
3
votes
2
answers
79
views
How to check the simultaneous positivity of two multivariable functions in Mathematica? [closed]
Given two functions of several real variables, say f[x1_, x2_, x3_, x4_] := x1 + 3 x2^2 - 5 x3 - 7 x4; and ...
0
votes
2
answers
111
views
How to correctly specify variables in a function? [duplicate]
There is an expression
...
0
votes
1
answer
53
views
Solving the inequality equation in Mathematica
I am trying to solve the following inequality equation in Mathematica:
12 Sin[300 t] >= 8
I want to find the values of t ...
1
vote
1
answer
38
views
How can I discretize four long and complex functions with Mathematica?
I am looking for a procedure with Mathematica where one can discretize a function in a specific interval to a set of multidimensional vectors. In this way, we can possibly ease the calculation time ...
0
votes
0
answers
36
views
Printing the value of a function crashes Mathematica
I define SolVm1:
...
0
votes
3
answers
112
views
Incorrect number # of eigenvectors for eigenvalue
I have the following code:
...
0
votes
0
answers
18
views
Specifying and assigning arguments of a function to be real
I have the following complex matrix that I wish to integrate (element-by-element)
...
0
votes
1
answer
73
views
Simplifying expression and arranging terms in power of exponent
I have lots of expressions like below which I want to simplify but I am not sure how to do it in Mathematica. I am looking to simplify them in the form of $\Sigma _i A_i e^{y_i}$ where $A_i$ will be ...
1
vote
2
answers
117
views
How can I interpolate a piecewise constant function?
Let the given set of points
...
5
votes
1
answer
134
views
Does Mathematica have a LogSumExp function that's numerically stable?
I searched "Mathematica LogSumExp", and literally nothing is coming up. It's a relatively important function in machine learning and for numerically stable computation. Will I just have to ...
4
votes
1
answer
135
views
ConjugateTranspose[#] vs Conjugate[Transpose[#]] for lists [duplicate]
Bug introduced in 12.3 or earlier, fixed in 13.0.
I'm getting contradictory behavior for eigenvectors of a matrix when using Conjugate, Transpose and ConjugateTranspose. I'll demonstrate using an ...
0
votes
0
answers
26
views
How can I disable the mouseover behavior of AnimatedImage objects?
The otherwise very convenient function AnimatedImage displays a "pause" icon when you mouse over its output. Is there an option or trick to disable this? I see that in the documentation it ...
1
vote
0
answers
37
views
Evaluate coefficients of delta functions in a given expression
Suppose that I have a function of the form:
myfn[x_] = smoothfn[x] + A[x] DiracDelta[x-x0] + B[x] DiracDelta'[x-x0],
where ...
1
vote
1
answer
77
views
Why is this function not compilable?
Consider some functions
...
3
votes
1
answer
61
views
Functions from the output of Solve
The output of the equation
Solve[f[x] - x^2 == 0, f[x]]
is:
{{f[x] -> x^2}}
I would like the output to be
...
0
votes
1
answer
55
views
How to properly expand a list with certain numerical elements?
There is a list with 19 elements ...
0
votes
1
answer
79
views
How to expand the existing basis set so that it becomes more complete?
I have a set of anisotropic gaussian basis set which describes the ground state of the system with great accuracy.
The Hamiltonian of the system has the following form: $$H=-\frac{1}{2}\Delta-\frac{1}{...
0
votes
1
answer
52
views
How to combine multiple plots via Table when a map is being applied? [closed]
This question is based on this answer
...
3
votes
3
answers
134
views
2
votes
3
answers
218
views
Slope-demarcated PlotStyle implementation
In the above graph, I would like to display plots with slope-dependent plot styles (solid, dashed and dotted).
Specifically, the regions a---b1, a---b2 and a---b3 with solid lines(...
2
votes
1
answer
80
views
Why does Series give two different results for given function?
I want to do Series of this function x^12 Cos[y x]^2 Sin[y x]^6 Sin[(-1 + Sqrt[3]) y x]^2 around ...
0
votes
0
answers
26
views
DensityPlot with 4 region. Help please!
How to write a function in Wolfram Mathematica that returns the values 0,1,2,3 in random order and draw a diagram for it as shown in the picture using the DensityPlot function. Help please!!
0
votes
1
answer
55
views
How do I expand an exponential function? [closed]
First of all, apologies for the formatting, I can't seem to enter it as code here?
My question is as follows:
I have \Theta defined as follows:
...
2
votes
1
answer
64
views
How to directly define a function as the solution of RSolve
This is probably very simple, but I just cannot find this anywhere online. I have the code
...
2
votes
1
answer
116
views
How to define function that returns another function?
I'm new to Mathematica and I have an issue:
I'm trying to define a function that accepts as parameter another function with parameter X and then returns a function also with parameter X.
Input:
...
0
votes
1
answer
113
views
Can Mathematica estimate this complex function?
Mathematica has given me a function in $x,r$ given by
...
3
votes
2
answers
132
views
Recursive function with subscript
I am trying to define a recursive function with a subscript. Something similar would be $f_{n+1}(x) = \int 3 x f_{n}(x)dx$. I've tried lists, For function, ...
11
votes
2
answers
1k
views
What is a function?
Regarding:
Map[#[{2, b}] &, {Reverse}]
The above works, but it makes my head spin. The documentation for Map says that the ...
1
vote
1
answer
49
views
Function definition inside Module with local symbol
Usually if I want to define a function using an expression I do:
expr=x^2;
f[x_]=expr;
which usually works and give f a defination.
But now if I want to do the ...