Pn_NA = reduceProduct(Pn_N,Pn_A,species)
p = -(ParDifferential(U,V))
T = ParDifferential(U,Sn)
mu = ParDifferential(U,n)
Cv = ParDifferential(U,T)
Cp = ParDifferential(H,T)
Sn = ExpandProduct(inv(T),subtract(H,ExpandProduct(inv(T),(reduceProduct(mu,n,species)))))
H = add(U,ExpandProduct(p,V))
lambda_ns = reduceProduct(lambda_s,Pn_N,species)
m = reduceProduct(lambda_ns ,n,species)
Fm_vv = Selection(Selection(Fm,node,node_v),arc,arc_v)
Fm_dd = Selection(Selection(Fm,node,node_d),arc,arc_d)
Fn = Fm 
Pn_Nc = Selection(Pn_N,node,node_conversion)
Nsn = reduceProduct(Ns ,Pn_Nc,species)
p_ref = Instantiate(p)
T_ref = Instantiate(T)
mu_ref = Instantiate(mu)
pi_T = ExpandProduct(inv(T_ref),T)
pi_p = ExpandProduct(inv(p_ref),p)
pi_mu = ExpandProduct(inv(mu_ref),mu)
c = inv(V)
pi_pv = Selection(pi_p,node, node_v)
pi_mud = Selection(pi_mu, node, node_d)
D_v = sign(reduceProduct(Fm_vv ,pi_pv,node_v))
B_v = Selection(B, arc, arc_v)
B_d = Selection(B, arc, arc_d)
fVp = ExpandProduct(K_v,ExpandProduct(B_v,(reduceProduct(Fm_vv,pi_pv,node_v))))
fVp = ExpandProduct(D_v,ExpandProduct(K_v,ExpandProduct(B_v,sqrt(abs(reduceProduct(Fm_vv,pi_pv,node_v))))))
Nnrs = reduceProduct(Pc_rnr,Nsn,conversion)
Pn_vv = Selection(Selection(Pn_NA,node,node_v),arc,arc_v)
s_v = ExpandProduct(half,(add(abs(Fm_vv),(ExpandProduct(Fm_vv,D_v)))))
cv = Selection(c,node,node_v)
ca = reduceProduct(cv,,node_v  &  species)
fn_v = fVp
Pn_dd = Selection(Selection(Pn_NA,node,node_d),arc,arc_d)
fn_d = B_d
xi_ns = reduceProduct(xi,Pc_rnr,conversion)
tnr = reduceProduct(Nnrs,xi_ns,node_conversion  &  conversion)
Fn_v = Selection(Fn,arc,arc_v)
Fn_d = Selection(Fn,arc,arc_d)
ndiff = reduceProduct(Fn_v,add(fn_v,reduceProduct(Fn_d,fn_d,arc_d  &  species)),arc_v  &  species)
ndiff = reduceProduct(Fn_v,add(fn_v,reduceProduct(Fn_d,add(fn_d,reduceProduct(Pnrn,tnr,node_conversion  &  species)),arc_d  &  species)),arc_v  &  species)
n = Integral(ndiff ,t ,t_0,t_e)
ntot = reduceProduct(e_NS,n,species)
pg = Instantiate(p)
pg = ExpandProduct(ntot,ExpandProduct(T,ExpandProduct(Rg,inv(V))))
fu = ExpandProduct(Bx,u)
fx = reduceProduct(Ax,x ,node  &  signal)
xdiff = reduceProduct(Nx,add(fx ,reduceProduct(Nu,fu,arc  &  signal)),arc  &  signal)
fn = inv(ntot)
pp = ExpandProduct(T,ExpandProduct(Rg,inv(V)))
pp = ExpandProduct(T,ExpandProduct(Rg,inv(V)))
