When accessing the the current and voltage of the component the matamatically interpreted result is V*2 for voltage and P for current. The Current has VA in the expressoin which physically would represent power instead of ampere. I suspect that it is because the expression has a symbol named 'V' which seems to not be the Voltage Symbol 'V'. Accessing the units property yields the correct unit.
from lcapy import t
from lcapy import state
state.show_units = True
cct = Circuit('''V1 0 1 dc {10}; up
W 1 2; right
R1 2 3 {1000}; down
W 3 0; left
''')
voltage = cct.R1.V(t)
current = cct.R1.I(t)
print("Voltage: " + str(voltage))
print("Current: " + str(current))`
output:
Voltage: V(-10V)
Current: A(-V/100)
for V1 0 1 ac {10} {0} {100}; up
Voltage: V(-10Vcos(100t))
Current: A(-Vcos(100t)/100)
When accessing the the current and voltage of the component the matamatically interpreted result is V*2 for voltage and P for current. The Current has VA in the expressoin which physically would represent power instead of ampere. I suspect that it is because the expression has a symbol named 'V' which seems to not be the Voltage Symbol 'V'. Accessing the units property yields the correct unit.
output: Voltage: V(-10V) Current: A(-V/100) for
V1 0 1 ac {10} {0} {100}; up
Voltage: V(-10Vcos(100t)) Current: A(-Vcos(100t)/100)