S
S
StartPy2021-03-07 13:52:19
MATLAB
StartPy, 2021-03-07 13:52:19

How to solve an equation with three variables?

I have an equation with three variables xyz
I have written it as

function F=root2d(x)
F(1) = (0.0024*x*(1-x)+0.2132*x*z/(1+z)-0.0287*x*y);
F(2) = ((-0.0018)*y*(1-y)+(-0.0426)*y*z/(1+z)+0.0046*x*y);
F(3) = (0*z*(1-z)+0.0259*z*x/(1+x)+(0.0082)*z*y/(1+y));

I need to solve it by equating F-ki to 0
[email protected];
Тут должно быть решение, которое покажет x y z, но я не знаю как его записть...

Help me please)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Galkin, 2021-04-15
@gorgonik

clear,clc
fun = @root3d;
x0 = [2 2 2];
x = fsolve(fun,x0,optimoptions('fsolve','Display','none'))

function F=root3d(x)
    F(1) = (0.0024*x(1)*(1-x(1))+0.2132*x(1)*x(3)/(1+x(3))-0.0287*x(1)*x(2));
    F(2) = ((-0.0018)*x(2)*(1-x(2))+(-0.0426)*x(2)*x(3)/(1+x(3))+0.0046*x(1)*x(2));
    F(3) = (0*x(3)*(1-x(3))+0.0259*x(3)*x(1)/(1+x(1))+(0.0082)*x(3)*x(2)/(1+x(2)));
end

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question