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 about the use of built-in Mathematica functions, including pure functions.

0
votes
0answers
37 views

Representing an interpolating function

I just want to figure out how to "represent" or to inject an interpolating function into a numerical calculation. So, suppose i have an interpolating function $int$ and then i want to use NDSolve or ...
2
votes
1answer
42 views

Creating a bound method (partial function application)

I want to bind arguments to methods (e.g. for use in OOP creating a bound method--what Java just calls a method). I realized this is basically just a partial function application. Now I want to make ...
1
vote
0answers
11 views

Convolve[…] behaves differently to that of Integrate[…] when numerically integrating the result

I am performing a convolution between two functions, and then I want to numerically integrate the result. If I go: ...
0
votes
0answers
50 views

Constructing a user function with an integral

Maybe this is a basic task to perform but I haven't found any literature. I am performing a convolution of two functions: ...
0
votes
1answer
32 views

Are there any built-in functions to calculate CIE color matching functions?

I know there are some functions to work with XYZ color space, e.g. XYZColor, ColorConvert etc.. But I couldn't find any ...
0
votes
2answers
37 views

Problem in dealing with Sign function

Let my function be $f(x)=e^{|x|}$. I wish to find $f''(x)$, this can be done as- $f'(x)=$sgn$(x)e^{|x|}$ $f''(x)=$sgn$(x)^2e^{|x|} =e^{|x|}$ In Mathematica, I am trying to plot $f''(x)$, it ...
2
votes
1answer
68 views

Recall the names of functions used in a long MMA code

Suppose you have a very long code in which many new functions are created. For efficient programming, very short and easily iterated function names are preferred. ...
1
vote
2answers
59 views

Working with complex valued functions

I have a function which has real and imaginary parts and I need to differentiate both parts separately. This is a simpler example of what I have tried, without success: ...
0
votes
1answer
39 views

Relations between Function Variables in Computations

I have the relation λ=c/f, respectively f=c/λ and a simple function n[λ_]:=λ²+1. I'd like to differentiate the function with respect to f, then plot it as a function of λ again. For this, I can define ...
1
vote
1answer
64 views

need help with remembering a name of a function

I have an output cell and want to see the input that led to that output. How do I tell Mathematica to display that input?
1
vote
0answers
36 views

Help Simplifying Expressions

I have the following set of equations: 1) $\text{$b_1$} \cos (\text{$\beta_1$} u)-\text{$b_1$} \cosh (\text{$\beta_1$} u)-\text{$b2$} \cos (\text{$\beta_1$} \theta y)-\text{$d_2$} \cosh (\text{$\...
2
votes
1answer
57 views

How to calculate asymptotic convergence of 2D data

I have the following data: ...
1
vote
1answer
38 views
0
votes
0answers
18 views

Raising a negative number to a fractional power, why the result is different? [duplicate]

In the math theory, we know have $$(x)^{\frac{m}{n}=}\sqrt[n]{x^m} \ ,$$ it means $$(-1.5)^{\frac{1}{0.3}}=(-1.5)^{\frac{10}{3}}=\sqrt[3]{(-1.5)^{10}}=\sqrt[3]{1.5^{10}}\simeq 3.8634 \ .$$ But in ...
1
vote
1answer
34 views

How to define a variable to be a function of all the arguments but one?

I have several variables (coordinates) $x_1, x_2, x_3, x_4, z$ and a lot (21, to be precise) functions $g_i$ which are assumed to depend on $x_1, x_2,x_3, x_4$, but not on $z$. I also have a ...
0
votes
1answer
52 views

Defined function doesn't plot correctly

I have defined a function that produces a single negative impulse spanning -b to -a and a positive impulse spanning ...
0
votes
0answers
24 views

Functional Relationship Between Variables in Plots

I am looking for a way to plot a function of a variable against another variable, whoch is a function of the first variable. If I try, for example, the function $f=v^{10}$ with the variable $v$ <...
3
votes
1answer
57 views

How to create a function that eliminates repeated elements

I want to create a function that eliminates repeated elements from a list without changing the order. For example: ...
0
votes
1answer
48 views

Extracting values from a list

Consider these lists : ...
4
votes
1answer
64 views

MeshRefinementFunction for region gives error

I would like to refine a mesh within a given path/volume, that is specified by the MeshRefinementFunction option given in ToElementMesh[]. For starting i took a simple 3D MeshRegion of a Tetrahedron <...
0
votes
1answer
59 views

Using of functions and lists from other Mathematica files

I have a code in which I have to use some functions and lists and use them in the body of the code. If I want to type all of them in a file in Mathematica, that file becomes very very long. For ...
2
votes
1answer
34 views
1
vote
2answers
75 views

I want to set $x = \{x_1, x_2, \cdots, x_n\}$

I want to get $\{x_1, x_2, \cdots, x_n\}$. I want to use the $x_i$ as a variable. The following code did't work. ...
1
vote
2answers
82 views

For loop not working as expected from a C programmer's perspective [closed]

Why does Print[n] produce output inside a For loop, while Sqrt[n] (as well as many other ...
5
votes
3answers
91 views

Constructing possibilities of a generating function

I want to find all the possible ways that 4 variables can be summed to a given number. Suppose I have the variables $$x=x_0+x_1+x_2+x_3$$ I want to fill $x_0,x_1,x_2$ and $x_3$ such that $x_0$ and $...
2
votes
2answers
53 views

Construct a function like Coefficient

I'am trying to construct a function that will work like Coefficient as an exercise. ...
0
votes
0answers
26 views

How to find ranges of values where specific conditions are true?

I'm trying to get Mathematica to solve a particular inequality in terms of the variables (and constants) of interest to find where the inequality holds as true. Specifically, I have three functions of ...
1
vote
1answer
58 views

Constuct a function that plus equations

I want to construct a function that plus equations. For example: SomaEqns[eq1,eq2,...] == eq1 + eq2 + ... It's possible do that with recursive way? Using less ...
3
votes
1answer
96 views

Functionalize fit

Simple question, suppose I want to fit data and use Fit[data, {x^4, x^3, x^2, x, 1}, x] I want to convert the output of fit into a function I can later use. ...
5
votes
2answers
159 views

Efficiently Evaluate a Multivariable Function on a List of Tuples

I have a function G[x,y,z,r,s,t] in the code below. Quite simply, I want to generate a list of all possible tuples $(x,y,z,r,s,t)$ such that all six entries are ...
6
votes
1answer
73 views

How can I update an association with a function?

I'm not sure if this is a bug, or if I just am not understanding, properly, how to create a function. I am able to use a list of rules to update an association like so: ...
2
votes
1answer
101 views

How to compute many sums or tables efficiently

I have some questions about programming in Mathematica and I would really appreciate it if you could help me. I wish to plot the following function against the variable X, but to do this, first I ...
2
votes
1answer
45 views

Get the name of symbol inside a function [duplicate]

I have a list t1Funcsv0={0.10000000000, 1.00000*10^-7} and I have a function ...
6
votes
0answers
63 views

What is the philosophy behind \[Rule] (a.k.a. `->`) for assigning options?

Today I was banging my head against my desk when I realized that the problem I was experiencing was due to having typed ImageSize[Large] instead of ...
7
votes
2answers
322 views

Evaluate Only Part of a Function

I have a list of functions, each containing none or more of the functions Plus, Times, ...
3
votes
2answers
32 views

How to use an imported table data in a calculation of f[x,y,z], where each row of the column correspond to x,y,z? [duplicate]

I have a table with desired inputs of a given function efvc[n,m,u]. I want to calculate for different values of n, ...
2
votes
1answer
25 views

AssociateTo with a variable as an argument produces error

The following code: list=Table[<\"number"->i|>,{i,1,100}]; list[[20]]["number"] list[[1]] AssociateTo[list[[1]],"number"->101]; list[[1]] Results in....
16
votes
1answer
173 views

How can I view the minimal required arguments of a Wolfram Language function?

This question might be a bit of an overstretch, or really obvious, but I haven't been able to find an answer yet. Is there a way to automatically view the minimum required arguments for a WL function?...
6
votes
2answers
76 views

Simplifying boolean algebra without using certain operations

when I use Simplify or FullSimplify in Mathematica it often simplifies it using all the existing boolean operations. For example,...
2
votes
1answer
44 views

How to manipulate an equation so that it is in terms of a certain variable

For example, I have an equation $$z = \frac{(1+a)}{(1+b)} + 3x + 4y^2$$ I have a new variable where $$R = \frac{(1+a)}{(1+b)}$$ Is there a function or code where I can tell Mathematica to ...
13
votes
2answers
353 views

How to build a list of elements satisfying a certain property without building a list of all elements first?

Is there a way to directly build a list of elements that satisfy a certain property? More precisely, I am looking for a function IncludeIf (this is a placeholder ...
1
vote
3answers
53 views

Prime number counting function

As part of an assignment for a calculus class, I have to write code for the prime number counting function $p(n)$, I have no problem creating the function itself, but for I want it as a function, ...
1
vote
2answers
122 views

Why Mathematica does nothing with the expression Gamma[2 z]? [closed]

Could someone tell me why Mathematica just returns the input with this expression: Gamma[2z] Gamma[2 z] ? I expected this result: $Γ(2z)=\frac{2^{2z-1}Γ(z)Γ(...
7
votes
1answer
129 views

Checking what a function depends on

I'd like to define specific partial derivative operators that change based on if the passed expression is a function of, for example, x vs. ...
3
votes
2answers
113 views

“Re-writing” the function `MemberQ`

I am trying to program the function MemberQ using less then possible functions pre defined by Mathematica. Until this now my code is: ...
0
votes
0answers
45 views

How to create the function `ArrayQ`?

I want to create my own function ArrayQ. For example, I already create the function VectorQ: ...
0
votes
0answers
24 views

How to create my own function `KeyFreeQ`?

I want to create my own function KeyFreeQ. For example, I already create some functions (IntegerQ,EvenQ,OddQ,PrimeQ): ...
1
vote
0answers
54 views

Discrete-to-Continuous Function in Mathematica? [closed]

Inspired by this link on SE Math, I began to wonder if Mathematica has a function that attempts to convert a discrete function into a continuous one?
7
votes
1answer
58 views

Function defined in a package behaves differently from when defined in a notebook

On a Windows system I'm using the Rubi rule-based integration package by Albert Rich which defines function "Int" in addition to Mathematica's Integrate. In my ..\ProgramData\kernel\init.m I have: <...