qpv-research-group / solcore5

A multi-scale, python-based library for the modelling of solar cells and semiconductor materials
https://www.solcore.solar/
Other
133 stars 77 forks source link

Tutorial: 2J solar cell with QWs in the bottom cell #250

Closed moses-varghese closed 1 year ago

moses-varghese commented 1 year ago

Hi

Is it possible to share how you got the plots for Tutorial: 2J solar cell with QWs in the bottom cell?

phoebe-p commented 1 year ago

I think this example makes all the plots. https://github.com/qpv-research-group/solcore5/blob/develop/examples/advanced_examples/MJ_solar_cell_tutorial.py

moses-varghese commented 1 year ago

So for the Isc we take the loglog and for the other three parameters Voc, FF and efficiency, we take the semilogx. Can you share the reason? How do we get power conversion efficiency of the solar cell? I am getting kind of similar values for Isc for each concentration and unexpected values for other parameters and the plots for Voc, FF, efficiency and Isc are different.

phoebe-p commented 1 year ago

Taking the loglog vs. logx isn't related to Solcore, it's just a decision on how to plot the data. I guess it's because the Jsc will be a straight line on either a linear or log log scale since it's just proportional to concentration, while the Voc is proportional to log(concentration).

As you can see in other examples, you can get the efficiency by solving for the light_iv and maximum power point and getting the my_solar_cell.iv["Eta"] attribute. In this case, the code is saving the power at the maximum power point instead (my_solar_cell.iv["Pmpp"]) so you can calculate the efficiency from that with the input power of the spectrum (which was depend on the concentration).

It is hard to answer your questions if you don't give a specific issue (this also goes for the questions relating to installation - this is why we have the template for opening issues!)- I am not sure what "kind of similar values for Isc" or "unexpected values" means. I just ran the example and the results look reasonable; current is proportional to concentration, Voc is proportional to log(concentration), efficiency and fill factor increase with concentration up to the point that series resistance becomes an issue and then they start to decrease. Are you running the most recent version of this example/do you have the most recent version of Solcore installed? There was a problem with this example at one point (see #164) but it was fixed quite a while ago, I just ran it on my computer and the results look as expected.

moses-varghese commented 1 year ago

plot

At the highlighted concentration value below and its respective highlighted Pmpp and Voc values, the result is different from the plot attached. I would like to know if this trend is expected?

con: [ 1. , 1.46779927, 2.15443469, 3.16227766, 4.64158883, 6.81292069, 10. , 14.67799268, 21.5443469 , 31.6227766 , 46.41588834, 68.12920691, 100. , 146.77992676, 215.443469 , 316.22776602, 464.15888336, 681.29206906, 1000. ]

Pmpp: [ 209.7034322 , 318.71676689, 667.27102636, 989.22744212, 1466.14333035, 2172.42987026, 2290.01537685, 3465.74362633, 7051.85019703, 10435.39552868, 15431.29979387, 22804.34342682, 24444.94207947, 36702.42324551, 72998.01251333, 106889.08483773, 154544.48556104, 182245.10887462, 132377.3538659 ]

Voc: [1.65454447, 1.7045395 , 2.41325259, 2.43385009, 2.45417165, 2.47477822, 1.7798441 , 1.82818271, 2.53582537, 2.555603 , 2.57580412, 2.59603369, 1.8999642 , 1.94885313, 2.65580948, 2.67562803, 2.69603895, 2.7165995 , 2.01737986]

phoebe-p commented 1 year ago

This is very strange, thanks for posting the plots! I have never seen an issue like this before. The Jsc looks normal but there is clearly a problem with the Voc/FF and hence the efficiency. This does not happen when I run the example (I also checked on Ubuntu) so I'm not sure what's going on! Could you check which version of Solcore you have installed? Are you running the code exactly as in the example or did you modify anything? Could you also post the IV plot (the final one that gets plotted)?

moses-varghese commented 1 year ago

iv plot Sorry for the ambiguity in the plot figure.

When I try solcore.config, first few lines are: [Configuration] version = 5.9.1 welcome_message = 1 verbose_loading = 1 ....

Yes, I am trying the same example

phoebe-p commented 1 year ago

@dalonsoa do you have any idea what could be happening here? I have no idea since I can't replicate this behaviour (on MacOS or on Ubuntu)...

moses-varghese commented 1 year ago

There was a small difference in temperature value and I am running it again, expecting to get the original plot

dalonsoa commented 1 year ago

This is indeed very odd. I've never seen that before, either.

@mosespv96 , could you confirm what operative system you are using, the python version as well as the version of all python packages you have installed? You can get a full list of the packages installed in your virtual environment, or system environment if you are not using a virtual one, with pip list. Even better, if you can do pip freeze > solcore_dep.txt and share here that file, it will help us to debug the issue. Equally, if you have modified the example, please share that file here, too.

If you are not using a virtual environment, I strongly recommend you to use it, as that isolate any potential conflicts with other python packages in your system. Check this nice tutorial on the topic.

phoebe-p commented 1 year ago

There was a small difference in temperature value and I am running it again, expecting to get the original plot

Let us know if that works, but even a different temperature should not produce these results! As Diego mentioned, I think it is worth trying to make a new virtual environment with just Solcore and its requirements and seeing if you still get the same thing.

moses-varghese commented 1 year ago

iv plot plot Now, I am getting somewhat similar to original plots. I am not sure if FF plot is little different than expected and how temperature is related to the efficiency and other parameters as it is affecting certain concentration values. Yes, I was running in a virtual environment.