Borrar filtros
Borrar filtros

Hiii all, i am trying to minimize my problem n want to get the plot...program is getting minimized but plot is not coming... m sending program also n the expected plot image also....plzzz plzzz plzzz do help

1 visualización (últimos 30 días)
clear ; clc
syms beeta n
alpha=1;
t=0.2;
w0=1;
N=3;
p=1;
M=@(beeta)(1+(beeta)^2+((beeta))./4+((beeta))./36)+...
2*((beeta+((beeta)^3)./2+((beeta)^5)./12+((beeta)^7)./144)+...
(((beeta)^2)./2+((beeta)^4)./6+((beeta)^6)./48+((beeta)^8)./720)+...
(((beeta)^3)./6+((beeta)^5)./24+((beeta)^7)./240+((beeta)^9)./4320));
j=@(beeta,eta,alphas,h,delta) w0*(alpha*(2-eta)+2*sqrt(alpha)*(1-eta)*(h+M(beeta)*delta*exp(2*alphas)));
teff=@(beeta,eta,alphas) t*exp(alpha*eta^2*exp(-4*alphas)*...
(1+(2*beeta)^2+((2*beeta)^4)./4+((2*beeta)^6)./36)-...
((-1)*((2*beeta)+((2*beeta)^3)./2+((2*beeta)^5)./12+((2*beeta)^7)./144)));
for u=0:0.2:4
ueff=@(eta) u-2*alpha*w0*eta*(2-eta);
energy = @(beeta,eta,alphas,h,delta) -j(beeta,eta,alphas,h,delta) +w0*...
(h^2+(.5*((1+(2*beeta)^2+((2*beeta)^4)./4+((2*beeta)^6)./36)*cosh(4*alpha)-1)))+...
(.25*(ueff(eta)-abs(ueff(eta))))+...
(delta*w0.*M(beeta)*exp(2*alphas))*(2*h+delta*exp(2*alphas))-...
4*teff(beeta,eta,alphas).*quadgk(@(k)besselj(0,k).*besselj(1,k) ./...
(k.*(1+exp(k*0.5*abs(ueff(eta))/(teff(beeta,eta,alphas))))),0,inf);
engy=@(v) energy(v(1),v(2),v(3),v(4),v(5));
options = optimoptions('fminunc','Algorithm','quasi-newton');
xstart=[0.001,0.002,0.001,0.001,0.002];
[xmin,ymin]=fminunc(engy,xstart,options);
fprintf('minimum Enrgy = %f \n',ymin) ;
x(p)= u;
y(p)= ymin;
p=p+1 ;
end
hold all
plot(x,y)
  2 comentarios
Walter Roberson
Walter Roberson el 6 de Mayo de 2017
My investigations so far suggest that the minima is -infinity for some combinations. I am checking further to see if I can work out what the circumstances are.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 6 de Mayo de 2017
For the first u (at least), energy(0,-10^100,0,0,0) is -inf, so the search is unbounded.
  2 comentarios
ZAHID MALIK
ZAHID MALIK el 6 de Mayo de 2017
what shall i do then??? should i decrease u value?? how to handle with unbounded problem???
Walter Roberson
Walter Roberson el 6 de Mayo de 2017
Editada: Walter Roberson el 6 de Mayo de 2017
If you let
beeta = 0
alphas = 0
eta = 1 +/- (1/2)*sqrt(4-2*u)
then nearly everything falls out of the integral part of the expression, leaving int((1/2)*BesselJ(0, k)*BesselJ(1, k)/k, k, 0, Inf) which has the solution 1/Pi . That makes the overall energy expression,
Delta^2 - (2^(1/2)*(2 - u)^(1/2))/2 + H^2 - (4*exp(2 - 2^(1/2)*(2 - u)^(1/2) - u/2))/(5*pi) + 2*Delta*H - 2^(1/2)*Delta*(2 - u)^(1/2) - 2^(1/2)*H*(2 - u)^(1/2) + 53454369307773/4398046511104
This goes complex for u > 2 (which just means that particular substituted eta should not be done because eta would not be real-valued). But as u goes to -infinity the limit goes to -infinity. Therefore if you were thinking of allowing u to be unbounded instead of in the range 0 to 4, then your minimum would be -infinity.
The combination alphas = 0, delta = 1, u = 0, h = 2, eta = 0, goes to -infinity as beetas approaches either +infinity or -infinity
There are probably other combinations that go to -infinity. For example the same behaviour for beetas happens with alphas = 1 as well as alphas = 0 in the above combination.
At this point you should probably re-check whether you have put in the proper equations, and re-check whether there are any constraints on the variables. You have used fminunc which is for unconstrained optimization.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by