Solve a set of equations

In my app I need to solve a set of 3 equations. But I really struggle, because these 3 equations contain 4 unknown. So the result would be some function of a fith variable.

Very simple Example:
u = cos(s)
v = sin(s)
1 = t

I really don‘t know a method how to solve it. I think it can‘t be solved numerically ,because the result is a function. I thought about to convert the this functions into Fourier series and solve than the set of equations. But I am not sure if this works either. Does anyone know any framework for this. I have looked on the the internet but found nothing.

Replies

Does uu + vv = 1 or uu + vv = t help?

u and v are points on a unit circle on the u and v axes.

  • I made a comment to the answer below. I hope it is more clear now.

Add a Comment

What are the unknown ? u, s, v, t ?

If so, no way to solve. What are you really searching for ?

  • As formulated, t is totally independent here, and it is already known !

Note: I usually write t = 1 and not 1 = t

  • If you know any of u, v, you essentially know the other (at some π value variation)
  • So I suspect there is some other information you did not provide.

Formulation is uncommon.

  • I very sorry. I wanted to give you an simple example but it was easy. New example: cos(u) = t ; sin(u) = 3 sin(s) ; v = 3 cos(s)

    u,v,s,t are the unknown.

    I want to know them all at a state. So I make three functions with one of them as the parameter. I hope it is more clear now.

Add a Comment

So I make three functions with one of them as the parameter. I hope it is more clear now.

Not so clear. What are the 3 functions ? The ones below ?

cos(u) = t ; 
sin(u) = 3 sin(s) ; 
v = 3 cos(s)

Equations 1 and 3 just set t and v directly. Unless you know something more on t or v.

Equation 2 let you write:

u = ArcSin(3 sin(s))

From 1 and 2, you get

t t + 9 sin(s) sin(s) = 1

But not much help.

Could you tell what those equation represent "physically" ?

I guess there is an information you are not exploiting. Otherwise, this cannot be solved.

  • This equations represent an inspection of two cylinders. The first equations was an intersection of a plane and a cylinder. So I want to intersect two parametric surfaces. Todo this the app has solve this set of equations.

Add a Comment

So you want to express all variables (except one) as a fonction of one var ? You do not want to solve.

Which var do you want to use as parameter ? t ?

if so

  • cos(u) = t ;
  • sin(u) = 3 sin(s) ;
  • v = 3 cos(s)

yields to:

  • u = arccos(t)
  • s = arcsin(sin(arccos(t))/3)
  • v = 3 cos ( arcsin(sin(arccos(t))/3) )

if you prefer to use u yields to:

  • t = cos(u)
  • s = arcsin(sin(u)/3)
  • v = 3 cos ( arcsin(sin(u)/3) )
  • Thanks.But the real challenge is to get the app to do it on its own. I am try to right a func with two faces as a parameter wich returns me this intersection. Assemblyman those equations out of the two surfaces is very easy. But how do I get my app solve them.

Add a Comment

You did not answer my questions, that makes discussion pretty hard:

  • So you want to express all variables (except one) as a fonction of one var ? You do not want to solve.
  • Which var do you want to use as parameter ? t ?Sorry, I cannot really understand the question.

You said:

func with two faces as a parameter 

What are exactly those 2 faces ? Planes ? Surfaces ? How are they defined ?

those equations out of the two surfaces is very easy.

Please show those equations

But how do I get my app solve them.

What do you mean exactly ?

  • I posted a aswer with more information. I hope is clear now.

Add a Comment

More Information

I want my programm to intersect two surfaces.

These surfaces are given in a prametric form. A Surface contains three mathematical functions. Those are x(u,v), y(u,v), z(u,v) . So for every u and v you can compute a point in 3D-Space. (When I set up my set of equations I above, I used s and t for the second face)

Some pseudo code so you can understand the Problem better. (When wrote that I want a func with two surfaces as the input I meant a function in my code)

func intersect(s1: Surface, s2: Surface) {
// The lines below are a mathematical notation 
s1.x = s2.x
s1.y = s2.y
s1.z = s3.z
// This created a set of three equations. (like the one I shared with you in a comment)
setofequations.solve() //Now the programm has to solve this set of equations
}

The really tricky part is that there are more parameteres than equations, so the result are mathematical functions for the unknown insteed of values.

I hope could explain my problem better.

  • Once solved, what should the intersect func return ?

Add a Comment

Intersect may be many things:

  • an empty intersect
  • a 1D intersect (like when 2 planes intersect)
  • a 2D intersect (if s1 = s2 for instance)

Which means resolution cannot be generic. It does depend on s1 and s2 equation.

It will also depend on what u, v are.

For instance, for a sphere, u and v could be longitude and latitude.

  • Or simply expressed as a constraint: x x + y y + z z = R R
  • then you intersect a plane ax + by + cz = d

So, this is a really complex problem, with no easy generic solution (except if you have a specific definition or each surface).

May have a look here, which points to interesting resources.

https://stackoverflow.com/questions/71157905/intersection-of-parametric-surfaces

And specially this:

https://web.mit.edu/hyperbook/Patrikalakis-Maekawa-Cho/mathe.html

with §5.8 for surface / surface intersection

https://web.mit.edu/hyperbook/Patrikalakis-Maekawa-Cho/node99.html

Good luck.

  • I am looking for a 1D Intersect. It is for much easier to convert the user input to parametric form. I totally know how to get to the system of equations. Like I said before the real challenge is to solve the system of equations. That is also why I called the question ,, Solve a set of equations“ and not „ Surface intersection“.

  • Thanks. I had short walk. I think I may came up with a solution. If I am right I could set one of these unknown and then solve numerically for the others. Then change the make step with same one solve again.

    Thanks for the links. It‘s quiet funny that the first one is my own question on stackoverflow. It is one of the few topics which are covered very poorly. Thanks.

    The solution I thought I had found is not completely satisfying. I am sure I will find. My be I can make my life easier with specific definitions. Thanks for that idea.

  • So you had seen the answer on SO, and seen the answer there was essentially same as mine: no generic solution to solving. Note: if you set one of the unknown, you will not explore the whole surface and will probably fall out of the intersection. But if that fits your needs, that's OK? Good luck.