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
107 views

Improving Function with Loop Structure

I'd like to write a function that would perform a loop, I guess Do or While should be helpful here. I've simplified the problem, ...
0
votes
0answers
123 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
72 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
128 views
0
votes
0answers
74 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
102 views

Pearl's Message Passing Algorithm

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

Is there a way to generalize FindAllCrossings3D to higher dimensions?

I understand the obvious visualization issues, but is there a way to extend the argument to higher dimensions, ie more equations?
0
votes
0answers
88 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
38 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
50 views

Generating partitions of a set [duplicate]

Is it possible to get Mathematica to generate all possible partitions of a set of objects? (..or equivalently if it can be made to do the cumulant expansion or at least the Gaussian special case of ...
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
896 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
226 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
37 views

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

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
80 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 ...
-1
votes
0answers
54 views

How to generate all symmetric positive semidefinite 0,1 matrices of a given order [closed]

The title says it all. There are many instances when we need to check some properties of such matrices. I am looking for an efficient code.
-2
votes
1answer
132 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
106 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$, ...