How to solve the equation of this identity to obtain the specific values of coefficients A, B, and C?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
% Clear all variables
clear all;
close all;
clc;
% Define symbolic variables
syms x y k m A B C x0 y0 a b ln;
% Define the line equation
line = y == k*x + m;
% Define the equation eq
eq = A*((y - y0)/(x - x0))^2 + B*((y - y0)/(x - x0)) + C == 0;
% Define the line l1
l1 = y - y0 == k*(x - x0) + m - y0 + k*x0;
% Define the line l2
l2 = (y - y0 - k*(x - x0))/(m - y0 + k*x0) == 1;
% Extract the left - hand side of l2
ln = lhs(l2);
% Define the left - hand side and right - hand side of the equation
leftSide = A*((y - y0)/(x - x0))^2 + B*((y - y0)/(x - x0)) + C;
rightSide = (((x - x0 + x0*ln)^2/a^2 + (y - y0 + y0*ln)^2/b^2 - (ln)^2)/(x - x0)^2);
% Solve the identity equation
sol = solve(leftSide == rightSide, [A, B, C], 'ReturnConditions', true);
% Display the result
disp('Result of solving the identity equation:');
disp(sol);
% Solve for A, B, C that hold for all x, y
assume(x, 'real');
assume(y, 'real');
eq2 = leftSide == rightSide;
sol2 = solve(eq2, [A, B, C], 'ReturnConditions', true);
% Display the result
disp('Result of solving for A, B, C that hold for all x, y:');
disp(sol2);
The code is as above, but the result obtained after running is not what I want. A, B, and C can only be expressed in terms of other parameters. Why does the result include z? How can I get the specific parameter values?
4 comentarios
Sam Chak
el 25 de Mzo. de 2025
Could you provide a geometric sketch of the lines? This would help us intuitively understand what you aim to solve.
Respuestas (1)
Sameer
el 10 de Abr. de 2025
Hi @Christopher
It looks like your symbolic solution is returning parameters 'z' and 'z1' because the system of equations is underdetermined, there are infinitely many solutions for 'A', 'B', and 'C' in terms of these parameters. To obtain specific values for 'A', 'B', and 'C', you need additional constraints or specific values for other variables.
Hope this helps!
0 comentarios
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!