# Thread: Gilat g285x04 and g285x07

1. ## Gilat g285x04 and g285x07

g285x04: Make a 3-D surface plot and a 3-D contour plot of the function z=4*sqrt((x^2/2)+(y^2/2)+1) in the domain -2<=x<=2 and -2<=y<=2.

g285x07: The van der Waals equation gives a relationship between the pressure p (in atm), volume V (in L), and temperature T (in K) for a real gas: P = (nRT)/(V-b) - (n^2*a)/(v^2) where n is the number of moles, R = 0.08206 is the gas constant, and a and b are material constants. Consider 1.5 moles of nitrogen (a=1.39 , b=0.03913). Make a 3-D plot that shows the variation of pressure( dependent bariable, z axis) with volume (independent variable, x axis) and temperature (independent variable, y axis). The domains for the volume and temperature are: 0.3<=V<=1.2 L and 273<=T<=473.

2. Originally Posted by LCuba

g285x04: Make a 3-D surface plot and a 3-D contour plot of the function z=4*sqrt((x^2/2)+(y^2/2)+1) in the domain -2<=x<=2 and -2<=y<=2.
Code:
x=[-2:0.2:2];
y=[-2:0.2:2]

[X,Y]=meshgrid(x,y);
Z=4*sqrt(X.^2/2+Y.^2/2+1);

surf(X,Y,Z);
CB

CB

3. ## Thank you!

Thank you for helping me with g285x04. Now all I need is the g285x07 problem! =]

4. Originally Posted by LCuba
Thank you for helping me with g285x04. Now all I need is the g285x07 problem! =]
You should be able to work out how to do the second from the solution to the first.

CB