How to input the optimal PV,wind power and battery to consider (size consider), what are the constraints?
You do not have to enter the optimal size of each system component in HOMER. Instead, you enter a range of values and HOMER tries all of them in its search for the optimal value.
For most components, you enter the O&M cost as an annual value in $/yr. HOMER does not calculate that value; you have to estimate it yourself. For a generator, you enter the O&M cost in $/hr and HOMER multiplies that by the number of hours the generator operates in a year to calculate the annual O&M cost for that generator.
You do not need to enter the capacity shortage penalty. Just leave it at zero, and on the Constraints window enter the allowable amount of capacity shortage. (The default amount of allowable capacity shortage is zero.) The capacity shortage penalty is an advanced input that you can use instead of a hard constraint on the amount of capacity shortage.