Tuesday, 15 April 2014

How to solve set of equations Matlab -


I have a set of equations that define the system. I do not know how to do this in Matlab, the fact Apart from that it is possible, and iterations are required.

I have three unknown ( Q , T_a_out and T_b_out ).

The system is divided into several sub-parts, information about temperature in the first and last sub-sections should be used to find the temperature in the sub-parts in the middle. I need Q , T_a_out and T_b_out

for each sub-section

The equations used to describe the system are as follows:

  Q = U * ((T_a_out-T_b_in) + (T_a_in-T_b_out)) / 2Q = m_a * (cp_a_in * T_a_in-cp_a_out * T_a_out) Q = m_b * cp_b * (T_b_out-T_b_in)  

This parameter is known:

  Initial T_a_in (110) Initial T_b_in (5) U m_a m_b n (number of sub-parts) cp_b  

CP one element of the price temperature For he is related to roh:

  cp_a_in has a function of temperature: cp_a_in = function_a (T_a_in) cp_a_out is a function of temperature: cp_a_out = function_a (T_a_out)   one  value (110), the value of  b_out  is more important than the last sub-section final  a_out  value Begins the lower value of the initial  b_y  value (5) 

How do I calculate outside Temperature for each sub-section in Matlab?

Based on your comments, I have put together a quick script that you should start in the right direction - In addition to some notes

The first thing that you are trying to solve is unnecessary, especially the CP (T) is highly non-existent and near the critical point above that deviation .

In addition, assuming that H = CPDT, and you are using REFPROP, a more accurate calculation will be H (T_out) -. H (T_in) which includes temperature effects

It is being said that by writing your collective balance you can prepare a system of non-linear equations to solve as follows. Since I could not solve the use of your UA , I therefore replaced it with "effect factor". Use your congressional option to fill it (say, NTU).

I caution you that what I posted below is incomplete and this is a starting point and there are some problems to consider:

I am specifying the n-2 specifying the temperature variable while the n equations mean that the boundaries are likely to be satisfied as Ta_end = Tb_end (you will see That's what I mean if you run it and plot it). This is probably the reason for an imbalance in temperature as a function of the stage.

Depending on your pressure and fluid, if you are going through 1 order phase transition then you may experience some strange numerical issues.

If you can absorb continuous heat capacity, then you can change the matrix very easy and in the solvable system. I offer this more complex example as a starting point.

  function Tf = gen_mat n = 10; Number of steps A = zero (n, 2 * n + 2); % Coefficients matrix m = 10; Mass flow of% ABB = 5; B F.F.T = mass flow of 1.0; % Effectiveness factor to (1) = 383.15; Entrance of% A T (2) = 278.15; B their TTP = 15000; % P (KPa)% Estimate TI = Linspace (TE (1), TE (2), N + 1) '; Tg = zero (2 * n + 1,1); I for = 1: n + 1 Tg (2 * i-1) = ti (i); TG (2 * I) = TI (I); End Tg ([1,2 * n + 1]) = []; % We are only interested in middle classes to build% coefficient matrix for = 1: na (i, 2 * i-1) = -ma; A (i, 2 * i) = eff * mb; A (i, 2 * i + 1) = ma; A (i, 2 * i + 2) = -Eff * mb; Solve the system of end% nonlinear equations Tf = fsolve (@ (T) obj_fxn (T, A, P, Te), Tg, optimset ('Display', 'iter')); TF = [TE (1); TF; To (2)]; % Adding the end temperature B = obj_fxn (T, A, P, TE) T = [TE (1); T; To (2)]; I = 1: 2 for: length (t) -1 x (i) = refropamp ('h', 't', t (i), 'p', p, 'co2'); X (I + 1) = Refropome ('H', 'T', T (I + 1), 'P', P, 'Water'); End b = a * x ';  plot (0: 10, Tf (1: 2: end) -273,10: -  

You can make the above mentioned crude plot after running it: 1: 0, TF (2: 2: end) -273) .

Sorry it's not too organized, but I hope it will be helpful.


No comments:

Post a Comment