1 load("wrstcse")$ratprint:false$
2 load("engineering-format")$
3 engineering_format_min: .01$engineering_format_max: 1100$fpprintprec: 6$
5 printf(false,"The output voltage of a voltage divider");
10 printf(false,"Every store keeps 1% resistors or better.");
13 R_1=10e3*(1+.01*tol[1]),
14 R_2=1e3* (1+.01*tol[2])
16 wc_inputvalueranges(vals_discrete);
19 wc_typicalvalues(subst(vals_discrete,div));
20 lhs(div)=wc_mintypmax(subst(vals_discrete,rhs(div)));
21 printf(false,"Trying more values per resistor to verify this result:");
22 lhs(div)=wc_mintypmax(subst(vals_discrete,rhs(div)),40);
23 printf(false,"Trying 100 random values per resistor to verify this result:");
24 lhs(div)=wc_mintypmax(subst(vals_discrete,rhs(div)),-100);
26 printf(false,"Inside a semiconductor tolerances are big but tightly coupled:");
28 R_1=10e3*(1+.2*tol[1]+.0001*tol[2]),
29 R_2=1e3* (1+.2*tol[1]+.0001*tol[3])
31 wc_inputvalueranges(vals_ic);
32 lhs(div)=wc_mintypmax(subst(vals_ic,rhs(div)));
34 printf(false,"An asymmetric tolerance range:");
37 R_1=10e3*(1+.01*tol[1]),
38 U_BE=wc_mintypmax2tol(tol[2],.6,.75,.85)
40 wc_inputvalueranges(%);
41 ib:I_B=(U_In-U_BE)/R_1;
43 lhs(ib)=wc_mintypmax(subst(vals_t,rhs(ib)));
44 printf(false,"This result is correct. An additional assumption makes it simpler:");
46 lhs(ib)=wc_mintypmax(subst(vals_t,rhs(ib)));
47 wc_systematic(subst(vals_t,rhs(ib)));