You are on page 1of 5

UNIVERSIDAD AUTÓNOMA DE NUEVO LEÓN

FACULTAD DE CIENCIAS QUÍMICAS


INGENIERÍA AMBIENTAL
MÉTODOS COMPUTACIONALES
GRÁFICAS

The following problems should be solved by writing a program in SciNotes file and then executing the file. Paste the
program here and include screenshots of the results of each problem.

Name: Group: Date:

1. Plot the function f(x)=x3-2x2-10sin2x-e0.9x and its derivative for -2 £ x £ 4 in one figure. Plot the function with a solid
line, and the derivative with a dashed line. Add a legend and label the axes.

/*
Diego Gómez Chirinos
1969800
Clase: 22/08/2023
Ejercicio 1
*/

clear,clc
//Variables
x = linspace(-2,4,50)

//Procedimiento
y = x.^3-2*(x.^2)-10*(sin(x)).^2-exp(0.9*x)

//Impresión

plot(x,y,"-dcyan",xlabel("x"),ylabel("f(x)"))
2. Make two separate plots of the function f(x)=-3x 4+10x2-3, one plot for -4£ x £ 3 and one for -4£ x £ 4.

/*
Diego

Gómez

Chirinos
1969800
Clase: 22/08/2023
Ejercicio 2
*/

clear,clc

//Variables
x1 = linspace(-4,3,50)
x2 = linspace(-4,4,50)

//Procedimiento
y1 = -3*x1.^4+10*(x1.^2)-3
y2 = -3*x2.^4+10*(x2.^2)-3

//Impresion
subplot(2,1,1),plot(x1,y1,"-^cyan"),xlabel("x1"),ylabel("y1"),legend("-
4<=x<=3")
subplot(2,1,2),plot(x2,y2,"-^blue"),xlabel("x2"),ylabel("y2"),legend("-
4<=x<=4")
3. A parametric equation is given by:

x=sin(t)cos(t), y=1.5cos(t)

Plot the function for – £ t £ . Format the plot such that the both axes will range from -2 to 2.

4. Plot the function f(x) = (x 2+3x-5)/(x2-3x-10) for -4 £ x £ 9. Notice that the function has two vertical asymptotes. Plot
the function by dividing the domain of x into three parts: one from -4 to near the left asymptote, one between the two
asymptotes, and one from near the right asymptote to 9. Set the range of the y axis from -20 to 20.

5. The shape of the pretzel shown is given by the following parametric equations:

x=(3.3 – 0.4 t2)sin(t) y= (2.5 – 0.3t2)cos(t) where -4 £ t £ 3. Make a plot of the pretzel.

6. Make a polar plot of the function r=2sin(3)sin for 0 £  £ 2.

7. The ideal gas law relates the pressure P, volume V, and temperature T of an ideal gas:

PV= nRT
where n is the number of moles and R = 8.3145 J/(K. mol). Plots of pressure versus volume at constant temperature are
called isotherms. Plot the isotherms for one mole of an ideal gas for volume ranging from 1 to 10 m 3, at temperatures of
T = 100, 200, 300, and 400 K (four curves in one plot). Label the axes and display a legend. The units for pressure are Pa.

8. The position x as a function of time of a particle that moves along a straight line is given by:

x(t) = (-3 + 4t)e-0.4t ft

The velocity v(t) of the particle is determined by the derivative of x(t) with respect to t, and the acceleration a(t) is
determined by the derivative of v(t) with respect to t.

Derive the expressions for the velocity and acceleration of the particle, and make plots of the position, velocity, and
acceleration as functions of time for 0 £ t £ 20 s. Use the subplot command to make the three plots on the same page
with the plot of the position on the top, the velocity in the middle, and the acceleration at the bottom. Label the axes
appropriately with the correct units.

Dra. Nancy Elizabeth Dávila Guzmán

You might also like