Optimization in the presence of symbolic parameters

1 view (last 30 days)
Hello,
I have an optimization problem, let's say finding the minimum of fun(x) where x is a real scalar, where for example: fun(x) = A*tanh(x) - x^2; The function fun has a parameter A which I'd like to specify as a symbolic variable such that the solution x is given as a function of A. The brute force solution will be to go over different valid values of A and finding x per each such value of A. Is there a way for Matlab to output x as a function of A instead?

Accepted Answer

Torsten
Torsten on 20 Nov 2014
Something like
syms A x
f(x)=A*tanh(x)-x^2;
solve(diff(f)==0,x);
?
Best wishes
Torsten.

More Answers (0)

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!