Skip to main content

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
20 views

Using NetMeasurements for basic neural network

I have a neural network that works fine, but I would like to obtain some results on the Validation Set which provides some metrics on the performance of the training. I am obtaining some strange ...
John Doe's user avatar
  • 229
1 vote
0 answers
49 views

Quitting and reloading another function

I want to write a one-line command which will quit the current session (with all the loaded packages etc) and reload another package. But when I try ...
Tanmoy Pati's user avatar
0 votes
0 answers
43 views

Function becomes jagged when being multiplied with a very small prefactor

When I try to scale down a sigmoidal function by multiplying it with a very small value, the function seems to lose its precision, as the curve in the plot becomes jagged lines. The code of the ...
Johnson's user avatar
  • 357
0 votes
0 answers
22 views

Function's maximum argument number while compiling [closed]

Dear Mathematica users, As experts know while compiling, ...
Kazim Ahmet Hasim's user avatar
2 votes
1 answer
180 views

How to explain a formula from a generalized hypergeometric function

I am asking about the formula 07.27.03.0003.01 found here https://functions.wolfram.com/PDF/Hypergeometric3F2.pdf, specifically the second formula on page 2 of the PDF file of the link above. What is ...
alpha0 beta0's user avatar
3 votes
1 answer
56 views

Function with complicated argument constraint with default value

I need to define a function, say f with an argument which is integer, positive and with a default value say 2. I tried: ...
Giovanni Russo's user avatar
2 votes
2 answers
66 views

How to retrieve the index of a subset in Subsets[list,nspec,{s}]?

Subsets[Range[2000], {4}, {n}] would give the $s^{th}$ subset of the Subsets[Range[2000], {4}]. For example, ...
internet's user avatar
  • 793
0 votes
0 answers
26 views

Using absolute values as initial conditions

I have a system of equations I want to solve using NDSolve, which is ...
Jules Alvarez's user avatar
5 votes
1 answer
102 views

How to insert a graphics between two points?

How can I insert the resistor between points {1,1} and {2,1} without modifying res (zoom is ...
internet's user avatar
  • 793
-5 votes
1 answer
139 views

How to find the value of $f(2023) + f(2024)$? [closed]

Given that the function $f(x)$ has a domain of $\mathbb{R}$ and for any $x, y \in \mathbb{R}$, the equation $f(x - y) \cdot f(x + y) = (f(x) - f(y)) \cdot (f(x) + f(y))$ always holds true. Moreover, ...
csn899's user avatar
  • 4,315
1 vote
1 answer
113 views

Problems with ArcTan making a jump [closed]

I have a function let's call $f(j,h)$ that gives me two points in $\mathbb{R}$ depending on $(j,h)$ and then of these two points in the plane $\mathbb{R}^2$ I want to find the angle given by the two ...
Someone's user avatar
  • 185
1 vote
0 answers
36 views

How can I make length and width of this edge label scale with the graph? [duplicate]

How can I make length and width of this edge label scale with the graph? ...
internet's user avatar
  • 793
0 votes
2 answers
89 views

Is it possible to have ToString operate on an expression containing Prefix (@) ? for example exp = [email protected]

ToString[exp] results in the string form of the evaluated form of exp when exp contains Prefix (@), such as when exp is an email address. How can such an expression be converted to a string?
user96574's user avatar
-2 votes
1 answer
243 views

How to use /; The way to solve this problem? [duplicate]

How to find the cumulative value through the abstract function analytic expression? Previous post was the same question but not using /; The way to solve the problem. So I re-opened a post looking to ...
csn899's user avatar
  • 4,315
2 votes
2 answers
94 views

Can Mathematica compute the maximum as a function of parameters?

I have the following function: $\frac{s}{e^2}(e - s)^\alpha$ Where $e \in (0, 1)$ and $s \in (0, e)$. I want to maximize this function with respect to $e$ and $s$. Obviously the maximum value will ...
Ayush's user avatar
  • 21
0 votes
0 answers
57 views

Return[] in Recursive Functions [duplicate]

Here is the pseudocode I am using to demonstrate the problem. ...
CuriousQ's user avatar
-3 votes
1 answer
194 views

How to find the cumulative value through the abstract function analytic expression?

...
csn899's user avatar
  • 4,315
3 votes
0 answers
42 views

How can I access subsets in manageable chunks?

I have a large subset (as an example). subset = Subsets[Range[8000], {2}] I cannot evaluate this as I don't have enough space. So the question is how can I access ...
internet's user avatar
  • 793
2 votes
1 answer
58 views

Why does this FirstPosition not work? [closed]

Why does this return {0} which is incorrect? I understand that I can use the pattern StringQ but I want to use not a number here. ...
internet's user avatar
  • 793
4 votes
1 answer
118 views

How do I extract the domain values associated with a ColorDataFunction?

I want to extract the Domain values of 380 and 750 from the following ColorDataFunction: I'm missing something on the language-level—they don't seem to be Attributes, neither do they seem to be ...
Andrew Cheong's user avatar
0 votes
2 answers
158 views

Is there a better method and more efficient way to determine the type of triangle based on the coordinates of its three vertices?

...
csn899's user avatar
  • 4,315
4 votes
4 answers
247 views

How to combine multiple pure conditions with an AND operator?

I have a list of Pure conditions {con1[#]&,con2[#]&,con3[#]&} and want to combine them in one Pure Function ...
dnml101152's user avatar
0 votes
0 answers
42 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
2 votes
1 answer
44 views

Laplace Transform and Different Results [closed]

I have the following piecewise function and I take the Laplace Transform ...
Moo's user avatar
  • 3,334
0 votes
1 answer
52 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
  • 111
1 vote
1 answer
40 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
38 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
71 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
  • 195
5 votes
2 answers
120 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,155
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
2 votes
1 answer
66 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
  • 793
2 votes
1 answer
42 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
322 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
61 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
221 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
236 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
71 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
405 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
77 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,253
1 vote
0 answers
50 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
  • 229
0 votes
0 answers
52 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
119 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,491

1
2 3 4 5
76