# Discussion Forum

## How to perform calculation for one variable at two different sweep values

I constructed a photodetector in the Semiconductor module, and then performed a parametric sweep with two parameters, the incident photon flux and bias voltage. For the incident photon flux, only two values were swept, 0 and a non zero value. The aim is to get I-V curves with and without light illumination. Then I got the two I-V curves at two incident photon flux as shown in the appended figure.

Now, I'd like to calculate the difference between the two curves to get net photon current. I tried a lot but didn't manage. The question is how to calculate Jx (current density) minus itself at two incident photon flux parameter values within the results of a parametric sweep.

I'll appreciate all help!

6 Replies Last Post Jul 10, 2019, 5:49 PM EDT

Posted: 3 months ago
Updated: 3 months ago

I believe one should be able to do this with COMSOL with Matlab. Have you tried?

-------------------
ZHANG, Pu
School of Physics,
Huazhong University of Science and Technology

Posted: 3 months ago
Updated: 3 months ago

Ares,

Check the with() and withsol() operators in the documentation.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com

Posted: 3 months ago
Updated: 3 months ago

I believe one should be able to do this with COMSOL with Matlab. Have you tried?

Thanks Zhang! Matlab can provide more freedom. I'll see whether my version can do it.

Posted: 3 months ago
Updated: 3 months ago

Ares,

Check the with() and withsol() operators in the documentation.

Cheers Edgar

Thanks a lot, Edgar! I've tried both. The problems are (1) the variable I'd like to process is within the same data set (solution), seems I can't use these operators to distinguish. (2) I also tried to use two different studies, each defines a different incident photon flux, then sweep voltage. I tried with() and withsol() operators, it seems can't handle a swept variable. I got constant, not a curve.

I am not very familiar with these operators, so probably I didn't use them right. Regards, Ares

Posted: 3 months ago
Updated: 3 months ago

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com

Posted: 3 months ago
Updated: 3 months ago

Hi Edgar, I've got the withsol() operator work. The problem now is, it seems it can only evaluate one data point each time. For example, I have swept two parameters, Q and Va, then I used the following expression: withsol('sol7', abs(semi.JX), setind(Q,1), setval(Va, -0.5)) Then I get one JX value at Q=1 and Va=-0.5. If I don't assign the Va value, it returns the last Va.

I'd like to set one Q value, and then get JX versus all Va values. By using the "setind" and "setval" inside the "withsol()", I can only get one data point designated by (Q,1) and (Va, -0.5). I failed to find a way to define a range for Va. Can this be solved?

Many thanks for your patience and time! Ares