How to get one variable from one equation?

  • Thread starter Thread starter johny2012
  • Start date Start date
  • Tags Tags
    Variable
johny2012
Messages
6
Reaction score
0

Homework Statement



In manufacture of nitric acid, ammonia and prehated air are mixed to form a gas containing 10 mole %NH3 at 650 C. If ammonia enters the gas blending unit at 25C at a rate o 520kg/? and heat is lost from the mixer to its surroundings at a rate of 7 kW, determine the temperature to which the air must be preheated.

Cpair(kg/molC) = 0.02854 + 0.4147x10^-5T + 0.3191x10^-8T^2 - 1.9665x10^-12T^3

Cpammonia(kg/molc) = 0.03515 + 2.954x10^-5T + 0.4421x10^8T^2 - 6.686x10^12T^3

Homework Equations



'0.02894 * (650 - T) + (0.4147 * 10.^-5 .*(650-T).^2) / 2 + (0.3191 * 10.^-8 *(650-T).^3)/3 -(1.965 *10.^-12 * (650-T).^4)/4'

I need to get the T from this equatio but I could not succeed.
I tried solve fnc and etc but no work.

Here is my full code in matlab
===========================

F = '0.03515 + 2.954 .*10.^-5 * t + 0.4421 .*10.^-*8 .t^2 - 6.686 .*10.^-12.*t.^3'
cp = '(0.03515 + 2.954 .*10.^-5 )* t + (0.4421 .*10.^-8) .*-t.^2 - (6.686 .*10.^-12).*t.^3'
integral = quad(cp,25,650)
% -7 -Q = nDH(for air)

Q = 520/17.*integral
nDH = -7 - Q %hava için Delta H değeri
nair = (27/17 * 100/10)*90/100;
knownIntegral= '0.02894 * (650 - T) + (0.4147 * 10.^-5 .*(650-T).^2) / 2 + (0.3191 * 10.^-8 *(650-T).^3)/3 -(1.965 *10.^-12 * (650-T).^4)/4'

I need to get T from here ??
at final step , I need one of the limits of an integral. I know the integral
Pleae I need help on this..
 
Last edited:
Physics news on Phys.org
The formula you wrote under heading 2 is not an equation. An equation must have an '=' sign in it somewhere, and your expression does not.

RGV
 
Last edited:
Hey Rey, thanks man

Yeah you are right that expression does not have, I have omitted it

but that one is equal to a sacalar valur, (nDH /nair) and I also tried it but as fas as I understand, MATLAB "solve" function works with at least two equations, but in my case I have one.

nDH /nair = -1.587 , and when I put it at right side of the equation

solve('0.02894 * (650 - T) + (0.4147 * 10.^-5 .*(650-T).^2) / 2 + (0.3191 * 10.^-8 *(650-T).^3)/3 -(1.965 *10.^-12 * (650-T).^4)/4 = -1.587')

Matlab gives this error

... is not a valid expression or equation.

I also tried [X] = solve(...) but no work.

I really need a hand on this man, please help to me.
 
johny2012 said:
Hey Rey, thanks man

Yeah you are right that expression does not have, I have omitted it

but that one is equal to a sacalar valur, (nDH /nair) and I also tried it but as fas as I understand, MATLAB "solve" function works with at least two equations, but in my case I have one.

nDH /nair = -1.587 , and when I put it at right side of the equation

solve('0.02894 * (650 - T) + (0.4147 * 10.^-5 .*(650-T).^2) / 2 + (0.3191 * 10.^-8 *(650-T).^3)/3 -(1.965 *10.^-12 * (650-T).^4)/4 = -1.587')

Matlab gives this error

... is not a valid expression or equation.

I also tried [X] = solve(...) but no work.

I really need a hand on this man, please help to me.

I don't have access to Matlab, but I tried it in Maple. When I entered your expression exactly as written (but removing the quotation marks), it failed:
eq1:=0.02894 * (650 - T) + (0.4147 * 10.^-5 .*(650-T).^2) / 2 + (0.3191 * 10.^-8 *(650-T).^3)/3 -(1.965 *10.^-12 * (650-T).^4)/4 = -1.587; <---- input
Error, `-` unexpected <----output
Maybe something similar is happening in Matlab.

However, when I removed the unnecessary decimal points and inserted the appropriate brackets, everything was fine:
eq2:=0.02894 * (650 - T) + (0.4147 * 10^(-5)*(650-T)^2) / 2 + (0.3191 * 10^(-8) *(650-T)^3)/3 -(1.965 *10^(-12) * (650-T)^4)/4 = -1.587; <--- input
eq:=0.02894 * (650 - T) + (0.4147 * 10^(-5)*(650-T)^2) / 2 + (0.3191 * 10^(-8) *(650-T)^3)/3 -(1.965 *10^(-12) * (650-T)^4)/4 = -1.587; <--- output
solve(eq2,T);
705.0484257, 2134.531785 + 3017.448181 I, -4539.336764, 2134.531785 - 3017.448181 I

Here, I = sqrt(-1) in Maple notation.

RGV
 
Ralyy thanks man, that one helped me but I have still problems..

I tried it with solve(eq2)
It does not accept T, just wrote eq2 as you wrote
and got nearly same result as you

-4539.3367635382526862930496142306
705.04842574482273638074048051504
3017.4481808788852152249093825028*i + 2134.5317855209728205880460002759
2134.5317855209728205880460002759 - 3017.4481808788852152249093825028*i

So, at his point I get confused..

what is the real value of T ? How many different values out there in those numbers ? Can you show me each one ? If in your case, each "," means a different value, that means 4 different value for the T ?? or these are just

Another question: What you say about first equation which works with quad.
can you also correct that one ?

The last and most important question ? If you look at the real question ,
what you say to solution ? I mean, is that normal to find one of the limit value of integral in this way ? Is there another solution for this ?

Thanks again man.
 
This is my final view of code for m-file

function[] = eq()
cpammonia = '(0.03515 + 2.954.*10.^(-5)).* t + (0.4421.*10.^(-8)) .* t.^2 - (6.686.* 10.^(-12)).* t.^3';
integral = quad(cpammonia,25,650);
Qa = (520/(17*10^-3))*integral
Qair = -25200-Qa;
nair=48842
%nDH = -7 - Qa %hava için Delta H değeri
%nair = (27/17 * 100/10)*90/100;
%'sonuc * nair = nDH
eqResult= Qair/nair
%Qair = nair*eq;
%eq= Qair/nair

integralequation ='0.02894 * (650 - T) + (0.4147 * 10^(-5)*(650-T)^2) / 2 + (0.3191 * 10^(-8) *(650-T)^3)/3 -(1.965 *10^(-12) * (650-T)^4)/4 = eqResult;
solve(integralequation)

integralequation2 ='0.02894 * (650 - x) + (0.4147 * 10^(-5)*(650-x)^2) / 2 + (0.3191 * 10^(-8) *(650-x)^3)/3 -(1.965 *10^(-12) * (650-x)^4)/4 -4.6479';
x0 = [ 1 500];
fzero(integralequation2,x0)
end

When I call file ew from MATLAB promt I get
ans =

- 0.00000000000049125*T^4 + 0.00000000021358333333333333333333333333333*T^3 + 0.00000290233125*T^2 - 0.032444109375*T + 19.891472013020833333333333333333

Then I insert those values to an array
a = [- 0.00000000000049125 0.00000000021358333333333333333333333333333 0.00000290233125 - 0.032444109375 19.891472013020833333333333333333]

a =
-0.0000 0.0000 0.0000 0.0324 19.8915
and call roots function with thi array
roots(a)

and get this values

ans =

1.0e+003 *

4.8369
-1.8781 + 3.0710i
-1.8781 - 3.0710i
-0.6460

I seen, there are real and complex roots. So, How can I find real value of T ??

Then I tried this way

I took the value from Qair/nair = 4.6479, to equation from right side to left side

integralequation2 ='0.02894 * (650 - x) + (0.4147 * 10^(-5)*(650-x)^2) / 2 + (0.3191 * 10^(-8) *(650-x)^3)/3 -(1.965 *10^(-12) * (650-x)^4)/4 -4.6479';

then I defined an value
x0 = [ 1 500];
fzero(integralequation2,x0)

ant that returned --> 491.3351
should I acceptthis value as an answer ? ı am really really get confused at tis point..
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top