Syms function optimization. How to solve function (NLE) for minimum value?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have derived the equation following syms of variable D s n n_pass as the following function (fun).
fun=100000*(250000000/(549*n*pi*(2*s + 1/1000)) - 2000*n_pass + (625000000*s)/(157*n*(D^2 - 5312662293228351/147573952589676412928)))^2 + 100000*(48000000000/(7*n_pass) - 1000000000000*n*s*((157*D^2)/100 - 834087980036851107/14757395258967641292800))^2 + 7850*D^2*n*n_pass*(2*s + 1/1000) + (102400*n*(2*s + 1/1000))/(627*n_pass*pi)
I have to minize the following function. How to do it using MATLAB optimization functions. Please help?
5 comentarios
Respuestas (1)
Torsten
el 23 de En. de 2018
fun=@(D,s,n,n_pass) 1000*....;
x0=[1 1 1 1];
[x,fval,exitflag,output] = fminunc(@(x)fun(x(1),x(2),x(3),x(4)),x0)
Best wishes
Torsten.
2 comentarios
Torsten
el 23 de En. de 2018
Why don't you use the code from above ?
fun=@(D,s,n,n_pas) U won't work, and you forgot the "x0" in your call to "fminunc".
Just do the following:
1) Remove all "syms" declarations in your code.
2) Copy the code from above and insert your fun-definition in the line fun=@(D,s,n,n_pass) 1000*...
3) Run the script.
Best wishes
Torsten.
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!