summaryrefslogtreecommitdiff
path: root/147/CH7/EX7.3/Example7_3.sce
blob: e7c42b6d9ed496bfd2f4b0ccdea09b72cf1210bb (plain)
1
2
3
4
5
6
7
8
9
10
11
close();
clear;
clc;
V1 = 5; //V
V2 = 3; //V
R = 500; //ohm
//vd<0 thus
id1 = 0;
//By KVL
id2 = (V1-V2)/R; //A
mprintf("id1 = %d A\nid2 = %d mA\n",id1,id2*1000);