How can I find the changing maximum of a function as another parameter changes
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Valeria Garcia
am 23 Jun. 2015
Beantwortet: Udit Gupta
am 23 Jun. 2015
For example if I have a function:
y=-Ax^2+Bx+C-Dcos(Ax)
where A B C and D are constants and x is the independent variable
I would like to find the maximum of the function at different values of A
0 Kommentare
Akzeptierte Antwort
Udit Gupta
am 23 Jun. 2015
The fact that you require to find something with different values of A implies that A can no longer be treated as a constant. So in effect this is a two dimensional function
y(A,x) =-Ax^2+Bx+C-Dcos(Ax)
To find the maximum you can use various methods -
1.you can wither use multi-dimensional derivatives to find maxima, minima and saddle points (see a calculus textbook)
2. In matlab use meshgrid to continuously vary A and x and plot a surface plot to find the maximum.
3. Realize that y is a sum of a quadratic function and a periodic cosine. The extrima of a quadratic function is the vertex (can be either maxima or minima depending on sign of A) and that the periodic function varies between +/-D. So analyzing it becomes not too difficult.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!