Questions tagged [functions]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

Solve in solving equation system

I have the following problem: I have a system of equations specifically consisting of 56 equations, with 34 coefficients to be determined, in simplified form: ...
iron's user avatar
  • 1
0 votes
1 answer
20 views

Laplace Transform and Different Results

I have the following piecewise function and I take the Laplace Transform ...
Moo's user avatar
  • 3,270
0 votes
1 answer
35 views

How to plot points on a graph curve under logarithmic coordinate axis

I am trying to draw a curve and set a special point based on the logarithmic abscissa, as shown in the following example. The function is 1/(1+(RCw)^2)^0.5. ...
Yao Li's user avatar
  • 63
0 votes
0 answers
35 views

Trying to produce an exact number from function [closed]

I have a function defined as follows: approx[n_] := n^(2n^2+1)*Exp[-n^2(Log(Log(n))+1)]*Sqrt[2Pi]/(Log(n)) I want it to produce a numerical value as output in ...
inception's user avatar
1 vote
1 answer
39 views

Issue with FullSimplify in StirlingS2 definition

I have previously asked a question about a problem simplifying an expression in Mathematica. The solution was to expand the definition of StirlingS2. This time, I ...
Cardstdani's user avatar
0 votes
1 answer
36 views

Problem calculating mean of probability distribution

I have a discrete probability distribution where $P(X=x)=(Factorial[n]/(n^x))*StirlingS2[x-1,n-1]$. So, when trying to calculate its mean with the following property: $\mu = \sum_{i} x_i \cdot P(x_i)$,...
Cardstdani's user avatar
1 vote
0 answers
69 views

How can I ask Mathematica to give the explicit real form of the given function?

In part of my calculations, I obtain this expression which contains the imaginary unit I but I expect that this expression might be real (from the comments below, ...
MsMath's user avatar
  • 175
5 votes
2 answers
112 views

Converting between currencies using a pair of currency codes

Mathematica can convert currencies using real time data: CurrencyConvert[Quantity[13.25, "USDollars"], "Euros"] which gives €10.8 Can I do ...
apg's user avatar
  • 2,135
0 votes
0 answers
34 views

Why NDSolve does plot only the output? [closed]

I am trying to solve a differential equation numerically with NDSolve. The code is ...
yousee's user avatar
  • 11
0 votes
0 answers
47 views

Substituting solution into an equation in a module

I have this model which gives me list as an output ...
Anshul Bokade's user avatar
1 vote
1 answer
58 views

How to use || as a function name and apply it to calculate the equivalent resistance of parallel resistors as we typically write?

The equivalent resistance $ R_{eq}$ of $n$ resistors in parallel can be calculated from this: Would it be possible to define a function to calculate the equivalent resistance of resistors with the ...
internet's user avatar
  • 805
2 votes
1 answer
40 views

How to check if there exist variables for which a function may be real?

I have a tough time in checking whether there exist any values of x and y (both real) for which the following pair of functions ...
Jee's user avatar
  • 386
5 votes
3 answers
312 views

Reversing the order of function arguments by a replacement rule

I am facing an issue when I try to reverse the arguments of a function in a replacement rule. Let me give an example : ...
Adrien Martina's user avatar
0 votes
1 answer
50 views

How can I simplify this out put?

Based on this answer, I tried to find the condition to function $y = \dfrac{a x+ b}{c x +d}$ where $ad \neq 0$ and $a d - b c \neq 0$ increasing on $(-d/c, +\infty)$. I tried ...
John Paul Peter's user avatar
11 votes
2 answers
211 views

Which functions use a given option?

I occasionally discover Options which look like they might be useful, if only I knew which functions used that option. Is there a resource that lists all the functions which use a given option? What ...
Tapiocaweasel's user avatar
1 vote
1 answer
70 views

How combine two DensityPlot3D in only one graph

I need to combine two DensityPlot3D in only one graph but the "Show" doesn't work for that. ...
Rubens Filho's user avatar
4 votes
2 answers
232 views

Given two functions, generate all nested applications of the functions to a given order

I have two functions $f$ and $g$. Given some order parameter $n$, I want to created all nested applications of $f$ and $g$ and save them in a list. For example, for order 1 we will have ...
JohnnyB's user avatar
  • 95
3 votes
1 answer
69 views

Troubles with BlankNullSequence in the case of multiplication

I have some trouble to use the triple underscore notation to use definitions with or without a term. Consider the following toy example f[a___ x]:=1 {f[x],f[2x]} ...
Adrien Martina's user avatar
6 votes
1 answer
399 views

Finding an ellipse of minimum area that encloses a set of points

Is there a built-in function or set of functions in Mathematica that can take a set of points in the x-y plane and determine the ellipse of minimum area that contains all of the points? I am sure ...
BioPhysicist's user avatar
  • 1,124
2 votes
0 answers
66 views

How to effectively substitute variables in xAct?

I am trying to find the gauge field equation by varying the Born-Infeld Action with the help of xact package. I use the following ...
codebpr's user avatar
  • 2,233
1 vote
0 answers
48 views

Automatically detecting the function directory

Consider I have a function in /home/../Mathematica/FuncDir/Function.wl directory. The function is dependent on some external files, which are in the ...
Tanmoy Pati's user avatar
5 votes
3 answers
120 views

Tally elements in a list of matrices up to an overall sign

I have a list of matrices like the following one with 6 elements: ...
JohnnyB's user avatar
  • 95
0 votes
0 answers
24 views

Optimal way of defining sums-linear function [duplicate]

I asked on a previous post how to define a function which satisfies $f[x+y]=f[x]+f[y]$ and then define $f[x]$ on monomials. The problem with this is that it involves a lot of iterations when we ...
Adrien Martina's user avatar
1 vote
1 answer
37 views

Strange errors of exceeding RecursionLimit in a function with two arguments, one set delayed and one fixed

INTRODUCTION Hi. I feel a bit embarrased asking this question as the answer may be staring me in the face and there are at least two other stackexchange articles related to it. MINIMAL WORKING EXAMPLE ...
Russell Jay Hendel's user avatar
5 votes
2 answers
257 views

Define a function on a single element but linear in sums

I have tried searching around but I couldn't find the solution to this very simple setup. I want to define a function $f(x)$, which should satisfy $f(x+y)=f(x)+f(y)$, and whose action I only want to ...
Adrien Martina's user avatar
2 votes
1 answer
115 views

Solve equation for one variable

I have the following two equations, di - (39.18 (0.07 + 2.61 (de + di)^0.28) + 1891.93 (de - di)^0.218)/(0.0119 + 0.0626 (de + di)^0.28)=0 and ...
a019's user avatar
  • 867
0 votes
0 answers
25 views

How to find the argument dependance of an expression

Consider expressions such as X := f[n[1]][n[3]] g[n[7], n[1923]] I would like to construct a function that returns the list of $n$'s on which $X$ depends. I know ...
Adrien Martina's user avatar
2 votes
1 answer
56 views

Solving multivariable equation after setting partial derivative to zero

I have a real-valued function of four variables, namely $L[\phi, m0, m1, m2]$. I am interested in taking the partial derivative $\partial_{\phi}L$ thereof and setting the partial derivative to zero, ...
John Doe's user avatar
  • 371
0 votes
0 answers
50 views

How to generate non-duplicate list of tuples with integer elements {-2, 0, 2}?

How can I generate all possible non-duplicate eighttupleList where each element, $a_i$, can be an integer from the set {-2, 0, 2}? ...
emnha's user avatar
  • 2,111
6 votes
1 answer
118 views

How to obtain all definitions in which a symbol appears?

My question is very similar to https://stackoverflow.com/questions/5840313/how-to-get-all-definitions-associated-with-other-symbols except I am looking to find all definitions in which a symbol ...
Kvothe's user avatar
  • 4,419
3 votes
1 answer
92 views

How to improve code speed for the large datasets?

How can I improve the speed of this code? It runs okay but is quite slow for large datasets, for example, 5 million elements. ...
hana's user avatar
  • 2,390
5 votes
5 answers
398 views

How to stop mapping on true results for large lists?

Assuming I have a long list (real data with more than 100k elements). I have a function that I want to apply to the list, for example, EvenQ. I want the mapping to stop once the result for one element ...
internet's user avatar
  • 805
1 vote
0 answers
59 views

Assign a function to other function with the change of the variable

I want to define a function that contains other functions but with other variables. Is it possible? For example, I would like to do something like this: ...
blahblah's user avatar
2 votes
1 answer
60 views

How to make a secondary top frame for a function?

I want to make a plot with two x-axes, one on the bottom and another on the top, where the variables are different but the function is the same. For instance, let f = y(a,b). How can I have in the ...
Jacinto Paulo's user avatar
0 votes
1 answer
87 views

How to use code to solve the parity periodic accumulation problem?

Given that the function f(x) is an odd function with a domain of real numbers R, and it satisfies the condition f(1-x) = f(1+x). ...
csn899's user avatar
  • 4,061
1 vote
0 answers
89 views

Differentiation of Parabolic Cylinder Functions and Hermite Polynomials w.r.t to Order

When I evaluated (ver. 12.3) parabolic functions below in the vanishing order limit: $u \rightarrow 0$, I got the following: ...
user91411's user avatar
  • 400
2 votes
1 answer
79 views

Tell Mathematica that the output of a function is a List / Vector

I have a function (Piecewise) that returns a list, e.g.: F[x_] := Piecewise[{{{x^2, x}, x < 0}, {{x, x^2}, x > 0}}, {0, 0}]; I would like to add another list ...
Luis's user avatar
  • 187
0 votes
1 answer
69 views

How to set optional variables in Function?

When using Function, is it possible to set specific arguments to be optional? For instance, in f = Function[{x, y}, x + y]; Can ...
sam wolfe's user avatar
  • 4,693
3 votes
1 answer
68 views

Peak Appearances in Plot Outputs from Optimization Routines

Dear fellow researchers and Mathematica enthusiasts, I've been working on a computational physics problem and encountered an interesting issue regarding the appearance of peaks in my plots, which I ...
Everlin Martins's user avatar
1 vote
2 answers
110 views

Problem with defining a bivariate piecewise function

I want to define the following function in Mathematica in order to evaluate its partial derivative later, $$C(u,v)= (1+\theta) uv + \theta(u+v-1) F(u+v-1)$$ $$F(a)= 1\quad \text{if} \quad a \ge 0 \...
Etemon's user avatar
  • 255
7 votes
1 answer
497 views

How does this code work?

I saw this thread and upvoted many answers there. Below is the answer by kglr (not my most favorite answer there, but it looks fun). I wonder if anyone could help ...
internet's user avatar
  • 805
3 votes
2 answers
150 views

Is there an issue with calls to WolframAlpha from Mathematica? [closed]

I was trying to use the step by step to get a solution to an integral, but it was failing, so I tried an even simpler example from the Wolfram documentation ...
Moo's user avatar
  • 3,270
2 votes
1 answer
98 views

Definition of ResourceFunction["IntegrateByParts"]

Here we can see definition of ResourceFunction["RainbowText"]. The definition is quite obvious on the image (explicit open source). We can get the ...
azerbajdzan's user avatar
  • 16.7k
-2 votes
1 answer
75 views

How to calculate the exact range of the analytic interval x of the piecewise function?

Use: Clear["Global`*"] f[x_] = Piecewise[{{3^(x - 1), x <= 1}, {(2 - x)/(x - 1), x > 1}}] f[f[x]] + 1/3 f[x] - 2 // PiecewiseExpand Get the result: ...
csn899's user avatar
  • 4,061
3 votes
2 answers
195 views

How to remove non-loop vertices in a graph?

How can I remove vertices from a graph that do not form a loop? For example, ...
internet's user avatar
  • 805
3 votes
1 answer
43 views

How do I replace certain parts of an expression [closed]

Let's say I have this expression 2w E^(I w a/ (v+c)) + 4 w^2 E^(I w a / (v-c)) I'd like to replace every instance of ...
Seigel's user avatar
  • 73
2 votes
2 answers
138 views

Circular function with arbitrary radius and center

I'm looking for an implementation in Mathematica of the generalized circular function $\text{circ}(x, y; R, c)$ of radius $R$ and centre $c=(c_1,c_2)$ such that $$\text{circ}(x, y; R, c)=\begin{cases}...
Noobgrammer's user avatar
4 votes
2 answers
156 views

Contour Plot - L-Shaped

I am trying to plot a contour with an L-shaped form. I started by illustrating the contour function (horizontal, orange) and adding a line (vertical, black). ...
Tom's user avatar
  • 299
2 votes
1 answer
104 views

Find the Intersection Point of Two Complex Functions Using Complex3DPlot

I want to find the intersection point using ComplexPlot3D. I have a function call it $f(\lambda,k)$ ($k$ is fixed) such that at two particular values of $\lambda_{1,...
ZHENGYAO HUANG's user avatar
4 votes
5 answers
399 views

How to indicate table continuation in the middle with torn edge paper effect or something similar

I have a long table that I want to include on a PowerPoint page. I intend to truncate some data in the middle to ensure it fits on one page. How can I achieve this while indicating that the table ...
internet's user avatar
  • 805

1
2 3 4 5
76