Problems with Solving a Complex System of Two Equations

6 Ansichten (letzte 30 Tage)
Michael
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
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 ?
Michael
Michael am 18 Jan. 2014
I have the student version of R2007a, so the symbolic math toolbox is based on the Maple kernel. Most certainly I have the basic toolkit, though I do not know how much of the extended toolkit it contains. Finally, I do not own any version of Maple as a stand-alone product.
The real problem for me is getting help with an older, less capable version of the software. I'm not currently within a window to get a new version of the student software, nor am I financially capable of getting the full version of the product.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
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
  1 Kommentar
Michael
Michael am 24 Jan. 2014
Thank you, Walter.
I want to state that using MATLAB to reduce the system of two equations with two variables to one equation of one variable was a tremendous help. However, fsolve is NOT an appropriate operation with MATLAB in this instance, at least not R2007a. Once solving for the proper intercept (~13.2244), all other necessary figures can be solved for. The biggest issue in this instance is that my machine was not capable of solving the operation. Fortunately, I had a connection which was able to help me in that regard.
-Michael

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Bruno Pop-Stefanov
Bruno Pop-Stefanov am 17 Jan. 2014
You can solve a system of equations and specify the range of the solutions using vpasolve.
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.
  1 Kommentar
Michael
Michael am 20 Jan. 2014
I like your answer in theory, but vpasolve is not a function which R2007a can use - too old, I guess. :) ...Is there another way of limiting the range over which I can evaluate a set of symbolic variables?
I'm also going to assume your computer is far newer and more capable than mine. I have at most 2GB of RAM and a 1.6GHz processor.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by