Zeros to function of 2 variables, Matlab.

In summary, Matlab is a powerful software used for calculating zeros to function of 2 variables in various fields such as engineering, physics, and mathematics. To define a function of 2 variables in Matlab, the "syms" function is used to declare the variables and the "function" keyword is used to define the function. The "solve" function is used to find zeros of a function of 2 variables in Matlab. Matlab can handle complex numbers and therefore complex zeros of a function of 2 variables. However, there are limitations such as the function must be continuous and differentiable and it may not be suitable for extremely large or complex systems with a large number of variables.
  • #1
malawi_glenn
Science Advisor
Homework Helper
Gold Member
6,735
2,455
Hi!

I was wondering how you can find zeroes to a function of two variables. I use Matlab.

This is the function:

Z = 2*A.*(A+B).*(2*A+B)./(B.*B).*(0.25*A.^(-3)+4*(2*A+B).^(-3)+0.25*(A+B).^(-3))-14.44;

I know that A and B are positive. But I only know of inbuilt functions and algoritms for finding zeros for functions of ONE variable..

Do you guys know any?
 
Physics news on Phys.org
  • #2
Normally, you need two equations to minimize for two variables for a global solution.
 
  • #3


Hi there,

In Matlab, you can use the 'fsolve' function to find zeros of a function of two variables. This function uses a numerical method called the Newton-Raphson method to iteratively find the root of a function. Here's an example of how you can use 'fsolve' to find the zeros of your function:

% Define the function
fun = @(x) 2*x(1).*(x(1)+x(2)).*(2*x(1)+x(2))./(x(2).^2).*(0.25*x(1).^(-3)+4*(2*x(1)+x(2)).^(-3)+0.25*(x(1)+x(2)).^(-3))-14.44;

% Set initial guess
x0 = [1,1];

% Use fsolve to find zero
[x,fval] = fsolve(fun,x0);

% Display the results
disp(['The zeros of the function are A = ' num2str(x(1)) ' and B = ' num2str(x(2))]);
disp(['The value of the function at these zeros is ' num2str(fval)]);

Hope this helps!
 

What is the purpose of using Matlab for zeros to function of 2 variables?

Matlab is a powerful scientific computing software that allows for efficient and accurate calculations of zeros to function of 2 variables. It is commonly used in fields such as engineering, physics, and mathematics to analyze and model complex systems.

How do you define a function of 2 variables in Matlab?

To define a function of 2 variables in Matlab, you can use the "syms" function to declare the variables and then use the "function" keyword to define the function. For example, "syms x y; f = function(x,y) x^2 + y^2;" would define a function f with x and y as its variables.

What is the process for finding zeros of a function of 2 variables in Matlab?

The process for finding zeros of a function of 2 variables in Matlab involves using the "solve" function. This function takes the function and the variables as inputs and returns the values of the variables that make the function equal to zero.

Can Matlab handle complex zeros of a function of 2 variables?

Yes, Matlab has the capability to handle complex numbers and can therefore handle complex zeros of a function of 2 variables. You can use the "complex" function to create a complex number in Matlab.

Are there any limitations to using Matlab for finding zeros of a function of 2 variables?

There are some limitations to using Matlab for finding zeros of a function of 2 variables. One limitation is that the function must be continuous and differentiable in the given range of variables for the solver to work. Additionally, Matlab may not be suitable for extremely large or complex systems with a large number of variables.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
983
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
797
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
32
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
553
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top