Insert symbolic equation in another symbolic equation
Show older comments
Hello i have the equation eq5 that has been solved and is now only a function of y. I want now to insert this function (r) inside eq6 and solve that, but it gives me an error. How can i solve this?
eq5 = hw2*(q-r)==y;
r = solve(eq5,r);
eq6 = @(y) sigma*eps*((r^4)-T_inf^4)-y;
y0=0;
sol = fsolve(eq6,y0);
8 Comments
KSSV
on 17 Apr 2023
Show us the full code.
Mirko Rizzi
on 17 Apr 2023
Your code is still incomplete, you need to give the values for variables.
Pr_g = (Cp_g*mu_g)/k_g;
hg = 0.023 * (k_g/((D(len-i+1))^1.8)) * (((4*m_dot_g)/(pi*mu_g))^0.8) * (Pr_g^0.33);
hw1 = kw1/tw1;
hw2 = kw2/tw2;
syms x y z p s r
eq1 = hg*(Tc-x)==y;
x = solve(eq1,x);
eq2 = hw1*(x-z)==y;
z = solve(eq2,z);
eq3 = p*(z-Tl)==y;
p = solve(eq3,p);
eq4 = p*(Tl-s)==y;
s = solve(eq4,s);
eq5 = hw2*(s-r)==y;
r = solve(eq5,r)
eq6 = @(y) sigma*eps*((r^4)-T_inf^4)-y
y0=0;
q = fsolve(eq6,y0);
Mirko Rizzi
on 17 Apr 2023
Mirko Rizzi
on 17 Apr 2023
Dyuman Joshi
on 17 Apr 2023
Why not define eq6 as a symbolic expression like you have done for other eq and use solve?
Mirko Rizzi
on 17 Apr 2023
Edited: Mirko Rizzi
on 17 Apr 2023
Mirko Rizzi
on 17 Apr 2023
Accepted Answer
More Answers (0)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!