function Branch = CircuitAddJ(Branch,name,data,Im,phi)
% Add current source to the branch
% Do not call this function after calling CircuitCreate
component.name=name; 
component.type='J';
component.power=0;
component.V=0;
% component.Vprev=0;
component.value.method='Supply'; 
component.value.data=data; 
component.value.actual=0;
if nargin==5
    component.phasor.amplitude=Im;
    component.phasor.phase=phi;
else
    component.phasor.amplitude=[];
    component.phasor.phase=[];    
end
Branch.Components=celladd(Branch.Components,component);