0% found this document useful (0 votes)
10 views3 pages

F @ (X) Exp (X) - Exp (-2 X) +1 Akar Fzero (F, 0.5) Akar - 0.2812

The document contains code for solving several equations numerically using fzero and fsolve in MATLAB. It finds the root of non-linear equations, calculates the volume of a gas given temperature and pressure, and solves a system of two non-linear equations.

Uploaded by

amalia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

F @ (X) Exp (X) - Exp (-2 X) +1 Akar Fzero (F, 0.5) Akar - 0.2812

The document contains code for solving several equations numerically using fzero and fsolve in MATLAB. It finds the root of non-linear equations, calculates the volume of a gas given temperature and pressure, and solves a system of two non-linear equations.

Uploaded by

amalia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

>> f=@(x)exp(x)-exp(-2*x)+1;

>> akar=fzero(f,0.5)

akar =

-0.2812

>> %kasus kapasitas panas

cp=input('masukkan capasitas panas,kJ/kg.K= ')

f=@(T)cp-0.745+4737e-6*T-15.65/T^0.5;

T=fzero(f,50)

masukkan capasitas panas,kJ/kg.K= 2.5

cp =

2.5000

T =

59.1353

clc
R=0.082054; % L.atm/(mol.K)
a=1.360; % L^2.atm/(mol^2)
b=0.03138; % L/mol
T=450; % K
P=[1:10]; % atm
for i=P
f=@(V)(i+a./V.^2).*(V-b)-R*T;
Volume(i)=fzero(f,20);
end
[P' Volume']
ans =

1.0000 36.9189

2.0000 18.4567

3.0000 12.3027

4.0000 9.2257

5.0000 7.3795
6.0000 6.1488

7.0000 5.2696

8.0000 4.6103

9.0000 4.0975

10.0000 3.6872

>> f=@(x)(x*(1+x^2)*log(x)-x^2+1);

>> akar=fzero(f,0.5)

Exiting fzero: aborting search for an interval containing a sign change

because complex function value encountered during search.

(Function value at -0.14 is 1.2611-0.44844i.)

Check function or try again with a different starting value.

akar =

NaN

>> f=@(x)[2*x(1)-3*x(2)-exp(-2*x(1));-x(1)+4*x(2)-2*exp(-x(2))];

>> xo=[-3 -2];

>> X=fsolve(f,xo)

Equation solved.

fsolve completed because the vector of function values is near zero

as measured by the default value of the function tolerance, and

the problem appears regular as measured by the gradient.


<stopping criteria details>

X=

0.8607 0.5142

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy