{
ses_path_t* child;
ScfEcomponent* c;
+ ScfEcomponent* B;
ScfEline* el;
ScfEpin* p0;
ScfEpin* p1;
+ ScfEpin* Bp;
+ ScfEpin* Bn;
ScfEpin* p;
ScfEpin* pb;
int j;
int k;
+ B = f->components[0];
+ Bp = B->pins[SCF_EDA_Battery_POS];
+ Bn = B->pins[SCF_EDA_Battery_NEG];
+
p0 = path->pins->data[0];
p1 = path->pins->data[path->pins->size - 1];
if (!pc->aconst)
continue;
- p = path->pins->data[i - 1];
+ p = path->pins->data[i - 1];
double v;
double jv;
double pr;
double jpr;
- pr = p->pr - p0->pr;
- jpr = p->jpr - p0->jpr;
+ double _pr;
+ double _jpr;
+
+ __ses_path_pr(f, path, 0, i, NULL, &pr, &jpr);
+
+ pr += path->parent_r0;
+ jpr += path->parent_jr0;
ses_ir_u(&v, &jv, pc->a, pc->ja, pr, jpr);
- pc->v = p0->v - v;
- pc->jv = p0->jv - jv;
+ pc->v = Bp->v - v;
+ pc->jv = Bp->jv - jv;
if (pc->v < p1->v) {
- v = p0->v - p1->v;
- jv = p0->jv - p1->jv;
+ v = Bp->v - p1->v;
+ jv = Bp->jv - p1->jv;
- pr = pc->sr - p0->pr;
- jpr = pc->jsr - p0->jpr;
+ _pr = pc->pr + path->parent_r0;
+ _jpr = pc->jpr + path->parent_jr0;
- ses_ur_i(&pc->a, &pc->ja, v, jv, pr, jpr);
+ ses_ur_i(&pc->a, &pc->ja, v, jv, _pr, _jpr);
- pr = p->pr - p0->pr;
- jpr = p->jpr - p0->jpr;
+ scf_logi("i: %d, c%ldp%ld--c%ldp%ld, v: %lg, pc->v: %lg, pc->a: %lg, pr: %lg, _pr: %lg pc->pr: %lg\n",
+ i, p0->cid, p0->id, pc->cid, pc->id, v, pc->v, pc->a, pr, _pr, pc->pr);
ses_ir_u(&v, &jv, pc->a, pc->ja, pr, jpr);
- pc->v = p0->v - v;
- pc->jv = p0->jv - jv;
+ pc->v = Bp->v - v;
+ pc->jv = Bp->jv - jv;
}
el->v = pc->v;
el->jv = pc->jv;
el->a = pc->a;
el->ja = pc->ja;
-
+#if 0
p->v = el->v;
p->jv = el->jv;
p->a = el->a;
p0->a = el->a;
p0->ja = el->ja;
}
-
+#endif
__ses_path_dr_transistor(f, path, i, path->pins->size - 1);
scf_loge("i: %d, c%ldp%ld--c%ldp%ld, v: %lg, pc->v: %lg, pc->a: %lg, pr: %lg, pc->dr: %lg\n",