Finding solution of intersection contour and points of three implicit functions
3 次查看(过去 30 天)
显示 更早的评论
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.
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 个评论
Torsten
2023-6-9
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.
回答(1 个)
Karan Singh
2023-8-29
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!