### Related

##### second-solve

eq1: (Vin2-Vin)/R1 + ...

eq2: (Va-Vin2)/(1/(C1...

eq3: (Vb-Va)/(1/(C3*s...

Calculate

##### second-solve

second(solve(x^2+y^2+...

Calculate

##### second

t1:(not a3) and a2 an...

t2:a3 and a2 and (not...

second: t1 or t2;

Calculate

##### second-solve

second(solve(x^2+z+y^...

Calculate

##### second-solve

u:1;

f(v,e):=second(solve(...

f(5,5);

Calculate

##### second-solve

u:1;

l(v,e):=second(solve(...

l(1,1);

Calculate

##### second-solve

second(solve(p=x-k*p*...

Calculate

##### second-solve

eq1: (Vin2-Vin)/R1 + ...

eq2: (Va-Vin2)/(1/(C1...

eq3: (Vb-Va)/(1/(C3*s...

Calculate

##### second-solve

second(solve(p=x-k*p*...

Calculate

##### second-solve

f(y,z)=second(solve(x...

f(-5-5);

Calculate

### second

Run Example
(%i1)intervals(items):=block([result],  result: if (emptyp(items)) then [] else           if(listp(items)) then          if(emptyp(rest(items))) then [] else          cons(cons(first(items),  [second(items)]),          intervals(rest(items))));
(%o1) intervals(items) := block([result],
result : if emptyp(items) then [] else (if listp(items)
then (if emptyp(rest(items)) then [] else cons(cons(first(items),
[second(items)]), intervals(rest(items))))))
(%i2) intervals(makelist(n, n, 1, 10));
(%o2) [[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10]]
(%i3) intervals(makelist(n, n, 1, 11));
(%o3) [[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9],
[9, 10], [10, 11]]
(%i4) ans:errcatch(find_root(sin(x), x, 2, 3));

find_root: function has same sign at endpoints: f(2.0) = 0.90929742682568,
f(3.0) = 0.14112000805987
(%o4)                                 []
(%i5) ans;
(%o5)                                 []
(%i6) seq(start,stop,stepping,[shift]) := block([                                            n, y:[],                                             shift: (if (not(emptyp(shift)))                                                         then float(first(shift))                                                            else (0.0))                                            ],            (n:floor((float(stop-start)/float(stepping)))),            (if (start <
stop)            then            (y:flatten(append([y],                                         makelist(float(start+shift+(stepping*(i-start))),                                         i, start, n+start))))            else            (y:flatten(append([y],                                         makelist(-(float(stop-shift-(stepping*(i-stop)))),                                         i, -(n+stop), stop)))))            (if (n>
1.0)                then return(y)                else return([])));
(%o6) seq(start, stop, stepping, [shift]) :=
block([n, y : [], shift : if not emptyp(shift) then float(first(shift))
float(stop - start)
else 0.0], n : floor(-------------------),
float(stepping)
if start < stop then y : flatten(append([y],
makelist(float(start + shift + stepping (i - start)), i, start, n + start)))
else y : flatten(append([y], makelist(- float(stop - shift
- stepping (i - stop)), i, - (n + stop), stop)))(if n > 1.0 then return(y)
else return([])))
(%i7) intervals(seq(0,7,1));
(%o7) [[0.0, 1.0], [1.0, 2.0], [2.0, 3.0], [3.0, 4.0], [4.0, 5.0], [5.0, 6.0],
[6.0, 7.0]]
(%i8) ans:[];
(%o8)                                 []
(%i9) %pi;
(%o9)                                 %pi
(%i10) %pi, numer;
(%o10)                         3.141592653589793
(%i11) 2*3.14159/%pi;
6.28318
(%o11)                              -------
%pi
(%i12) block([ans:[]], errormsg:false, for i in intervals(seq(0, 7, 1)) do ans:(append(ans, errcatch(find_root(sin(x), x, first(i), second(i))))), errormsg:true, return(ans));
(%o12)            [0.0, 3.141592653589793, 6.283185307179586]
(%i13)
Run Example
kill(all);
(%o0)                                done
(%i1) eq_out : i_oa - (in_neg - vout)/Rf = 0;
in_neg - vout
(%o1)                      i_oa - ------------- = 0
Rf
(%i2) eq_in_pos : (in_pos - 0)/Rg - (vin2 - in_pos)/R2 = 0;
in_pos   vin2 - in_pos
(%o2)                     ------ - ------------- = 0
Rg          R2
(%i3) eq_in_neg : -(vin1 - in_neg)/R1 + (in_neg - vout)/Rf = 0;
in_neg - vin1   in_neg - vout
(%o3)                  ------------- + ------------- = 0
R1              Rf
(%i4) eq_in : in_pos - in_neg = 0;
(%o4)                         in_pos - in_neg = 0
(%i5) a : second(first(solve([eq_out, eq_in_pos, eq_in_neg, eq_in], [vout, in_neg, in_pos, i_oa])[1]));
Rf (vin1 R2 - Rg vin2 + Rg vin1) - Rg vin2 R1
(%o5)           - ---------------------------------------------
R1 R2 + Rg R1
(%i6) ratsimp(a, vin1);
vin1 (Rf R2 + Rf Rg) - Rg vin2 R1 - Rf Rg vin2
(%o6)          - ----------------------------------------------
R1 R2 + Rg R1
(%i7) ratsimp(a, vin2);
- Rf vin1 R2 + vin2 (Rg R1 + Rf Rg) - Rf Rg vin1
(%o7)          ------------------------------------------------
R1 R2 + Rg R1
(%i8) vout = -vin1*(Rf*(R2+Rg))/(R1*(R2+Rg));
Rf vin1
(%o8)                          vout = - -------
R1
(%i9) vout = vin2*(Rg*(R1+Rf))/(R1*(R2+Rg));
Rg vin2 (R1 + Rf)
(%o9)                      vout = -----------------
R1 (R2 + Rg)
(%i10) vout = -vin1*Rf/R1;
Rf vin1
(%o10)                         vout = - -------
R1
(%i11) vout = vin2*(Rg*(R1+Rf))/(R1*(R2+Rg));
Rg vin2 (R1 + Rf)
(%o11)                     vout = -----------------
R1 (R2 + Rg)
(%i12) Rf : 1;
(%o12)                                 1
(%i13) R1 : 0.25;
(%o13)                               0.25
(%i14) R2 : 0.1667;
(%o14)                              0.1667
(%i15) Vneg : -Rf/R1;
(%o15)                               - 4.0
(%i16) Vpos : (Rg*(R1+Rf))/(R1*(R2+Rg));
5.0 Rg
(%o16)                            -----------
Rg + 0.1667
(%i17)
Run Example
sublist([[1,2],[3,3]], lambda([x], first(x)!=second(x)));
(%o1)                                 []
(%i2)

Help for Second