For questions on writing functions (pure or using Set/SetDelayed) for any purpose, including the features that may be incorporated in those functions, such as options, patterns and conditions.

learn more… | top users | synonyms

6
votes
0answers
62 views

Plotting a defined function gives different results from plotting the function directly.

Consider the following piece of code: function[t_]:=Exp[-9 t^2]; LogLogPlot[{function[t],Exp[-9 t^2]},{t,.01,100}] I expect the two plots to exactly overlap each ...
6
votes
0answers
90 views

Is there a function to generate a minimal clique cover?

This is a graph problem known as the "Clique Edge Cover" or "Intersection Number" problem, and the goal is to find, from a given graph like $E=\{\{a,b\},\{a,c\},\{b,c\},\{b,d\},\{c,d\}\}$ and ...
2
votes
0answers
93 views

correct usage of ParallelTable

I am trying to parallelize my script. Here is a MWE of how I have done it: ...
2
votes
0answers
68 views
2
votes
0answers
80 views

How can this function's options be used in different places?

I wrote this function to make a ListPlot where the points are colored by a third argument. ...
2
votes
0answers
239 views

Generating a function which outputs possible chemical reactions

I want to make a list of chemical reactions and I write them down in a $\require{mhchem}\LaTeX$ format. They are of the following form $$NA_n^i+MB_m^j \rightarrow \hat NA_{\hat n}^{\hat i}+\hat ...
1
vote
0answers
96 views

Positive integrand giving negative answer

I'm integrating a positive function f(t) times sin(t) from 0 to pi/5 and get -38. Actually f is slightly negative for a short time (smallest value ~ -0.0005), but far from enough to explain this. ...
1
vote
0answers
110 views

How do I use Wolfram Alpha to build a poker hand comparator in Mathematica?

I know there is algorithms out there to compare two given poker hands. I'm not trying to implement one from ground up. I'm trying to come up with a way that uses an existing method through Wolfram ...
1
vote
0answers
68 views

How can I compile function with Apply?

For example, I tried to compile this function but Mathematica gives "The only function arguments supported are Times, Plus, or List", I have no a way to compile this. ...
1
vote
0answers
85 views

How can I obtain the function described by given set of central moments?

I want to investigate how my function P behaves with different probability functions rho as input variables. This means ...
1
vote
0answers
129 views

Return Functions from parallel execution of module

I wrote a module which numerically solves an ODE using NDSolve. The result from this is e.g. either ...
0
votes
0answers
47 views

creating some smooth density functions

I would like to create some density functions based on some distance measure $D$. As a base density function lets say I have a Gaussian density $f$ with mean $-1$ and variance $1$. I would like to ...
0
votes
0answers
68 views

Issue with Coefficient command

I'm trying to used the Coefficient command to extract the numerical values in front of a Chebyshev polynomial. I know that there is a numerical way to do this, presented in numerical recipes, which I ...
0
votes
0answers
44 views

How to insert a function into OptionsPattern?

I’ve written a function TableauForm to draw a standard Young Tableau. This problem is related to this one, however, the difficulty is that, a function has to be applied to the list in my case. This ...
0
votes
0answers
70 views

Finding coefficients that make certain functional expression vanishing

My problem is to find a procedure that gives coefficients which make certain functional expression vanishing. For example if I have a polynomial $P(x)$ of one variable $x$ given by $P(x)=a_0+a_1 ...

15 30 50 per page