Plotting system of equations for a phase diagram

Currently I am struggling to graph a phase diagram similar looking to the attached photo. I have two equations, which depend on two variants of X (one for each line on the graph, respectively called x_1 and x_2. The formulas look like so
Equation 1: ln(x_1/x_2)=2070(1/T-1/1726)
Equation 2: ln((1-x_1)/(1-x_2))=1580(1/T-1/1357)
It should be possible to solve for x_1 and x_2 then overlay two graphs, one being x_1 on the x-axis and T on the y-axis, and the other with x_2 on the x-axis and T on the y-axis. The bounds for the graph are 0<x<1 and 1357<T<1726. Thank you so much for your help!

2 Comments

Hi Eric,
In the first equation, the maximum possible value of the rhs is at T = 1/1357: 10*(1/1357-1/1726) = .0016
so log(x1) - log(x2) = .0016 or less. That's a really small amount, so x1 and x2 will always be very near each other in value and the two curves will almost be overlays. Qualitatively that is a lot different than the plot above. Are you positive about the 10 and 9.6?
Oh you are right! I misread my own work. The values have been updated, it should be a factor of 2070 for the first equation and 1580 for the second equation. Sorry about that!

Sign in to comment.

 Accepted Answer

Hi Eric,
let T1 = 1357; T2 = 1726; T = T1:T2;
if you exponentiate both sides of each equation, you get
x1/x2 = f
(1-x1)/(1-x2) = g
where
f = exp(2070*(1./T- 1/T2));
g = exp(1580*(1./T -1/T1));
Solve for x1 and x2 in terms of f and g, then plot(x1,T,x2,T).
f and g are vectors, so calculating x1 and x2 requires element-by-element operators such as ./ .

More Answers (0)

Categories

Find more on Number games in Help Center and File Exchange

Products

Release

R2020a

Community Treasure Hunt

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

Start Hunting!