Skip to content

Instantly share code, notes, and snippets.

@n7275
Created March 21, 2024 17:26
Show Gist options
  • Save n7275/1398f1c38be910de429c2cdf00b70f3f to your computer and use it in GitHub Desktop.
Save n7275/1398f1c38be910de429c2cdf00b70f3f to your computer and use it in GitHub Desktop.
clear;
clc;
RA = 0.1;
RB = 0.1;
Power = 50;
RO = (28^2)/Power;
VA = 28.2;
VB = 28;
IA = (RO*VA - RO*VB + RB*VA)/(RO*RA + RO*RB + RA*RB);
IB = (RA*VA - (RO + RA)*(VA - VB))/(RO*RA + RO*RB + RA*RB);
PA = IA*VA + IA^2*RA
PB = IB*VB + IB^2*RB
if(IA < 0.0)
RA = 1E15;
IA = 0.0;
PA = 0;
IB = VB/(RO + RB);
PB = IB*VB + IB^2*RB
endif
if(IB < 0.0)
RB = 1E15;
IA = VA/(RO + RA);
PA = IA*VA + IA^2*RA
IB = 0.0;
PB = 0;
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment