Tagged Questions

Questions on the optimization functions of Mathematica such as FindMinimum/FindMaximum, Minimize/Maximize, NMinimize/NMaximize, etc.

learn more… | top users | synonyms (2)

0
votes
0answers
40 views

Improve on timing of NMinimize

I got a little performance problem with the function NMinimize (it takes mathematica approximately 10 minutes to compute the results). Here i s my sample code: ...
0
votes
0answers
44 views

Using FindFit to return a list of possible best fits

Can I use some variant of FindFit that will return a list of the best fit and some worse fits, not just the best fit? This is for a function where the residual function can have several local ...
1
vote
0answers
46 views

Optimization in MMA for time resolved spectroscopy

I want to fit some spectroscopic data with a model. I detect the fluorescence of something over different wavelengths. The detection over each wavelength is one data set in time. The lifetimes of ...
5
votes
0answers
50 views

PenaltyFunction Option in NMinimize

I am curious if anybody has some experience in using the built-in Option "PenaltyFunction" in any of the numerical optimization functions like NMinimize. According to the documentation the user ...
0
votes
0answers
25 views

How to set the step in NMinimize

I want to fit multiple data sets with 104 variables. I use NMinimize to do that. I minimize the difference between data and my objective function. How can I tell ...
0
votes
0answers
24 views

Optimization of two functions under one common constraint

Is it possible to optimize two functions under one common constraint? So to find the common maximum? For example, Optimization of (* 1 *) x*y^2-x^2 (* 2 *) x*y ...
1
vote
1answer
60 views

Matlab's command counterpart in MMA

Matlab has a command that when is used in fminsearch shows the value of the function which we want to minimize and so gives a trend of values calculated for the ...
0
votes
0answers
41 views

Undertermined gauges [on hold]

I want to be able to extract from mathematica, an undertermined gauges, like in pertubation theory: $$\delta_0(\epsilon)x_0+\delta_1(\epsilon)x_1+\cdots+\delta_k(\epsilon)x_k $$ And to extract the ...
0
votes
0answers
33 views

Speed up numerical optimization (for plotting and solving)?

Briefly speaking, I want to plot a function PIfun[], which its value is based on numerical optimization using NMaximize. It ...
0
votes
0answers
66 views

Mathematica 10 is shuttingdown many times [closed]

I run mathematica 10 on mac osx 10.9. It shutdown many times. I do not understand what happen. What is the problem. Any clarification?
0
votes
2answers
51 views

A constraint to RandomReal for sum of numbers equal to arbitrary n

I want to generate some random numbers but respect a constraint. So I use RandomReal[{0,1},N,WorkingPrecision -> 2] I want to fix a constraint in order ...
0
votes
0answers
20 views

NMinimize outside the feasible region

I got the following minimization problem. I get a solution if I set constraints1 := L.x >= y; and eliminate constraint 2 from my set of constraints. So ...
0
votes
0answers
22 views

Add constraints to a variable number of parameter in Minimize

i want to use Minimize with a variable number of Parameter which works fine: ...
1
vote
0answers
37 views

NMinimize: Problem with constraints + Simultaneous minimization possible?

Introduction Dear all, I am fairly new to Mathematica. Recently I am trying to do the following: I have a function $$\textrm{hann}[t,t_g,n_m]=\sum\limits_{n=1}^{n_m}a_n\left[1-\cos\left(\frac{2\pi ...
0
votes
0answers
37 views

Minimization of a non-linear objective function subject to linear constraints

I have solved a linear program in Mathematica using the LinearProgramming function with arguments of the form LinearProgramming[c,m,{{b1,s1},{b2,s2},...}] i.e. ...
2
votes
1answer
43 views

Working precision and pure functions in FindMinimum

I have this function: fun = (# - 5.0)^2.0 & Then, I want to find the minimum: ...
-1
votes
0answers
22 views

mathematica multivariate question about how to define acceleration

write a function , call it tc, that takes as input the name of a vector-valued function and a value of t and outputs the tangential scalar componenet of acceleration of the function at that time
8
votes
1answer
131 views

What is the difference between FindFit and NonlinearModelFit

I cannot get the difference between these two fitting functions in Mathematica. I even read in MMA that the result of these two are the same.
2
votes
0answers
60 views
5
votes
3answers
194 views

How to use a compiled function in numerical optimization

I'm trying to wrap my head around function Compile. So, this is a spin-off question from: a previous question on using compile[] correctly. I have a function that ...
2
votes
1answer
63 views
0
votes
0answers
48 views

Calculate the relationship between the duration of two oscillating functions

I am trying to quantitatively determine the relationship between the length of two oscillating functions. Meaning, what is the duration of the green spike in relation to the blue square? Does anyone ...
1
vote
0answers
43 views

Optimizing evaluation of expressions dependent on four variables and containing double summation

I would like to optimize my code which I use to evaluate expressions containing double summation. These expressions are dependent on 3 space variables ($r$, $\theta$, $\phi$) and time $t$ and consist ...
5
votes
1answer
100 views

Optimizing code containing an infinite sum

I have the following expression. It's based on the negative-log-likelihood of a Poisson-Gaussian noise model, i.e. a convolution of a Poisson & Normal distribution. The value $x_{i}$ is the ...
1
vote
1answer
39 views

NMaximize not substutiting parameters of objective function [duplicate]

NMaximize is not substituting parameters of its objective function. Is there a way to fix that? I have a three line program that exhibits the problem. ...
4
votes
1answer
74 views

Possible bug / numerical issues with HypergeometricU — any suggestions for a fast workaround?

I've encountered some problematic behaviour with HypergeometricU. I have a probability distribution on the positive integers that takes the following form after ...
1
vote
0answers
47 views

NMaximize stops evaluating my function when run in parallel

I am trying to maximize the results of a Monte Carlo simulation with respect to some input variables. ...
0
votes
1answer
93 views

How to differentiate a geometric sum [closed]

How do I differentiate both sides of the equation shown below with respect to r?
1
vote
0answers
136 views

Solving mixed integer programming using Mathematica

Let $x_{ij}$ be an $n\times k$ matrix defined as follows: $ x_{ij}=\begin{cases} 1, & \text{if }s_i\text{ is assigned to }S_j \\ 0, & \text{otherwise } \end{cases} $ and $S$ is a set of $k$ ...
3
votes
0answers
64 views

Efficient processing of Special Ordered Sets with LinearProgramming

I'm playing with integer linear programming, especially problems involving lots of constraints which would appear to be special ordered sets. Below is a toy example, three last rows of the matrix ...
11
votes
2answers
461 views

Find maximum value of interpolation function - obviously wrong result

Minimizing and maximizing interpolation function has already been asked and answered, see here for example. Yet, I observe a strange behaviour. Well, I can understand that the wrong guess of ...
6
votes
0answers
53 views

Listable compiled functions used in NMinimize

This is an example from MMA: cListable = Compile[{x}, (x-1)^2, RuntimeAttributes -> {Listable}] In case of single entry: ...
9
votes
0answers
139 views

Can code optimize code?

Are there functions, programs or packages that deal with optimizing mathematica code i.e. re-writing ineffecive or convoluted code. -This question has haunted me since I joined SE. The background for ...
2
votes
1answer
86 views

How to build a list of constraints for NMinimize

Let's say I have aset = {-1, 0, 2}. I would like to create a variable Var that takes values from that set, i.e. ...
1
vote
2answers
145 views

Using compiled function inside NMinimize

Consider this code: ...
1
vote
0answers
77 views

Optimization in Mathematica [closed]

There is a R package called TIMP. By this package someone can fit data to a model. There is a GUI for TIMP called Glotaran. When I fit my data by this package it does not take so much time to get the ...
2
votes
1answer
63 views

How to minimize a list of data points?

I have a list called diff1: ...
1
vote
1answer
135 views

Finding the minimum of a function

I asked this question Mark Minimum Value in DensityPlot. Another question has come up, or better said, a task: Find the minimum of a function. I haven't been able to write the needed code for that, ...
2
votes
0answers
61 views

Maximizing Large Multivariable Function over Region with Parameter Constraints

Brand new Mathematica user here. I have a complicated function to maximize, and thought I would try software like Mathematica instead of taking derivatives by hand. I found some Mathematica ...
2
votes
1answer
97 views

Minimizing a function with some restrictions

I need help in finding a way to minimize a function with some complex constraints. I'm not an expert in this field, but I'm still trying to understand if I can do something with my problem. So, ...
0
votes
0answers
56 views

how to solve an optimization problem in terms of matrices as the argument

How can I minimize an expression of the form a^T A a where a is a matrix. The following approach does not work if ...
1
vote
1answer
84 views

Manual maximum likelihood estimation of a mixture with no closed form

Let $X$ be a random variable that is from a mixture of two Lognormals (Lognormals(mu1,sigma) and Lognormals(mu2,sigma)) and set $Y=X_1+X_2+...+X_{10}$ a sum of 10 random variables from this mixture. ...
0
votes
1answer
55 views

Solving minimum length confidence interval problem

I'm trying to find the minimum length of a confidence interval for the variance from a sample iid with normal distribution. I tried ...
2
votes
0answers
109 views

Convex optimization

I am playing with some Compressed Sensing (think single pixel camera) applications and would like to have a Mathematica equivalent of a Matlab package call Convex Optimization (CVX). Specifically, I ...
0
votes
0answers
30 views

What is that Root[…] inside the answer represent? [duplicate]

So I am encountering this situation, in which mathematica doesn't give me the answer, but in a form of "Root". How do I interpret this ? what is the number after the "&" represent? How should I ...
0
votes
0answers
90 views

FindMinimum slower in MMA10

I've recently updated one of my PCs (both have the exact same build) to Mathematica 10. After running the exact same notebook (which has two FindMinimum calls) on ...
1
vote
0answers
65 views

on convergence in optimization [closed]

I am trying to solve a nonlinear programming problem using FindMinimum solver on Mathematica. When I execute, it is printing FindMinimum::eit: "The algorithm does not converge to the tolerance of ...
1
vote
2answers
118 views

Minimize loop optimization

I'm new in Mathematica 10. So far, I have a two variable-function and I've use Minimize to find the optimal solution. Nevertheless, I'd like to make a sensibility analysis and study how this optimal ...
1
vote
1answer
60 views

2D Arrangment/Optimization Problem

Okay, I have a list of angles, call it A. How would I arrange them in a 2D m-by-n grid G such that the distances between each adjacent angle-element (row- and column-wise) is minimized? G has as ...