How to optimise a variable to maintain the result of a function at a set value as another variable is increased?
Mostra commenti meno recenti
I have a function: eta_m=R*k*sinc(m*pi*rho*(cos(phi)-sin(phi)*cot((alpha+beta)/2))).^2 where R, m and beta are constants and rho and k are functions dependent on various combinations of the cosine of alpha, phi and beta. As alpha is increased in some range 0 to alpha_max i would like to find the value of phi that maintains eta_m as close to 1/2 as possible. I've looked at the optamisation toolbox but don't really know where to start, any suggestions on how to go about the problem would be appreciated.
Thanks
2 Commenti
dpb
il 29 Gen 2021
" find the value of phi that maintains eta_m as close to 1/2 as possible"
I don't have time to try to mess around with it at the moment, but if there is a solution, you could try
fsolve()
where the function is
fneta_m=fn(r,k) R*k*sinc(m*pi*rho*(cos(phi)-sin(phi)*cot((alpha+beta)/2))).^2 - 0.5;
The above isn't the actual functional you'll need and you may need to write an m-file so you can incorporate the other functional dependencies to get rho and k that are the functionals of alpha, phi, and beta, but the idea is you try to solve for a zero where at 0.5 by subtracting the target value from the function value.
ab123
il 1 Feb 2021
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Particle Swarm in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!