Equation not formatting properly

Hello,
I inputted this equation into MATLAB
Temp = (T - Te)/(Tb - Te) == (cosh(B*(L - x))) + (Hc)/((B*k)* ...
sinh(B*(L - x)))/(cosh(B*L) + (Hc)/((B*k)*sinh(B*L)));
but the equation seems to produce
/ Hc \
B k sinh(B L) | cosh(B (L - x)) + ------------------- |
T - Te \ B k sinh(B (L - x)) /
------- == -------------------------------------------------------
Tb - Te Hc + cosh(B L)
where B k sinh(B L) should be on the bottom as Hc/(B k sinh(B L) + cosh(B L).
I think all the parenthesis are orrect so I'm not quite sure why it isn't being formatted properly. Does anyone know why this is resulting in this format?

5 Comments

How did you input the equation?
Looks fine to me this way -
syms T Te Tb B L x Hc k
Temp = (T - Te)/(Tb - Te) == (cosh(B*(L - x))) + (Hc)/((B*k)* ...
sinh(B*(L - x)))/(cosh(B*L) + (Hc)/((B*k)*sinh(B*L)))
Temp = 
Here is the full code I used for my script. I ended up getting a huge number as my answer so I thought there mightbe something wrong with the code.
%Question 9
syms T Tb Te L D P Ac k Hc B x;
%Equation
Temp = ((T - Te)./(Tb - Te) == ((cosh(B.*(L - x))) + (Hc)/((B.*k).* ...
sinh(B.*(L - x))))./((cosh(B.*L) + (Hc))./((B*k).*sinh(B.*L))));
pretty(Temp)
%Variables
Tb = 200;
Te = 20;
L = 8 * .01;
D = 5 * .001;
%B variables
P = (pi * D);
Ac = (pi * D.^2)/4;
k = 200;
Hc = 200;
%B equation
B = (Hc * P)/(k * Ac);
%input variable
x = 2 * .01;
%Equation
Temp = (T - Te)/(Tb - Te) == (cosh(B*(L - x))) + (Hc)/((B*k)* ...
sinh(B*(L - x)))/(cosh(B*L) + (Hc)/((B*k)*sinh(B*L)));
%solve
solx = solve(Temp, T);
solx
The answer came out as
solx =
63150623208878682931220
Here's the equation I've been trying to input:
Think I got it, thanks for the tip though! Forgot a parenthesis on the numerator.

Sign in to comment.

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Products

Release

R2022b

Asked:

on 15 Jan 2023

Commented:

on 15 Jan 2023

Community Treasure Hunt

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

Start Hunting!