Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [functions]

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

3
votes
2answers
114 views

Print characters from list with a For-loop

Suppose I have the list primary = {"b","a","e"} I want to get the following output with a For-loop (or While-loop) "b" "a" "e" My code is: ...
2
votes
1answer
85 views

What is FindFormula returning?

I was playing around with FindFormula and am experiencing some odd behavior. I am running MMA 12.0.0.0 on a Windows 10, x86 architecture - if that matters. ...
0
votes
1answer
36 views

How to create a list of undefined functions?

I have a undefined function $\phi[i,j]$ where $i=0,1,...,m$ and $i=0,1,...,n$. How can I generate this list: {$\phi[0,0],\phi[1,0],...,\phi[m,0],\phi[0,1],\phi[1,1],...\phi[m,1],\phi[0,2],...,\phi[m,...
0
votes
0answers
26 views

How to graph a text as a function of some arbitrary parameters?

I'm trying to graph a text in a couple of plots I have. I want to be able to edit the text depending on the values I choose (rho0, zp, zm, temp, ion, and perm) and show them at some point in my plot (...
1
vote
1answer
40 views

InverseFunction never stops running

I have a problem finding the inverse of a function, perhaps I'm missing something.. I'd appreciate it if someone can help me out. First, I calculate an Integral of the form ...
0
votes
0answers
49 views

How to solve “Coordinate should be a triple of numbers”?

Something seems different with duplicated question "How to solve this error? “should be a triple of numbers or a Scaled form.” ", MMA tips may tell that Abs do not ...
0
votes
0answers
38 views

Saving remembered function when closing down notebook [duplicate]

I have functions defined to remember their values f[x_]:=f[x] I would like to be able to close a notebook without losing the computed values, what is the ...
0
votes
0answers
52 views

Why can $ 0.i$ appear? [closed]

I have some function f[x_] which returns NUMBER + 0.i for any x. Is there a reason that Mathematica displays + 0.i summand? How to avoid it without taking Re[]?
2
votes
0answers
28 views

Issue passing a list to last argument of ImplicitRegion (Scope issue?) [duplicate]

This is a very strange issue I'm having trying to pass a list as an argument to Mathematica's "ImplicitRegion" function. Here's the issue: ...
0
votes
0answers
27 views

How to find a domain at which a function is non-zero

Consider some function f[x,y]. Is there any way to find a domain at which it is non-zero? Namely, I would like to compute the integral ...
0
votes
0answers
33 views

Defining a function through an ODE containing unspecified operators

I want to do some algebra using a function only defined through a DE containing unspecified operators. The DE is $$ \partial_zu(z) = \left[\hat{D}+\hat{N}(z,u)\right] u(z). $$ Here $u$ lives in ...
0
votes
1answer
74 views

Part assignment is not a symbol [duplicate]

read some related posts and found no solution. For a list defined like this m = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.9, 1.0, 1.5, 1.6}; when I define this function ...
1
vote
1answer
48 views

Where does Wolfram publish an index of built-in functions on the web? [duplicate]

Where is a online reference for the built-in functions of Mathematica/Wolfram?
0
votes
1answer
47 views

Strange result of MatrixFunction

Let us consider the sum of the matrix series m = 2; n = 3; Sum[MatrixPower[{{1, 2}, {3, 4}}, m + k*n]/(m + n*k)!, {k, 0, Infinity}] {{-(32 E^(-(5/4) - Sqrt[33]/...
2
votes
0answers
90 views

Why was implementation of “Exponent” changed since version 11.3? [closed]

I have a following expression and need an exponent of n Exponent[Exp[Sqrt[n]]*n^2, n] (* 2 *) Exponent[Exp[Sqrt[n]]*n, n] (* 1 *) All versions 7,8,9,10 up ...
0
votes
0answers
47 views

How to exclude some methods?

Can I exclude one or several methods from methods tried by a function? When we use some 'algorithm-intensive' function, we can often specify whether we want to proceed according to the chosen method ...
1
vote
0answers
43 views

Force FindFormula to avoid Piecewise in the result?

Is it possible to provide any arguments to FindFormula to force it to avoid using Piecewise in the result, but instead try to ...
0
votes
1answer
74 views

Arrays, Mapping, and Convolutions

I'm trying to create a function that convolutes a 3D Normal Distribution to the points listed below. However, I think I'm going about it in the wrong way. When I try and convolve it with the points, ...
2
votes
1answer
77 views

Switch Function Is Not Working Properly

I'd like to select between the Tent and Hat function to convolve, but my switch function produces an error. I don't exactly need the initial plots. But I would like to plot the two that I select. <...
0
votes
1answer
47 views

Definition of complex conjugate?

I came across the following way of defining complex conjugate in mathematica [a]: SuperStar[y_] := y /. Complex[u_, v_] -> Complex[u, -v] I am able to ...
2
votes
3answers
68 views

Creating a function that can be used to plot a triangle with an area of 1

The function should take an input x, which is the absolute value of the bounds of the triangle and should be centered at 0. I'd like to use ...
0
votes
1answer
37 views

Finding the negative real root of in set of solutions under a varying constraint

Suppose I have a function and its derivative like: V = x^3.5 - x*y Vx = D[V, x] I first solve V for ...
0
votes
1answer
55 views

How can I protect all possible function names?

It is possible to protect all possible function names? All functions have Attributes, e.g. Attributes[Plus] will give <...
0
votes
0answers
12 views

Operating functions with two arguments? [duplicate]

Let us first consider function with single argument. f1[x_] := x^2 The value of function at any value of $x$, for example, $x=3$ can be evaluated with any of the ...
0
votes
0answers
22 views

Redefining the inbuilt function and its derivative [duplicate]

I want to redefine the DiracDelta functions and its derivatives. I am successful at redefining the DiracDelta function but not ...
0
votes
2answers
108 views

Mathematica puts function with certain constants on hold, why? [closed]

Here, I probably have a trivial case on how to use functions in Mathematica but I can't figure it out with the help of the Mathematica pages. I define the following function: ...
4
votes
4answers
360 views

Applying a function to a nested list

Say I have a list: l = {{{a, b}, c}, d} I now want to apply a function, call it F to that list in a way that I go from the ...
1
vote
1answer
59 views

Plotting $f: x + i\,y \mapsto u + i\, v$ with Plot3D and mapping $v$ to color

Mathematica already has ComplexPlot3D that plots ReIm[x, y] against Abs[f(z)] and ...
0
votes
0answers
53 views

Function for Probability of k Successes, Given Probability Vector [closed]

In an earlier post, @gwr provided the following function for a Poisson Binomial Distribution: ...
1
vote
2answers
49 views

Matrix whose coefficients are functions

What is the right way to declare of matrix whose coefficients are functions of a variable $x$ ? I tried : Table[Table[a[i,j][x_],{j,1,NN}],{i,1,NN}]
1
vote
4answers
125 views

Compute “most-occuring weekdays” function

I am attempting to solve the Most-Occurring Weekdays in a Year challenge to teach myself Mathematica. Specifically, the challenge is: Write a function MostOccurringWeekday that takes an integer ...
0
votes
0answers
43 views

How to handle exceptions and failures in Mathematica?

In python I can write fallback values like: ...
4
votes
3answers
118 views

Find and load all ResourceFunctions as top level functions?

I would like to be able to use ResourceFunction's as top-level symbols: The reason being that some of them are so useful it would be really great not to have to ...
0
votes
1answer
39 views

Function that refuses to return a value

I wanted to know the exact solution to the following differential equation $$ \frac{\mathrm{d}^2 y}{\mathrm{d} t^2} = - \frac{1}{y-1}, \quad \begin{aligned} y(0) &= 0 \\ \left. \frac{\mathrm{d} y}...
0
votes
0answers
52 views

Plot BV functions with singular derivatives in multiple space dimension

In 1-dimensional setting, two key examples of $BV$ functions (of bounded variation) $u: \mathbb R \to \mathbb R$ are the Heaviside function, whose derivative is the Dirac delta concentrated at $0$. It ...
0
votes
0answers
84 views

Is it possible to find the Rössler attractor using only a set of Lyapunov exponents?

Is it possible to use a set of Lyapunov exponents to determine the orbits of the Rössler system? If so, could how would I go about plotting them? EG. Known Unknown
0
votes
1answer
54 views

Returning a string from a piecewise function

I need to define a function that behaves as a piecewise function, but will return a string instead of a value. Part of the function that I have written is provided below. The full function continues ...
0
votes
0answers
23 views

Find a reduce math function with increase param value [migrated]

I have a d value which is a range from 0->5. I want to build a math function with d param so that return a value from 0 to 1. if d increase, function decrease faster. Example f (d = 0) = 1, f (d = 1) =...
3
votes
2answers
65 views

Function to join variable names

I am trying to define a function that takes any two strings (possibly predefined as variables, functions, etc.) and join them in one string (which can also be predefined and will keep its definition ...
0
votes
1answer
26 views

Create a list to Plot from a list returned by Solve

I have a list of 8 items the form: ...
5
votes
1answer
102 views

Which version of Mathematica did DiracDelta become to the derivative of HeavisideTheta from that of UnitStep?

The mathematica's version of my coworkers is 5.0, they use UnitStep to derive formula, However, I also want to use the parallel features so used the latest version ...
0
votes
5answers
79 views

Sum Over Solutions to an Equation

Two Related Questions Is there any general built-in functionality for computing a sum over solutions to an equation? This is common in number theory. For example, computing sums of the following form....
0
votes
1answer
49 views

Recursive Function in Multiple Variables

I can define a recursive function in one variable, e.g. defining the factorial function $f(n)= n!$ using Mathematica. But how do you do this for a function which depends not only on $n$ but on $x$ and ...
1
vote
1answer
43 views

Verifying which 5-strings form valid words

words = getWordsFromPi[200]; For[i = 0, i < Length[words], i++, if[DictionaryWordQ[StringJoin[words[[i]]], Insert[list, words[[i]]]]]] ...
1
vote
0answers
26 views

Finding the positions of minima for a function with algebraic constants

I have a function of several variables: inverse[Qx_, Qy_]:= T - 2 J + 4 J1 Cos[(Qx + Qy)/2 a] Cos[(Qx - Qy)/2 a] - 2 J2 Cos[(Qx - Qy) a] + 2 J3 Cos[(Qx + Qy) a] ...
0
votes
0answers
17 views

Unclear behaviour of Position, lists and functions in general [duplicate]

apologies for the title, but I have such a confusion about my question that I haven't been able to formalise a clear title. My question arise from the "discrepancy" between the results of the ...
0
votes
1answer
35 views

How to plot two functions together when one of them needs to be a series of dots, with common labels and colors?

I have two functions that I want to plot together. I want to plot the non-linear and the linear (NL and L in my code) functions together, but I wish that the NL function is plotted as a series of dots ...
11
votes
2answers
394 views
0
votes
2answers
77 views

Problem with a simple recursive function

f[2 x_] := f[x] f[1] := 3 f[0] := 0 f[2 x_ + 1] := f[x] + f[x + 1] a[x_] := f[x]/f[x + 1] Will this work as an recursive function ? I think there's something ...
0
votes
0answers
56 views

Problem with arc length

...