z3 - Questions about using Z3Py online to solve problems in Transport Phenomena -


certain problem in transport phenomena solved using following code:

t_max, t_0, s, r, k, i, k_e, l, r, e, = reals('t_max t_0 s r k k_e l r e a') k = a*k_e*t_0 = k_e*e/l s = (i**2)/k_e eq = t_0 + s* r**2/(4*k) print eq equations = [ t_max == eq, ] print "temperature equations:" print equations problem = [ r == 2, l == 5000, t_0 == 20 + 273, t_max   == 30 + 273, k_e == 1, == 2.23*10**(-8), e > 0 ] print "problem:" print problem  print "solution:" solve(equations + problem) 

using code online obtain

enter image description here

this output gives correct answer there 2 issues in code: a) expresion named "eq" not simplified , necessary give arbitrary value k_e . question is: how simplify expression "eq" in such way k_e eliminated "eq"?

other example: determine radius of tube

code:

def inte(n,a,b): return (b**(n+1))/(n+1)-(a**(n+1))/(n+1) p_0, p_1, l, r, mu, q, c = reals('p_0 p_1 l r mu q c') k = (p_0 - p_1)/(2*mu*l) equations = [0 == -k*inte(1,0,r) +c, q == 2*3.1416*(-(k/2)*inte(3,0,r) + c*inte(1,0,r))] print "fluid equations:" print equations problem = [ l == 50.02/100, mu == (4.03*10**(-5)), p_0 == 4.829*10**5, p_1==0, q   == 2.997*10**(-3), r >0 ] print "problem:" print problem  print "solution:" solve(equations + problem) 

output:

fluid equations: [-((p_0 - p_1)/(2·mu·l))·(r2/2 - 0) + c = 0, q = 3927/625· (-(((p_0 - p_1)/(2·mu·l))/2)·(r4/4 - 0) + c·(r2/2 - 0))] problem: [l = 2501/5000, mu = 403/10000000, p_0 = 482900, p_1 = 0, q = 2997/1000000, r > 0] solution: [r = 0.0007512843?, q = 2997/1000000, p_1 = 0, p_0 = 482900, mu = 403/10000000, l = 2501/5000, c = 3380.3149444289?] 


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -