Problems with Solving a Complex System of Two Equations
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Michael
am 17 Jan. 2014
Kommentiert: Michael
am 24 Jan. 2014
I am attempting to solve a geometric relation with regards to a geodesic dome. There are two principal relations which should allow the problem to be solved. One is a level-curve function, while the other relates the height of the dome. I will begin with the level curve:
(9*((175-(x^2))^0.5))+(9*((243-(y^2))^0.5))+(((175-(x^2))^0.5)*((243-(y^2))^0.5))+((2^0.5)*x*y) = (81+(162*(2^0.5)))
The others relate the height of the dome:
(x+(((x^2)+(18*((175-(x^2))^0.5)))^0.5)) = h
(y+(((y^2)+(18*((486-(2*(y^2)))^0.5))-162)^0.5)) = h
Therefore:
(x+(((x^2)+(18*((175-(x^2))^0.5)))^0.5)) = (y+(((y^2)+(18*((486-(2*(y^2)))^0.5))-162)^0.5))
Please be advised that I am using MATLAB R2007a, so my syntax for solving certain functions will differ slightly from the most recent version. This was my last attempt at solving the problem using the symbolic math toolbox:
syms x y
S = solve('(x+(((x^2)+(18*((175-(x^2))^0.5)))^0.5)) = (y+(((y^2)+(18*((486-(2*(y^2)))^0.5))-162)^0.5))', '(9*((175-(x^2))^0.5))+(9*((243-(y^2))^0.5))+(((175-(x^2))^0.5)*((243-(y^2))^0.5))+((2^0.5)*x*y) = (81+(162*(2^0.5)))', x, y)
...This input functions, but it takes a very long time to process. In fact, it takes more time to process than I am willing to allow. What I do know from calculations performed in Excel, however, is the precise range in which a single answer for this relation should exist:
13.218 < x < 13.228
15.456 < y < 15.49
Therefore, to reduce the calculation period, I want to specify the range over which MATLAB will evaluate the relations. I think I should be able to obtain the results I'm after if I can do that. Otherwise, would it be more proper to use a different set of functions or re-arrange the inputs into the "solve" function? I'm very curious to know.
...I'm hoping this is a simple problem to solve - I just don't know how to manage it myself!
Respectfully,
-Michael
2 Kommentare
Walter Roberson
am 17 Jan. 2014
Your MATLAB is using Maple for the symbolic engine, right? Do you also have the advanced symbolic toolkit that gives you access to all of Maple? Or do you happen to have a version of Maple ?
Akzeptierte Antwort
Walter Roberson
am 17 Jan. 2014
There are multiple solutions, not just one.
x ~= 9.689607824, y ~= 15.56382539
x ~= 13.22438421, y ~= 15.47340961
x ~= 13.22728311, y ~= 11.10236012
The first two are on the same branch for y, and the third one is on the other branch for y.
As an algorithm and not exact commands:
Below, lhs() and rhs() are "left hand side" and "right hand side" for an equation.
Let
P be 9*(-x^2+175)^(1/2)+9*(-y^2+243)^(1/2)+(-x^2+175)^(1/2)*(-y^2+243)^(1/2)+2^(1/2)*x*y = 81+162*2^(1/2)
Q be x+(x^2+18*(-x^2+175)^(1/2))^(1/2) = y+(y^2+18*(-2*y^2+486)^(1/2)-162)^(1/2)
Then
solve(Q,y)
which will result in two solutions, Y1 and Y2
Let T1 be simplify(subs y=Y1 into lhs(P)-rhs(P))
now you can plot T1 between -15 and +15 and see the way the function behaves. If you then narrow in to plot between 9 and 14 you should be able to see there are two zeros. You can then apply a root-finding algorithm. In Maple that would be fsolve:
XZ1 = fsolve(T1, x=8..10)
XZ2 = fsolve(T1, x=13..14)
Then
YZ1 = subs x = XZ1 into Y1
YZ2 = subs x = XZ2 into Y1
Likewise now
Let T2 be simplify(subs y=Y2 into lhs(P)-rhs(P))
and plot and zoom in, so
XZ3 = fsolve(T2, x=13.2..13.4)
YZ3 = subs x = XZ3 into Y2
Weitere Antworten (1)
Bruno Pop-Stefanov
am 17 Jan. 2014
In your case you would write the following, replacing eqn1 and eqn2 with each equation:
% init_guess is a matrix with 2 columns
init_guess = [13.2 13.3; % starting and ending point for x
15.4 15.6]; % starting and ending point for y
syms x y
S = vpasolve([eqn1, eqn2], [x, y], init_guess)
However, I solved your system under a minute on my computer without specifying the range and obtained the following solutions, with a warning that they might be bogus: see attached text file.
Siehe auch
Kategorien
Mehr zu Assumptions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!