Automatically grounds all disconnected input and bidirectional electrical ports in the current group scope. It creates a single Ground Source element and a Node element, then connects all disconnected input and bidirectional electrical ports through the node. Bidirectional electrical ports have a port converter added before connecting to ground.
You can only use this command in design mode. An error is returned if used in analysis mode.
Warning: You must ensure that the grounding of disconnected electrical ports is intentional and appropriate for your simulation setup. We recommend you review each grounded element and port to verify that grounding of these connections does not adversely impact simulation results.
| Syntax | Description |
|---|---|
| out = gnddisconnectedelectricalports; |
Grounds all disconnected input and bidirectional electrical ports in the current group scope. Returns a struct describing which ports were connected, or an empty struct and a warning if no disconnected elements were found. The returned struct contains the following:
|
You can safely call this command multiple times. If a Ground Source and Node Element from a previous call already exist, they are reused, and only newly disconnected ports will be connected.
Example
The following example demonstrates a use case with a simple continuous-wave laser element, an amplitude modulator element, and a VD avalanche photodetector element.
If the circuit is simulated as-is without connecting electrical ports, the simulation fails due to a deadlock condition.
To use this script command to ground the disconnected ports, run
out= gnddisconnectedelectricalports;The electrical input ports are now grounded.
Check the ports that were grounded.
?out;Struct with fields:
AM_1
VD_APD_1?out.AM_1;
Cell array with 1 elements
?out.AM_1{1};
modulation
Disconnect the modulation port.
disconnect("AM_1","modulation");Disconnect all connections made.
select("GND_disconnectedelectricalports");
delete;
select("N_disconnectedelectricalports");
delete;
See Also
List of commands, connect, disconnect, delete, addelement, switchtodesign