Questions on writing non-trivial programs in Mathematica. Do not use this tag for questions on plotting/graphics or for questions on doing mathematics with Mathematica, where the focus is more on the math than the program.

learn more… | top users | synonyms

0
votes
0answers
144 views

How minimize a function involving abs $(|\ldots|)$?

I am trying to decide the best way to solve this: Minimise $Y = | K + ax^2 + bxy + cy^2 |$, with decision variables $x$ and $y$ and $a > 0$. I also have a number of convex and affine ...
0
votes
0answers
80 views

Programming a Meijer G related result

I am not that new in Mathematica, but I do not remember I have ever used it for programming (like we may do in Java). I have an important result given here by this integral: $$ \int_0^{+\infty} ...
0
votes
0answers
147 views
0
votes
0answers
82 views

Implementing a back button (in CDF)

I have a rather large notebook, which contains a lot of hyperlinks to different parts of the notebook. Is it possible to make a back button (maybe as a docked cell button?) so that when a reader ...
0
votes
0answers
122 views

Pearl's Message Passing Algorithm

Has anyone tried to implement the Message Passing algorithm using Mathematica's Graph/Combinatorica features?
0
votes
0answers
91 views

Inconsistent results in fits from NArgMin

EDIT: Just realized I had misspelled "inconsistent." I'm using version 7.0. I'm trying to fit a (noisy) data set to a large-order polynomial. (Just for context: there isn't a model for the ...
0
votes
0answers
39 views

Generating partitions of a set with a specified size of the parts [duplicate]

I tried the following (inspired by the answer here) myList = {a, b, c}; Needs["Combinatorica`"]; SetPartitions[myList] and I got this answer, ...
0
votes
0answers
20 views

Conflict among Permutations and Graph utilities once Combinatorica is loaded [duplicate]

I have tried to figure out and solve the problem of compatibility of Permutations and Graph utilities of Mathematica once the Combinatorica Package is loaded, but I failed :(. Could anyone explain me ...
0
votes
1answer
1k views

Loops and subroutines [duplicate]

Possible Duplicate: Alternatives to procedural loops and iterating over lists in Mathematica I am new to Mathematica and not familiar with functional programming. In particular, I have no ...
-1
votes
2answers
260 views

How can I find a function that fits some points? [closed]

I have some points and want to find a function from them. For example, $(-2,4),(0,0),(1,1),(5,25)$. I don't have a function that generates the points.
-1
votes
1answer
43 views

How to loop in reverse order?(e.g. for i from 10 to 1) [closed]

I have a list F = {382.856, 638.53, 915.482, 1192.44, 1469.39, 1746.34, 2023.29, 2181.91} And I want to use it to calculate V: I think it should be something ...
-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 ...
-2
votes
1answer
133 views

How can I decrease number of lines of code in a notebook? [closed]

I have too many lines of code and I want to reduce the line count. For example, I have a notebook with 2000 lines of code, and i want to hide some of it so there are less than, say, 200 lines. Can ...
-4
votes
1answer
110 views

Programming Multipolar Expansions in Spherical Tensors

We have that a density matrix can be written in a basis of spherical tensors: $\rho =\sum _{K=0}^S\sum_{q=-K}^K \rho _{\text{Kq}}^{(S)} T_{\text{Kq}}^{(S)}$ for example for a 3x3 matrix, $S=1$, ...