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

learn more… | top users | synonyms

3
votes
1answer
177 views

Put random points into a specific 2D subregion

I want to cover a particular subregion of the x-y plane with a random distribution. As this particular region is not a circle I encounter some problems declaring the permitted zone where to put ...
3
votes
3answers
208 views

Finding a better way to define a matrix

I first defined a 171x171 matrix containing only zeros and then replaced 18 specific rows with nonzero entries. The other $153$ rows will be average of $2$ of the existing $18$ rows. Rows $2$ ...
17
votes
4answers
527 views

Accessing list elements by name

First, a bit of a long introduction to my problem: I only have a few weeks of Mathematica experience. I am creating a mathematica application that calculates some material properties of steel based ...
1
vote
2answers
113 views

Given an equation with one parameter, how do I use NSolve to solve it for many values of the parameter?

I was wondering if there was a way to use the Mathematica NSolve command to solve an equation that has a parameter with various values. An example of which is: ...
1
vote
3answers
173 views

How to update a list in a function in each iteration

There is a list with numbers 1 to 8 ( p1 ) and another list (j) which contains 4 numbers which shows different 4 positions of ...
0
votes
1answer
68 views
2
votes
1answer
84 views

Problems with BSplineFunction vs. BSplineSurface

Why are those surfaces different? ...
-1
votes
1answer
89 views

Transformation of a simple logic statement

I'm designing a logic circuit and I was wondering if the following two things are equivalent: (x <= y) and (x < (y + 1)) I can't think of any set of numbers that would make these two things ...
0
votes
0answers
57 views

For loop efficiency [duplicate]

What is a more efficient way of solving this problem? By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms. ...
10
votes
5answers
325 views

Transform a list of functions to a composition

How do I apply a list of functions in a nested way? Example: functionList = {f1,f2,f3} RequiredCommand[functionList,Pi] such that the required command returns ...
0
votes
1answer
47 views

How to put some values from a list into a function in a Do loop

I want to program a code in MATHEMATICA in order to calculate some values in different iteration. For example, assume this list: list={1,2,3,4,5} Now assume that ...
1
vote
2answers
76 views

Avoid making repeated Random Integer in different iterations

Assume following code : Do[ i1 = RandomInteger[{1, 5}]; i2 = RandomInteger[{1, 5}]; While[i1 == i2, i2 = RandomInteger[{1, 5}]] , {k, 1, 4}];` This ...
6
votes
1answer
228 views
25
votes
5answers
1k views

Are there “All” and “Any” functions in Mathematica?

In Python, there is a function all which returns true if all of its arguments are true, and any which returns true if at least ...
1
vote
2answers
128 views

How to evaluate Modules in a notebook from another notebook?

I would like to create a notebook populated with several modules and be able to evaluate these modules by running a separate notebook. I have attempted several uses of the ...
1
vote
2answers
152 views

Plot a function which depends on itself

How can I plot a stepwise function like f[a, t] = 10 Exp[-0.1 Sin[t]] for a > t and ...
3
votes
2answers
194 views

DynamicModule/Dynamic CheckboxBar Slow for Large Lists

I am trying to create a dynamic construct that takes a large list of expressions and allows the user to interactively select any number of entries for further manipulation. This is what I have ...
0
votes
1answer
79 views

Normalize equation in NDSolve?

I have numerically solved and plotted the solution to the Mathieu equation using NDSolve successfully, as below: ...
4
votes
0answers
55 views

FlipView can't handle CurrentValue[“MouseOver”]. Kernel crash

Is this code crashing your Mathematica session? (it can so look out :P) ...
0
votes
0answers
37 views

Panel size undesired behaviour

This is next question from the series: better avoid Panel if you care about details. previous about FrameMargins In the ...
0
votes
0answers
57 views

Passing optional parameters to functions

Assume I want to write a function which has to have an argument structure like myFunction[variable_,parameters_] for compatibility reasons. Where parameters ...
0
votes
1answer
83 views

Populating an array with outputs of a function [closed]

I have searched, but didn't find much help on my issue. I have an optical physics problem that I'm working on .. ...
0
votes
1answer
93 views

Evaluate integral of a series

I want to evaluate this integral, but it won't work. Does anyone knows why? ...
0
votes
0answers
123 views

Intersection of any triangle with a circle in Cartesian coordinates

I started a notebook dealing with metrics in a triangle and its intersection points by a circle. Up to know I reached the point of having plotted a triangle, a circle with an arbitrary centre and I ...
3
votes
0answers
103 views

“Off-label use” of Mathematica functions for performance

Assisting an acquaintance with a simulation where a very large number of binomial probability calculations are required, I pointed them to a slightly obscure function to dramatically speed up their ...
4
votes
4answers
807 views

“do … while” loop equivalent in Mathematica [closed]

Have I missed something or is there no built-in which mimics the behaviour of do ... while loop? I am looking for a construct that evaluates procedure once and ...
1
vote
2answers
108 views

How to work with lists of functions

I have some lists of interpolated functions and I want to know if there is an easy way to operate with them. A simplified example: ...
0
votes
1answer
75 views

mathematica apply list of functions to the same arguments [closed]

How can I apply list of functions to the same arguments? e.g. ApplyFun[{fun1,fun2,fun3},{arg1,arg2}] I looked here and could not find: ...
0
votes
1answer
85 views

Working with functions

I am required to write a function that takes a function as a parameter. ...
1
vote
0answers
36 views

How to apply an rule to factors matching a certain form

Suppose we have many expressions involving irrational ArcTan expressions (such as ArcTan[Sqrt[3],5]) along with other irrational factors (such as ...
3
votes
1answer
75 views

How to apply RootLocusPlot corectly

I have to analyze the complex regions of variable c which is define obtained with InverseLaplace help in the form ...
0
votes
2answers
158 views

How can I improve Do loop?

I have very large input of time series data (over 30000 observations) that look like as follows: ...
0
votes
1answer
60 views

How to define a function that operate with a base case recursively? [duplicate]

Let's start from the simplest case: say I have a function $f(x)=x$, and let's say I want to define a new function (of $x$) to be its $n$-th power $(f(x))^n$. How should I write the code? I tried: ...
3
votes
2answers
231 views

Differential operator squared

I defined a one-dimensional momentum operator $\hat{p}=-i\hbar\frac{\partial}{\partial{x}}$ in Mathematica p = -I * h * D[#, x]& and I want to get the ...
2
votes
0answers
71 views

Are there some other ways to solve a second PDE except DSolve?

I have a partial differential equation as follows: $$\frac{\partial p(x,t)}{\partial t}=\text{Dp} \frac{\partial ^2p(x,t)}{\partial x^2}-\frac{p(x,t)-\text{p0}}{\tau }$$ What I try to do was to get ...
0
votes
0answers
99 views
3
votes
1answer
120 views

Arguments for ChartElementFunction

I was reading the documentation for BubbleChart and I saw this example ...
0
votes
3answers
91 views

How to combine multiple functions into a single function, indexed bya new argument

I have a system of expressions (matrices) which correspond to increasing orders of precision in a theory. These expressions are quite complex (require about 40+ lines of code to produce) and are not ...
1
vote
0answers
126 views

Slow mixture fitting when having ill-conditioned covariance matrices. How to make it faster?

I'm using Mathematica 9.0 to fit multidimensional observations with a gaussian mixture. To do so I first adapted these steps to ensure that the mixture parameters are well defined (see ...
5
votes
2answers
363 views

Multiply each element of an array by another array?

I would like to multiply an array by each element of another array, and am having a lot of trouble finding a built-in or automated method of doing. Here is an example of what I'd like to achieve: ...
1
vote
2answers
72 views

Using Array Elements as Function Arguments

Suppose I have an array p = {a,b,c,d} and a function f that takes a variable number of arguments. I want to evaluate ...
0
votes
1answer
68 views

Can I make a function which depends on several arguments which are not independent?

Here's a simple example Suppose have the permanent relation that z is proportional to xy^2, for real numbers s. z = s x y^2 Now, we are interested in ...
0
votes
0answers
28 views

Problem with slot in If statement [duplicate]

I am struggling with slots, In this case I have a function int which gives either true or false. When it gives true, I want ...
1
vote
1answer
169 views

Interpolation of a table with 4 parameters

I have a huge data file which I need to do some analysis on it. The file is built in this way that for each 4 variables, there is a value of the function: ...
8
votes
1answer
161 views

Why does Plot[Hold[x], {x,0,1}] work?

It appears that, counter to my expectation, all of these (and probably many others) seem to work fine: ...
2
votes
2answers
260 views

How to plot several functions without jumping? (multiple eigenvalues of a system as functions of 2 parameters)

I've been working on this research problem for months with some success by no global/proper solution to the problem. So I have square, Hermitian matrices of various sizes ($8,20,38$ dimensions) with ...
2
votes
0answers
97 views

How is Wolfram Language different than regular Mathematica? [duplicate]

From all I can see there seems to be no difference between "Wolfram Language" and regular Mathematica. Is Wolfram just a marketing rebranding of Mathematica or is there a new capability I am missing?
11
votes
1answer
304 views

Better Autocompelete for the Front-End

I wonder if it is possible to improve the front-end's autocomplete capability. Compared with some other more sophisticated editors/IDEs, such as eclipse, Mathematica's front-end does not provide a ...
6
votes
4answers
246 views

Using an ellipse as a threshold for Nearest function

The Nearest function can receive as a threshold parameter a radius to look for elements inside that. From the documentation: ...
0
votes
1answer
60 views