Stack Exchange Network

Stack Exchange network consists of 174 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.

0
votes
0answers
25 views

Can you use Options[f] and x_:value at the same time? [duplicate]

I have some pretty long functions with Module inside a package I created that plots stuff, and I need to redefine them. The problem is I dont want to change the ...
0
votes
0answers
58 views

Find the maximum of a function involved with Floor function

My function is $$ f(H,p) = \left\lfloor \dfrac{\lfloor H/p\rfloor + 3 - \sqrt{(\lfloor H/p\rfloor + 1)^2 - 4H}}{2} \right\rfloor $$ The constraints are $ H \geq p(4p-1) $, $ p $ is prime although ...
0
votes
0answers
54 views

Plot `k/2Pi` instead `k`

I have a function ω[k]: ...
0
votes
1answer
81 views

How to define a function only for integers

I want to create a function which only accepts integers. if a value other than integers are given it should output zero. This is what I've tried so far. I'm trying to do some discrete time signal ...
0
votes
0answers
35 views

Conducting mathematical operations without specifying functions

How should I define my functions without entering their exact expression so as to compute operations like differentiation on them? Say I have a function $f(t,x)$, which I don't want to specify. Now I ...
1
vote
2answers
54 views

How to output the level of the contour plot based on the desired area enclosed in the contour level?

I am a beginner using Mathematica. I am doing a physics experiment that involves this 3D surface; the function $ f(x, y) $. I need a program that can give me the contour level in the $ z $-axis which ...
0
votes
2answers
29 views

How to plot 3D discontinuous iterative plot?

I am having troubles with plotting this set of data triples={{0, 1, 1}, {9/50, 4/5, 1}}, {{9/50, 4/5, 1}, {3/8, 4/5, 1}}, {{3/8, 58333/100000, 1}, {3/4, 16667/100000, 1}}, {{3/4, 0, 1}, {1, 0, ...
4
votes
5answers
199 views

How to convert list of digits to number? [on hold]

I have a list such as: a = {1, 2, 4, 3}; and I want to get the 'number' of the list. For this example, I want to get this number: ...
0
votes
0answers
42 views

How to calculate the order of magnitude of a list? [closed]

I have a large list, such as {1,2,2,21,1,2,1,2,1,...}. I want to know how can I get the number of the element of the list? Here is one of my attempts:(to caculate the digit number of 100!) a=...
1
vote
2answers
63 views

Define a partial derivative of a composite function

I would like to define the function $ \dfrac{\partial}{\partial y}\left(\dfrac{f(x,y)}{g(x,y)}\right)$, for example ...
-2
votes
1answer
61 views

What is wrong with my code? [closed]

What is wrong with my code below ...
0
votes
2answers
37 views

how to get coordinates from a plot of piecewise function?

I am having troubles with finding points from a plot. I have a piecewise linear function given by following inequalities. These inequalities I got from previous calculations where I split two ...
0
votes
1answer
49 views

How to introduce a NSolve into a ContourPlot?

I have an equation that I want to solve, and I'm using DensityPlot, as I was told here NSolve two unknowns $ r, x $ in order to have a curve $ r(x) $ . Meaning I have a relation $f(r,x)=0$, and with ...
0
votes
3answers
44 views

NSolve two unknowns $ r, x $ in order to have a curve $ r(x) $

I'm trying to solve : NSolve[3 r Sqrt[x/(1 - x)] + 1/2 r^3 (x/(1 - x))^(3/2) - ( 3 r x Csch[r Sqrt[x/(1 - x)]])/(1 - x) == 0, {x, 0.5, 1}, {r, 0, 5}] My goal ...
1
vote
1answer
34 views

Plotting a complicated function defined in terms of other defined quantities

Perhaps this question will be too broad or poorly asked since it is about some very simple problems and I apologize if that is the case. So, I'm just trying to plot the curve of a complicated and ...
1
vote
0answers
33 views

HypExp and HPL packages for hypergeometric functions: Evaluating a function HPL[{minus,plus},x]?

I am currently using the HypExp and HPL packages, which are useful for expanding hypergeometric functions in series around integer or half-integer values, as in common in dimensional regularization ...
0
votes
1answer
41 views

printing values of y for a range of x for an implicit function f(x,y)

I want to print the values of y for a range of x for an implicit function f(x,y). My equation is f(x,y)=x^2+y^2+2. The range of x is (2,10). I want the corresponding values of y.
1
vote
1answer
26 views

The composition of the logit function and its inverse is not numerically invariant to decimal places

I've defined the two following functions: logit[x_] := Module[{}, Log[x/(1 - x)] ]; invLogit[x_] := Module[{}, E^x/(1 + E^x) ]; One is the inverse of ...
1
vote
1answer
41 views

How can I know the value of parameters?

In the the attached image I plot two function for the parameter $a1, a2, a4$. I take $a2$ as particular value, $a1$ as discrete set and $a4$ continuous value. In the plot how can i recognize for which ...
0
votes
0answers
71 views

Native function in Mathematica export functions from Mathematica to MATLAB

Is there any native function in Mathematica (not ToMatlab) that I can export a function from Mathematica to MATLAB, to Paraview or to any plotting software? Clarification: I want to export something ...
1
vote
0answers
17 views

Attempting to create a toolbar with notebook tabs, unable to properly integrate functions

I recently learned that all the default Mathematica palettes were actually created in mathematica, and i have been trying to make something similar myself. And since learning that the DockedCell ...
0
votes
0answers
25 views

Create a color function from dynamic panel

I would like to generate a color function from the dynamic panel code and use it as I want...instead of using Copy to Clip Board and then past in myTM.... Any idea ?...
1
vote
1answer
31 views

Multinomial must receive a machine size number

I need to use the multinomial distribution. In a certain step, by coincidence, the input probability vector is ...
3
votes
3answers
136 views

Rank Transformation of an Array

Is there a built in function which rank transforms an array of data? By rank transformation I mean data = {2.4,5,1,6,7,10,2} Rank[data]={3,4,1,5,6,7,2} where ...
0
votes
1answer
21 views

Function that takes derivative of another function (with any number of arguments) and evaluates it

I would like to supply a function as an argument to another function which then differentiates the function and evaluates it at a set of points. Suppose I want to differentiate this function, ...
0
votes
1answer
29 views

Making a List For Use in an Integral

I have an equation of the form $R_{min}+t= R_{min}\, e^{R_{min}}$ where for every time $t$ there is a corresponding position $R_{min}$. How can I complete the integral $F(t)=\int_{R_{min}(t)}^{r(...
2
votes
0answers
32 views

How to modify a global large array in a function [duplicate]

Assuming variable x is a long list, which needs 1GB memory to store. I want to modify x in a function, such as let x[[10]]=1, using ...
0
votes
2answers
77 views

How to compute the density of a Inverse Wishart Distribution?

How does one compute the density of the inverse of a Wishart distribution in mathematica? The MultivariateStatistics package only has the Wishart density, and not the inverse Wishart... Any help ...
2
votes
1answer
69 views

Loading MultivariateStatistics` changes colour of some multivariate distributions to red in notebook. Should I be worried?

I need to use the pdf of a Wishart distribution which is only defined in the package MultivariateStatistics`. However, after loading the package, some or all of the ...
1
vote
0answers
33 views

Is there an in-built function for the multivariate gamma distribution?

The Multivariate Gamma Distribution <- Wikipedia link with a description of the function. Is there an in-built function for the multivariate gamma distribution? I found out that there used to ...
0
votes
0answers
16 views

Trouble restricting function images

I am following this book https://www.amazon.com/exec/obidos/ASIN/1558606378/ref=nosim/ericstreasuretro with mathematica and I'm having some trouble on my way: 1) Consider the function ...
1
vote
1answer
47 views

Computing the PDF of a WishartMatrixDistribution. Is this a limitation in the PDF Mathematica function?

I'm trying to compute the pdf of a wishart distribution. Why does PDF[WishartMatrixDistribution[10, IdentityMatrix[4]], 2*IdentityMatrix[4]] not return a ...
0
votes
0answers
41 views

DSolve inverse function

I trying to solve a differential equation DSolve[{D[r[a], a] == 3 r[a]/a (w - (g *(1 + w)*(1 + r[a]))/(1 + g*r[a])),r[1] == r0}, r, a] But the solution is a ...
1
vote
0answers
34 views

Series doesn't seem to work on functions

When you try to use the Multivariable option of Series, it doesn't work as intended, since it keeps terms of higher order than intended. Example: Expand a two-variable gaussian exponential to second ...
0
votes
3answers
26 views

Low precision from function returning matrix

Got a function depending on single parameter "t" defined below which returns a 2 by 2 matrix ...
2
votes
2answers
46 views

Substituting main diagonal elements when a condition is satisfied

I'm trying to substitute the main diagonal elements when their value is less or equal to zero. I've tried the following: ...
2
votes
2answers
65 views

Problem with the Derivative Operator (')

I was working through some physics equations and came to a dead stop when I couldn't get the Derivative operator to work on equations with 2 variables. An example I ...
0
votes
2answers
42 views

Create and manipulate list with variable length?

Is there a way to create and manipulate a function of a sum of arbitrary length? Specifically, I'd like to create a function like the following: ...
1
vote
0answers
45 views

Changing parameter in a _Mathematica_-defined function

I would like to use EllipticTheta with the sum running on the integers with a specific step. Is there a way to do that? To be more precise, I am trying to expand the following function $$\Theta_{\...
1
vote
2answers
46 views

solving an equation for two lists of values sequentially

I'm very new to this. My goal is to run a function for 10 different pairs of values. The function looks like this: ...
0
votes
0answers
34 views

Removing numerical instability in plots of functions over large domains

suppose you have a large domain you wish to plot a function over, which depends on numerical values usually around or above you machine precision e.g. ...
6
votes
2answers
142 views

Remembering Previously Evaluated Function Values with Optional Argument

I am trying to implement a "Function That Remembers Values It Has Found" (name adjusted from the similarly named Mathematica guide (clicky here)). I have an optional argument and I believe that is ...
1
vote
1answer
60 views

Domain and codomain of a function

I am wondering if it is possible to get domain and codomain of a function in Mathematica (by using only built-in functions if possible). For example, I would like to give as input the function $tan(x)$...
3
votes
1answer
29 views

How to evaluate limit of a user-defined function

Limit[(k/(k - 1)), k -> Infinity] Gives correctly: 1 But, ...
0
votes
0answers
34 views
1
vote
2answers
45 views

Switch applying tests to forms

Is it correct that the Select equivalent of Cases is missing for Switch? I mean a function <...
0
votes
1answer
46 views

ListPlot with gradient

I have a dataset in which each element is a list of 3 numbers eg. data={{0,0,0},{1,2,0.7},{3,4,2.3},{3,4,3.3}} I'd like to make a 2 dimensional plot in this way: ...
0
votes
1answer
47 views

Using Piecewise to plot a defined function [closed]

I'm trying to Plot this function: Between the interval -0.2 < t < 0.1 but it doesn't work. All i get is a blank graph between my intervals. If you could help me out I'd greatly appreciate it. ...
2
votes
1answer
47 views

Using the value of the variable in the definition of the function [closed]

How do I take the current value of n in the second line in order for the answers to be the same in both cases? ...
0
votes
2answers
54 views

A list of operators in the For cycle

I'm pretty sure that analogous questions have been asked here a zillion of times, but... I think it is pretty straightforward from the code what I expect it to give: ...