Comment écrire un programme en matlab

Tout ce qui concerne notamment les outils de calcul numérique, de calcul formel ou de géométrie.
[participation réservée aux membres inscrits]
Règles du forum
Merci de soigner la rédaction de vos messages et de consulter ce sujet avant de poster. Pensez également à utiliser la fonction recherche du forum.
mannou

Comment écrire un programme en matlab

Message non lu par mannou »

Bonjour

J'ai une fonction à deux variables non separées et je veux chercher ses minimums est ce qu'il ya un programme pret en matlab qui fait ça si non comment faire ?

Merci d'avance
jobherzt
Utilisateur éprouvé
Utilisateur éprouvé
Messages : 433
Inscription : vendredi 13 janvier 2006, 13:13

Message non lu par jobherzt »

tout depend de la tete de ta fonction. a priori, il y a des fonctions qui font ca tres bien, si tu trouves des valeurs initiales pas trop mauvaise.
manut

Message non lu par manut »

Va voir la Toolbox "optim" de matlab (si tu l'as), tu trouveras tout ce qu'il te faut :
Optimization Toolbox
Version 3.0 (R14) 05-May-2004

Nonlinear minimization of functions.
fminbnd - Scalar bounded nonlinear function minimization.
fmincon - Multidimensional constrained nonlinear minimization.
fminsearch - Multidimensional unconstrained nonlinear minimization,
by Nelder-Mead direct search method.
fminunc - Multidimensional unconstrained nonlinear minimization.
fseminf - Multidimensional constrained minimization, semi-infinite
constraints.

Nonlinear minimization of multi-objective functions.
fgoalattain - Multidimensional goal attainment optimization
fminimax - Multidimensional minimax optimization.

Linear least squares (of matrix problems).
lsqlin - Linear least squares with linear constraints.
lsqnonneg - Linear least squares with nonnegativity constraints.

Nonlinear least squares (of functions).
lsqcurvefit - Nonlinear curvefitting via least squares (with bounds).
lsqnonlin - Nonlinear least squares with upper and lower bounds.

Nonlinear zero finding (equation solving).
fzero - Scalar nonlinear zero finding.
fsolve - Nonlinear system of equations solve (function solve).

Minimization of matrix problems.
bintprog - Binary integer (linear) programming.
linprog - Linear programming.
quadprog - Quadratic programming.

Controlling defaults and options.
optimset - Create or alter optimization OPTIONS structure.
optimget - Get optimization parameters from OPTIONS structure.

Demonstrations of large-scale methods.
circustent - Quadratic programming to find shape of a circus tent.
molecule - Molecule conformation solution using unconstrained nonlinear
minimization.
optdeblur - Image deblurring using bounded linear least-squares.

Demonstrations of medium-scale methods.
tutdemo - Tutorial walk-through.
goaldemo - Goal attainment.
dfildemo - Finite-precision filter design (requires Signal Processing
Toolbox).
datdemo - Fitting data to a curve.
officeassign - Binary integer programming to solve the office assignment
problem.

Medium-scale examples from User's Guide
objfun - nonlinear objective
confun - nonlinear constraints
objfungrad - nonlinear objective with gradient
confungrad - nonlinear constraints with gradients
confuneq - nonlinear equality constraints
optsim.mdl - Simulink model of nonlinear plant process
optsiminit - init file for optisim.mdl
runtracklsq - demonstrates multiobjective function using LSQNONLIN
runtrackmm - demonstrates multiobjective function using FMINIMAX

Large-scale examples from User's Guide
nlsf1 - nonlinear equations objective with Jacobian
nlsf1a - nonlinear equations objective
nlsdat1 - MAT-file of Jacobian sparsity pattern (see nlsf1a)
brownfgh - nonlinear minimization objective with gradient and Hessian
brownfg - nonlinear minimization objective with gradient
brownhstr - MAT-file of Hessian sparsity pattern (see brownfg)
tbroyfg - nonlinear minimization objective with gradient
tbroyhstr - MAT-file of Hessian sparsity pattern (see tbroyfg)
browneq - MAT-file of Aeq and beq sparse linear equality constraints
runfleq1 - demonstrates 'HessMult' option for FMINCON with equalities
brownvv - nonlinear minimization with dense structured Hessian
hmfleq1 - Hessian matrix product for brownvv objective
fleq1 - MAT-file of V, Aeq, and beq for brownvv and hmfleq1
qpbox1 - MAT-file of quadratic objective Hessian sparse matrix
runqpbox4 - demonstrates 'HessMult' option for QUADPROG with bounds
runqpbox4prec - demonstrates 'HessMult' and TolPCG options for QUADPROG
qpbox4 - MAT-file of quadratic programming problem matrices
runnls3 - demonstrates 'JacobMult' option for LSQNONLIN
nlsmm3 - Jacobian multiply function for runnls3/nlsf3a objective
nlsdat1 - MAT-file of problem matrices for runnls3/nlsf3a objective
runqpeq5 - demonstrates 'HessMult' option for QUADPROG with equalities
qpeq5 - MAT-file of quadratic programming matrices for runqpeq5
particle - MAT-file of linear least squares C and d sparse matrices
sc50b - MAT-file of linear programming example
densecolumns - MAT-file of linear programming example
mannou

Re: Comment ecrire un programme en matlab

Message non lu par mannou »

Bonjour

J'ai une fonction à deux variables tres complexe et je dois ecrire un programme en matlab pour chercher ses minimums c'est trés urgent merci de m'aider.
Merci d'avance.
nirosis
Administrateur
Administrateur
Messages : 1803
Inscription : samedi 28 mai 2005, 14:48
Localisation : Orsay, France

Message non lu par nirosis »

Oui c'est fait dans matlab.

Regarde du coté de fminunc ou fmincon si tu as en plus des contraintes à respecter...

Tu écris ta fonction et matlab se charge de trouver le minimum. Ca dépendra de l'intialisation que tu fais...