I am trying to solve the given equation in the code and want to plot 'N1' with 'P1'. But the code is not giving me any output and still showing running. What is the problem with it?If anyone can figure it out will be appreciated.
and see how well it did. The first item in each of those 21 results will be the minimum of the sum that it was able to find. You might like all those first items to be exactly zero, but they won't be. The question is: Are the sums good enough to give you an idea what your plot looks like.
There is another issue. Plot might do several hundred or even several thousand iterations, finding the value of the N1 at each of those points. This only does 21 points. So it can easily be that there is behavior between any pair of those points which is not displayed in the resulting ListPlot. Changing the step size for P1 might help you get a little better idea what the resulting graph will be like, but without taking hundreds or a thousand times longer to display a result.
There is another issue. You almost certainly intended that alab,Np,betab,a1,b1 could have complex values, not just real values. If you read the documentation for NMinimize and you click on the orange Details and Options you will find: By default, all variables are assumed to be real. Perhaps you can explore changing that default or looking at other functions that might let you find better minima if you search among complex values for alab,Np,betab,a1,b1 and still be able to rapidly get an estimate of what your graph looks like.
If you can quickly determine whether this is good enough for your purposes then that was the only goal. If it isn't good enough then perhaps letting Solve run for a few hours or days or months might be enough to get you the original Plot that you desired.
b1e95dc632