# Matlab Problem: Solving a code for four unknowns

A little bit long Matlab code that I just developed to solve for four unknowns. There are three files. One with the name "water-CO2 coexistence _curve1.m" which contains the main code equations. The other one which is "literature_H2O-CO2.m" contains the initial 4 guesses and also the fsolve function. The third one is a "findDifference_H2O_CO2.m" which is to show the 4 equality equations that needs to be satisfied in order to solve for the four unknowns. The specified variables are T and P. On the other hand the unknowns are: 2 different rau and 2 different [url removed, login to view] four equations are as follows:

1) P_res = P (vapor phase as function of T and x_c at the vapor phase; P is specified)

2) P_res = P (liquid phase as function of T and x_c at the liquid phase; P is specified)

3) chempt_w (vapor phase) = chempt_w (liquid phase) (function of T and x_c at liquid and vapor phase)

4)chempt_c (vapor phase) = chempt_c (liquid phase) (function of T and x_c at liquid and vapor phase)

Initial guess: raul (rau at liquid phase), rauv (rau at vapor phase), x_c (x_c at liquid phase), y_c (x_c at vapor phase).

I know that it will be confusing just reading the above paragraph. But, please have a look at the code and then we can discuss things out to make it clearer. The code is ALREADY DONE, however, I am facing errors while solving, probably because I have some small programming mistakes here and there.

Ready for giving out a good award for submitting good quality work.

Thanks.

Về Bên Thuê:
( 8 nhận xét ) Houston, United States

ID dự án: #1675184

## Được trao cho:

stephensmith0682

Ok. Had a look at it. Let us discuss. On Gtalk or Skype.

\$250 USD trong 1 ngày
(1 Nhận xét)
2.8

## 5 freelancer đang chào giá trung bình \$544 cho công việc này

MikroStar

hi, i can help.

\$720 USD trong 30 ngày
(38 Nhận xét)
6.4
zoltannagy

Hi. phd in engineering with extensive matlab and optimization experience. let's talk.

\$750 USD trong 7 ngày
(4 Nhận xét)
4.5
deepak19041991