As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [functions]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
85 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}{...
Mam Mam's user avatar
  • 1,393
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 ...
codebpr's user avatar
  • 713
3 votes
3 answers
134 views

Slope-demarcated PlotStyle implementation (II)

...
user84456's user avatar
  • 1,262
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(...
user84456's user avatar
  • 1,262
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 ...
Martha97's user avatar
  • 327
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!!
Iра Сотник's user avatar
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: ...
Q.Ask's user avatar
  • 15
2 votes
1 answer
65 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 ...
Matthew Neil's user avatar
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: ...
aku jack's user avatar
0 votes
1 answer
113 views

Can Mathematica estimate this complex function?

Mathematica has given me a function in $x,r$ given by ...
Matthew Neil's user avatar
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, ...
Vicente Sepúlveda Trivelli's user avatar
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 ...
Chris 's user avatar
  • 447
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 ...
Cheng Tao's user avatar
  • 151
1 vote
3 answers
136 views

How to check whether a function parameter is another function?

How can I check if a function parameter is another function defined with := f[n_] := n^2+1 g[fun_, n_] := fun[n] g[f, 3]
Giovanni Russo's user avatar
4 votes
0 answers
35 views

Efficiently threading with a default value for missing parts / defining custom behavior for addition of expressions with a given head

In short, I would like to be able to "add" expressions with a particular head (call it h for our purposes) which will always appear with a sequence of (...
max's user avatar
  • 61
0 votes
0 answers
54 views

Mathematica gives the wrong answer if I define a variable "too late"

I have the functions ...
Matthew Neil's user avatar
2 votes
2 answers
143 views

Extract data coordinates from a line list plot

I used the below simple data (including 10 x-y data) and function ListLinePlot to draw a figure. The figure is this: Now I want to export a data x-y coordinates list which includes 100 x-y data at ...
Mr.2023's user avatar
  • 127
2 votes
2 answers
228 views

How can I find the nature of a turning point?

I have this function which has 4 turning points: $$f(x)=18m^4 x+42m^3 x^2-54m^2 x^3-42 m x^4+36x^5$$ f(x)==18m^4 x+42m^3 x^2-54m^2 x^3-42 m x^4+36x^5 However, I can'...
Momo Mori's user avatar
1 vote
0 answers
70 views

DeleteCases/ReplaceAll and PatternSequence [closed]

I thought it must be ...
imida k's user avatar
  • 3,859
1 vote
1 answer
56 views

Value given by NIntegrate is double of Integrate function

I am performing a calculation where the result of NIntegrate and Integrate is different. They differ by factor of 2. Can someone tell what is the reason and how to make the NIntegrate value right?, <...
Kazi Abu Rousan's user avatar
2 votes
0 answers
47 views

Mathematica Implementations of Post Quantum Cryptography Algorithms?

Mathematica supports several cryptographic commands like Encrypt, Decrypt and others. This includes support for asymmetric signature ciphers like RSA and Elliptic curves and symmetric ciphers like &...
Moo's user avatar
  • 2,702
5 votes
1 answer
169 views

Validate `Box` grammar, is it possible?

Is it possible to validate grammar related to Box formed expression (RowBox, FractionBox, ......
imida k's user avatar
  • 3,859
1 vote
1 answer
126 views

Solving Laplace equation

I tried to solve the Laplace equation by two different methods, I made two 3D plots, but they didn't look the same. Is anything wrong? what can I do? I tried to use Fourier series at first and some ...
HarrisModel's user avatar
4 votes
1 answer
97 views

Notebook magnification - two independent values

It seems there are two independent, equally influential values those control mathematica notebook magnification. Just like volume bars in a certain media player(program) and volume bar in tray bar(...
imida k's user avatar
  • 3,859
1 vote
1 answer
63 views

Solve equation - Error - Help

I need to find the value of n but I get an error. I used this: ...
Zarabu's user avatar
  • 71
1 vote
1 answer
83 views

FunctionPoles with arbitrary undefined function

Good day everyone. I have very simple question about behaviour of the functions FunctionPoles, FunctionMeromorphic e.t.c. Can these functions work properly with undefined functions? For example when I ...
George's user avatar
  • 25
2 votes
2 answers
127 views

Is it possible to ask Mathematica to find those points $(x,y)$ at which the given function may reach its global/local extrema?

I have this two-variable function $f(x,y)$ for {x,-Pi,Pi} and {y,-Pi,Pi} in which $\{a,b,c\}$ are real parameters (can be ...
MsMath's user avatar
  • 115
1 vote
1 answer
47 views

Understanding Distribute when applied with a user defined function

I would expect this F[x_] := Module[{aux = x}, aux = X]; {a + b + c, e+ f} // Map[Distribute@*F] to yield {3X, 2X} instead, the function is not distributed ...
Albercoc's user avatar
  • 926
0 votes
2 answers
65 views

Generate n tables of values ​for functions

After searching for a long time, I can't find how to do what I need with some bold header style. I need to generate n tables of values ​​for linear functions (f(x)=mx+n), where x varies from -6 to 6, ...
Pamela's user avatar
  • 3
1 vote
1 answer
85 views

How to express the argument through the function?

I would like to express argument $d$ through $f$ and $B$ and to get $d(f,B)$ $$f(d,B)=B\left(\left(\frac{1}{4}-\frac{d}{B}\right)\left( 1-\left(1- e^{-30d/B} \right)^8\right)+\frac{2/B}{3+1/B^2}\left(...
Mam Mam's user avatar
  • 1,393
0 votes
1 answer
53 views

Can someone please explain where I am going wrong in the given argument? Is it obvious that $f(m,s)>0$?

I have a two-variable function $f(m,s)$ for real $m>0$ and $s>0$, and as the first picture shows, it seems that it is always positive; on the other hand, I can easily find the minimum of $f(m,s)$...
Martha97's user avatar
  • 327
0 votes
1 answer
36 views

How to draw a function image within multiple interval definition domains? [duplicate]

Plot[x^3, {x, -1, 3 || 7, 10}] Note that the intervals of the function are separated. There are two intervals, (- 1,3) and (7,10)
csn899's user avatar
  • 1,581
0 votes
1 answer
44 views

How to find the value range of a function with multiple intervals in the definition domain?

FunctionRange[(2 Sqrt[3] (k^2 + 1))/( 3 k^2 - 1), {k, k > 1/Sqrt[3], k < -1/Sqrt[3]}, y] The above function argument has two interval ranges k > 1/Sqrt[...
csn899's user avatar
  • 1,581
0 votes
1 answer
136 views

Finding a suitable form factor for a given set of conditions

I have the following Mathematica code: ...
codebpr's user avatar
  • 713
2 votes
2 answers
195 views

Sorting a List Based on a Given Order

Suppose I have the following input: input={{1, 2, 3}, {-2, 4, 6}, {-1, 3, 6}} How can I sort it according to this list: ...
emnha's user avatar
  • 2,293
3 votes
1 answer
205 views

Test whether an expression contains a particular pattern

How to test whether an expression contains a particular pattern ? I made a function for myself that tests whether an expression contains Plus or not. ...
imida k's user avatar
  • 3,859
15 votes
2 answers
1k views

Can we explain why using `Nothing` twice on a list does not operate twice?

Below I generate a list of numbers between 1 and 15. I then set the value at position 10 to Nothing and as expected the value at position 10 is changed. This is as ...
Hugh's user avatar
  • 15.7k
2 votes
1 answer
110 views

Is it possible to obtain the symbolic expression for the maximum value of a function?

Is it possible to obtain the symbolic expression for the maximum value of out as a function of A,...
emnha's user avatar
  • 2,293
3 votes
1 answer
89 views

Can I efficiently use a compiled function as an input to another compiled function?

I have a compiled function(such as $f\left(z,c\right)=z^2+c$) which will get replaced by different equations as the code runs. I'm using this compiled function(#1) inside another compiled function(#2)....
Laff70's user avatar
  • 171
0 votes
1 answer
34 views

Properly defining functions after they have been used in expressions [closed]

I am having trouble with how functions behave when defined, after they have been used in an expression. More specifically, I start with an expression of the form: ...
Vasil Avramov's user avatar
2 votes
1 answer
49 views

How to modify the argument of a specific function below?

I would like to change the values of a and b in the following function: ...
TobiR's user avatar
  • 232
0 votes
1 answer
65 views

Is there any hope to compute analytically $y=f(x)$ for which $g(x,y)=0$?

I have a two-variable function $g(x,y)$ with $0<x\leq\frac{\pi}2$ and $\frac32<y<5$. I am looking for $y=f(x)$ for which $g(x,y)=0$. Using ContourPlot <...
charmin's user avatar
  • 1,159
0 votes
0 answers
55 views

Functions for translating a vector from one coordinate system to another

I have a vector $\vec{H}$ with components in Cartesian coordinate system $(x,y,z)$: $\vec{H}=(0,0,H)$. I would like to obtain coordinate of this vector in Spherical coordinate system $(r,\theta,\phi)$....
Mam Mam's user avatar
  • 1,393
1 vote
2 answers
83 views

Series from an integral and output as a function

I have a simple question, I am just stuck on syntax. I want to have a series of function $Z(\lambda)=\frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{\infty} d x e^{-\frac{x^2}{2 !}-\frac{\lambda}{4!} x^4}$ ...
Хранитель Рощи's user avatar
3 votes
2 answers
144 views

Precise control of fraction expression

It seems that expression for fraction differs when the number of terms in the numerator is more than 2. ...
imida k's user avatar
  • 3,859
7 votes
1 answer
230 views

How to use Slater Type Orbitals as a basis functions in matrix method correctly?

This question is a continuation of my previous series of questions about basis functions. I would like to find the minimum energy of Coulomb potential motion using matrix method. $H=-\frac{1}{2}\Delta-...
Mam Mam's user avatar
  • 1,393
4 votes
2 answers
81 views

Filtering out function pairs with domains lying on one side of an intersection point

I have a list of pairs of functions that intersect at one point, as shown in the image. I am attempting to remove pairs where the domain of both functions in the pair lie on one side of the ...
hana's user avatar
  • 2,832
3 votes
1 answer
88 views

How to extract the coefficients from a long exponential expression?

I have the given function: ...
Vangsnes's user avatar
  • 561
6 votes
1 answer
133 views

How to keep lines on boundary or inside a region?

This post is related to one of my previous posts. My goal is to keep only the lines that fall on the boundary (2, 8) or inside the region ...
hana's user avatar
  • 2,832
0 votes
0 answers
88 views

Mathematica parses `Log[a,b]` as `Log[b]/Log[a]` automatically, before any rules

I use the following code to realize quaternions (this allows more flexibility than the quaternions package): ...
Anixx's user avatar
  • 3,441

1
2
3 4 5
73