Finding solution of intersection contour and points of three implicit functions
10 views (last 30 days)
Show older comments
I have three complex implicit functions with 4 variables (with sine and cosine functions as well as square roots involved) where:
f1 =f(x,y)
f2 = f(x,z)
f3 = f(y,z,w)
Putting them into explicit form can generate Matlab warning: possibly spurious solutions.
I first want to find contours of solutions that satisfy the condition:
f1 = f2 = f3 == 0;
Then, for a function V where V = f1^(2) + f2^(2) + f3^(2), I want to find points where all Jacobian terms of V equals to zero (i.e.
for
) . There should be a lot of points, or even contours of solutions, that satisfy this condition so fsolve function is not suitable.
for I have also tried the method suggested by Mike here:
It works well with 3 variables. However, I struggle to find a way to extend this approach to functions with 4 variables. Is there any methods I can use to solve this problem here?
3 Comments
Torsten
on 9 Jun 2023
Then, for a function V where V = f1^(2) + f2^(2) + f3^(2), I want to find points where all Jacobian terms of V equals to zero. There should be a lot of points, or even contours of solutions, that satisfy this condition so fsolve function is not suitable.
Why do you think so ? Setting the four partial derivatives to zero results in a system of 4 equations in 4 unknowns. Usually, only a discrete set of solutions exist - thus fsolve is adequate as solver.
Answers (1)
Karan Singh
on 29 Aug 2023
Hey Charles, here are a few suggestions to approach your problem:
- Symbolic Math Toolbox: Consider using the Symbolic Math Toolbox in MATLAB. You can define your equations symbolically, find the contours, and solve for the points where the Jacobian terms of “V” are zero. Here is a sample code where I have taken 3 equations found their contour solutions with “f1=f2=f3==0” and then defined the function of squares and found the Jacobian solutions.
syms x y z w
% Define the implicit equations
f1 = sin(x) + cos(y);
f2 = exp(x) - sqrt(z);
f3 = log(y) + w^2;
% Find contours of solutions
contour_solutions = vpasolve(f1 == 0, f2 == 0, f3 == 0, [x, y, z, w]);
% Define the function V
V = f1^2 + f2^2 + f3^2;
% Find points where Jacobian terms of V are zero
jacobian_terms = jacobian(V, [x, y, z, w]);
jacobian_solutions = vpasolve(jacobian_terms == 0, [x, y, z, w]);
- Numerical Optimization: Instead of solving for all the points simultaneously, you can use numerical optimization techniques to find individual points where the Jacobian terms of V are zero. For example, you can use optimization algorithms like “fmincon” or “lsqnonlin” to minimize the objective function that represents the sum of squares of the Jacobian terms. By setting appropriate constraints and initial guesses, you can guide the optimization algorithm to find the desired points.
I recommend exploring the suggested toolboxes, such as the Symbolic Math Toolbox and numerical optimization algorithms as they provide potential avenues to address your problem. I hope it helps !
0 Comments
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!