Hi @ifariborz, capacitance is defined as the rate of change in charge with respect to the rate of change in voltage. This is how the capaciatnce was calculated in the Mach-Zehnder modulator. A charge monitor was placed on top of the silicon waveguide. A bias sweep was applied at one of the contacts. Once the simulation was done the capacitance was calculated from dQ / dV.
In the Mach-Zehnder example the bias was set in such a way that for every bias point of intereset a second bias point was introduced that was a very small amount away from it (i.e. 1 and 1.025, 1.5 and 1.525, and so on). This way we calculated dQ by taking the difference in the total charge between these two bias points (that are very close to each other) and divided the value by the difference in voltage. This allowed us to use a small value for dV (important for cases where the C-V curve is nonlinear) and still do the overall sweep in much larger steps.
Note that the charge monitor has an option that allows it to integrate the charge within the volume/area of the monitor and report the net (total) charge. This option was used in the example to get the net charge at each bias point easily.