'm getting this error Warning: Unable to find explicit solution.

syms To
dT_log=((To-Tg)-(Ti-Tg))/log((To-Tg)/(Ti-Tg)) %%%%%% log mean temperature
Q=m_dot*cp*(Ti-To) %%%%%Total heat transfer of water
Q2=dT_log/Rtotal%%%%% Total heat transfer of pipe
q=Q-Q2
solve(q,To)

Answers (2)

syms To
Ti=30; % example datas
Tg=50;
cp=20;
m_dot=5;
Rtotal=50;
dT_log=((To-Tg)-(Ti-Tg))/log((To-Tg)/(Ti-Tg)) %%%%%% log mean temperature
Q=m_dot*cp*(Ti-To) %%%%%Total heat transfer of water
Q2=dT_log/Rtotal%%%%% Total heat transfer of pipe
q=Q-Q2
vpasolve(q,To)
syms To Ti Tg m_dot real
dT_log=((To-Tg)-(Ti-Tg))/log((To-Tg)/(Ti-Tg)) %%%%%% log mean temperature
Q=m_dot*cp*(Ti-To) %%%%%Total heat transfer of water
Q2=dT_log/Rtotal%%%%% Total heat transfer of pipe
q=Q-Q2
Result=solve(q,To)
Gives:
dT_log =
-(Ti - To)/log((Tg - To)/(Tg - Ti))
Q =
20*m_dot*(Ti - To)
Q2 =
-(Ti - To)/(50*log((Tg - To)/(Tg - Ti)))
q =
(Ti - To)/(50*log((Tg - To)/(Tg - Ti))) + 20*m_dot*(Ti - To)
Result =
Tg - Tg*exp(-1/(1000*m_dot)) + Ti*exp(-1/(1000*m_dot))

3 Comments

clc
clear
close all
syms To
m_dot=0.5; %%%%water mass flow rate
z=1;%%%depth underground
Tg=300;%%%%ground temperature
Ti=350;%%%%inlet temperature
r=0.008;%%%%inner radius
L=200;%%%%%%pipe length
cp=4.18;%%%%%
Pr=2.1884;%%%%at water temp 350
u=0.0003677;%%%%dynamic viscosity
k=0.6;%%%%water thermal conductivity
kpipe=0.4;%%%%pipe thermal conductivity
ro=0.01;%%%%%pipe outer diameter
rho=997;%%%%density of water
A=pi*r^2;
v=m_dot/(rho*A);
Re=(rho*v*2*r)/u;
Nu=0.023*(Re^0.8)*Pr^0.3;
h=(Nu*k)/(2*r);
Rconv=1/h*(2*pi*r*L)
Rcond=log(ro/r)/(2*pi*kpipe*L)
S=(2*pi*L)/log((8*z)/(pi*2*r));
Rsoil=1/S
Rtotal=Rconv+Rcond+Rsoil%%%% total resistance
dT_log=((To-Tg)-(Ti-Tg))/log((To-Tg)/(Ti-Tg)) %%%%%% log mean temperature
Q=m_dot*cp*(Ti-To) %%%%%Total heat transfer of water
Q2=dT_log/Rtotal%%%%% Total heat transfer of pipe
q=Q-Q2
solve(q,To)
This is the full code I tried editing the way shown above but it gave me the same error. Thank you
Result=fsolve(matlabFunction(q),[0 50]) % change your last line to this
Gives:
Solver stopped prematurely.
fsolve stopped because it exceeded the function evaluation limit,
options.MaxFunctionEvaluations = 200 (the default value).
Result =
1.0e+02 *
3.0000 + 0.0000i 3.0000 - 0.0001i
Note: The results are complex because
q =
1463/2 - (1152921504606846976*(To - 350))/(6160701922836979*log(To/50 - 6)) - (209*To)/100
^^^^^---- is obviously less than 6 so the result
In theory To is supposed to be around 340K so I'm not sure whats wrong. Thank u for your time

Sign in to comment.

Categories

Asked:

HZ
on 8 Jan 2019

Edited:

HZ
on 8 Jan 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!