Previous in Forum: Race Cars with No Drivers   Next in Forum: Rate
Close
Close
Close
54 comments
Rate Comments: Nested
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87

Solving System of Non-linear Equations

02/21/2024 2:36 PM

I'm almost at my wit's end with a math problem. Hopefully, someone here can point me in the right direction.

In doing some work in the optimum control theory area, I ended up with the six equations and six variables (K11, K12, K13, K22, K23, and K33) below. The terms Eq, Ef, q11, q22, and q33 will be chosen constant values and g is also a constant.

So far I've failed at getting a solution. I tried substitution (i.e. solving for K12 as a function of K13 in the 1st equation and then substituting that into other equations as well as starting with other equations) but the subsequent equations grow huge quite quickly. Is there an algorithm or method to treating such a problem? (FYI, this is not homework....it's work-work )

Also, what is the name of this general form of problem? I stated it as a system of non-linear equations in the title. If there is a more specific name then I may have better luck with internet searches using the proper name.

  1. (K12 * Ef)2 + (K13 * Eq) 2 = q11
  2. K11 – k12 * K22 * Ef2 – K13 * K23 * Eq2 = 0
  3. g * K12 + K12 * K23 * Ef2 + K13 * K33 * Eq2 = 0
  4. (K22 * Ef) 2 + (K23 * Eq) 2 – 2 * K12= q22
  5. K13 – g * K22 – K22 * K23 * Ef2 – K23 * K33* Eq2 = 0
  6. (K33 * Eq) 2 + 2 * g * K23 + (K23 * Ef)2 = q33

Thanks in advance.

__________________
J B
Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33392
Good Answers: 1817
#1

Re: Solving System of Non-linear Equations

02/21/2024 5:10 PM

You need to square the entire terms, not just the variables.

__________________
All living things seek to control their own destiny....this is the purpose of life
Register to Reply
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33392
Good Answers: 1817
#2
In reply to #1

Re: Solving System of Non-linear Equations

02/21/2024 6:04 PM
__________________
All living things seek to control their own destiny....this is the purpose of life
Register to Reply Score 1 for Good Answer
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33392
Good Answers: 1817
#3
In reply to #2

Re: Solving System of Non-linear Equations

02/21/2024 7:55 PM
  1. Identify the graph of each equation. ...
  2. Write both equations in standard form.
  3. Make the coefficients of one variable opposites. ...
  4. Add the equations resulting from Step 3 to eliminate one variable.
  5. Solve for the remaining variable.

https://pressbooks.bccampus.ca/algebraintermediate/chapter/solve-systems-of-nonlinear-equations-2/

__________________
All living things seek to control their own destiny....this is the purpose of life
Register to Reply
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33392
Good Answers: 1817
#6
In reply to #3

Re: Solving System of Non-linear Equations

02/21/2024 10:28 PM

__________________
All living things seek to control their own destiny....this is the purpose of life
Register to Reply
Power-User

Join Date: May 2011
Posts: 102
Good Answers: 2
#24
In reply to #3

Re: Solving System of Non-linear Equations

02/22/2024 2:43 PM

Two variables have a graph ..two equations may or may not intersect..

three variables have a plane ... three planes intersect in 3 lines ... if the lines intersect there's a solution.

four variables would have a moving set of planes as the 4th varied .. like time ... and I'm lost

hard to visualise 5 and 6 variables

Register to Reply Score 1 for Good Answer
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#5
In reply to #2

Re: Solving System of Non-linear Equations

02/21/2024 10:22 PM

The variable is K12, not K*12 which is how it appears Wolfram is interpreting it (from your link).

__________________
J B
Register to Reply
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33392
Good Answers: 1817
#9
In reply to #5

Re: Solving System of Non-linear Equations

02/21/2024 11:29 PM

Yeah I couldn't get it to work right, and didn't take the time to figure it out....

__________________
All living things seek to control their own destiny....this is the purpose of life
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#4
In reply to #1

Re: Solving System of Non-linear Equations

02/21/2024 10:19 PM

I’m not sure I follow. Mathematically, those are equivalent. Are you suggesting the first step is to take (K12*Ef)2 and make it K122 * Ef2?

__________________
J B
Register to Reply
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33392
Good Answers: 1817
#7
In reply to #4

Re: Solving System of Non-linear Equations

02/21/2024 10:50 PM

I'm looking at like a divide and conquer type situation, where we can find terms that can be eliminated by one means or another...I confess my math skills are not all they could be....but this should be easy enough...

__________________
All living things seek to control their own destiny....this is the purpose of life
Register to Reply
Guru
Engineering Fields - Nuclear Engineering - New Member

Join Date: Sep 2009
Location: Louisville, OH
Posts: 1925
Good Answers: 36
#8
In reply to #7

Re: Solving System of Non-linear Equations

02/21/2024 11:29 PM

Back in school (way, way back!) systems in 2 variables were easy. But the technique should work for 6 variables, but would be tedious and time-consuming. I never did much with matrix math; would that work?

__________________
Lehman57
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#16
In reply to #8

Re: Solving System of Non-linear Equations

02/22/2024 11:06 AM

Generally those subjects in school (high school and undergraduate college) cover systems of linear equations which aren't too difficult to handle even 6 equations and 6 unknowns. It's when they are non-linear that it gets difficult. A 2x2 was easy to do by hand.

__________________
J B
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#15
In reply to #7

Re: Solving System of Non-linear Equations

02/22/2024 11:02 AM

That's kind of the approach I took, see my response (#13) to Codemaster.

__________________
J B
Register to Reply
Guru

Join Date: Jul 2016
Posts: 1367
Good Answers: 105
#10

Re: Solving System of Non-linear Equations

02/22/2024 2:50 AM

On electrical power systems, involving voltage, current, reactive and real power flows through various impedances and generation models, I had the choice of Gauss-Siedel or triangular decomposition to solve the hundreds of simultaneous equations in a system. I could get convergence often with triangular decomposition, but some systems could only be solved with Gauss-Siedel, which took longer and used more computer time.

Another method I used to solve a system of simultaneous chemical equations describing pulp mill chemical generation was to enter the mass balance for each step in terms of the previous step, into Excel, creating circular references. With the equations were values of a particular starting condition. I changed one value, and all of the other values would change accordingly, acting as a model of the system. You can set up a tolerance in Excel for solution. The system had 14 or 15 equations, and was stable for most cases. But I could get to some limiting condition, and the values would skyrocket into ridiculous values. So I kept a copy of the equations with initial stable values in it, because once this limit was hit, just adjusting one number, the other values blew up and the system of solutions could not be recovered.

The electrical load flow solutions I think would be non-linear, the chemical equations are linear, for the most part, and describe a recirculating system of several chemical components.

You need to set up manual solution for the Excel sheet, and solve once the system is built, and set a convergence limit and reasonable number of iterations, like 5,000 or so.

Register to Reply Score 1 for Good Answer
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#17
In reply to #10

Re: Solving System of Non-linear Equations

02/22/2024 11:08 AM

I'll have to look into those methods. I'm not familiar with solving them iteratively.

__________________
J B
Register to Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#11

Re: Solving System of Non-linear Equations

02/22/2024 4:43 AM

Do you have Mathcad? I believe that can solve systems of equations. I might try it when I get a minute.

There could be more than one set of solutions, due to the square terms

__________________
Give masochists a fair crack of the whip
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#13
In reply to #11

Re: Solving System of Non-linear Equations

02/22/2024 10:37 AM

I do have Matchad 15 and have used it's symbolic math tools to try to solve for the K variables but substitution, but with limited success. By limited success, I mean when I got to where Mathcad should give me a solution for say K22 as a function of g, Ef, Eq, q11, q22, and q33, I get a Mathcad message stating, "The symbolic result returned is too large to display, but it can be used in subsequent calculations if assigned to a function or variable."

What I did was the following:

  1. Solve equation 5 for K13 so K13 = f(K22, K23, and K33) - I called this equation 7
  2. Solve equation 6 for K23 so K23 = f(K33) - I called this equation 8
  3. Substitute equation 8 into equation 7 to get K13 = f(K22, K33) - I called this equation 9
  4. Substitute equation into equation 1 and solve for K12, so K12 = f(K22, K33) - I called this equation 10
  5. Substitute equations 10, 9 and 8 into equation 3 and solve for K33 (or could be K22), so K33 = f(K22) or K22 = f(K33) - I called this equation 11
  6. Substitute equations 10 and 8 into equation 4 and solve for K33 (or could be K22), so K33 = f(K22) or K22 = f(K33) - I called this equation 12

So it worked through equation 10, it was equation 11 and 12 where the results were too large for Mathcad to display. At each of the above steps, results display got larger and larger. For instance, K12 equals what's shown below (I realize the image is unreadable but I think you can get the idea of how large the equation is at the step before getting an actual expression for K22 and K33 as a f(g, Ef, Eq, q11, q22, q33).

And it's even more complex as the image I provided above is only one of two results for K12 as there is another solution that's preceded by a minus sign due to K12 being squared in equation 1, so Eq 11 and 12 would have solutions based on both of those results.

__________________
J B
Register to Reply Score 1 for Good Answer
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#18
In reply to #13

Re: Solving System of Non-linear Equations

02/22/2024 11:22 AM

I have Mathcad 14. I didn't use symbolic, just the Find function, where you enter guess values for the unknowns, and type Given. Find gives a column vector of results.

I made a pdf but can't get it to add here. I have attached docs before but it's years ago and I can't remember how I did it, if you can advise.....?

But if you give me the constants and guess values, I can run it again and type the results.

__________________
Give masochists a fair crack of the whip
Register to Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#12

Re: Solving System of Non-linear Equations

02/22/2024 6:17 AM

I put it into Mathcad and it works, using completely arbitrary values for your constants.

Also need to enter guess values for the variables.

It's best to make the guesses close to what you expect the solution to be (if you have any idea) as there's likely to be more than one solution and otherwise Mathcad might find the wrong one.

If you give me that and the values for the constants I'll run it again. It's fun!

I doubt I'll be able to send a live Mathcad file, but I can pdf it.

__________________
Give masochists a fair crack of the whip
Register to Reply Score 1 for Good Answer
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#14
In reply to #12

Re: Solving System of Non-linear Equations

02/22/2024 10:59 AM

I'm curious how you are solving in Mathcad. You mentioned making an initial guess, so it sounds like you are using an iterative process to get the solutions. I am not clear on what that would look like.

As far as making an initial guess that's close to expected...I have no idea what a close guess would be, not even an idea of the order of magnitude.

At this point, the constants are:

Ef = 69.496

Eq= 5

q11 = 0.00025

q22 = 0.00017

q33 = 0.82054

g = 386.089

However, I'm looking for the solution to the K variables as a function of those since, it's likely they may change depending on how the system behaves.

I'd definitely be interested in seeing a pdf. I am not sure how to take what I've done in Mathcad and assign the non-displayable solution of K22 to a function or variable for it to be used later in the spreadsheet.

__________________
J B
Register to Reply Score 1 for Good Answer
Guru

Join Date: Jul 2016
Posts: 1367
Good Answers: 105
#19
In reply to #14

Re: Solving System of Non-linear Equations

02/22/2024 11:55 AM

Is this the kind of control problem that might have been solved with fuzzy logic or model based minimum variance multi variable control?

Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#22
In reply to #19

Re: Solving System of Non-linear Equations

02/22/2024 2:13 PM

I don't know enough about fuzzy logic to answer your question.

This is a nonlinear optimal tracking control problem. The solution matrix, K, is the positive definite (symmetric) is the solution to the Algebraic Riccati equation:

ATK + KA - KBR-1BTK +Q = 0

where A and B are matrices related to the system to be controlled and R and Q are related to design requirements. .

__________________
J B
Register to Reply
Guru

Join Date: Jul 2016
Posts: 1367
Good Answers: 105
#25
In reply to #22

Re: Solving System of Non-linear Equations

02/22/2024 3:36 PM

Fuzzy is more of an interative solution, but the model predictive control might be more of the approach that could work.

Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#26
In reply to #25

Re: Solving System of Non-linear Equations

02/23/2024 6:47 AM

Thanks.

__________________
J B
Register to Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#20
In reply to #14

Re: Solving System of Non-linear Equations

02/22/2024 12:03 PM

In my Mathcad manual it's under Systems of equations.

With those constants, I get

K11 = -0.112

K12 = -2.272*10^-4

K13 = 1.732*10^-4

K22 = 0.102

K23 = -0.077

K33 = 1.152

But the guess values I use were just that! If the above results look unrealistic and you can suggest a more likely set of guesses I'll run it again.

I'm still trying to attach something. I managed to attach a random photo, so I printed the pdf and scanned it, to get a jpg file, but so far I haven't got that to work.

__________________
Give masochists a fair crack of the whip
Register to Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#21
In reply to #20

Re: Solving System of Non-linear Equations

02/22/2024 12:49 PM

I thought I'd cracked the attaching, got it pasted here, but on preview it said something missing, and failed. So I've copied it in parts. You know what the equations are anyway.

Eq := 2 Ef := 3 q11 := 7 q22 := 5 q33 := 6 g := 10

Guess values

K11 := 2 K12 := 4 K13 := 5 K22 := 9 K23 := 7 K33 := 8

Given

Equations in here

Find(K11 , K12 , K13 , K22 , K23 , K33) =
−4.92
−0.758
0.677
0.56
−0.405
1.777

__________________
Give masochists a fair crack of the whip
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#27
In reply to #21

Re: Solving System of Non-linear Equations

02/23/2024 8:17 AM

I tried the "Find" function and got the same results as you did. Thanks for recommending that approach. I noticed in Mathcad's help on the Find function they state:

You can use the symbolic equal sign (->), by typing [Ctrl] [.], to display a result in a Solve Block. When using the symbolic equal sign, you do not need to supply guess values for the variables. You get an exact numeric result rather than a decimal result with your chosen degree of precision. Here's the same Solve Block, using -> for the results.

I tried that, but still provided the values for the constants (Ef, Eq, q11, q22, q33, and g) so it gave me actual values for the K variables. There are a total of 8 solution combinations, 4 different real solutions and 4 complex. However, when I left the constants as just their variable representations then Mathcad isn't able to display the results (probably because it's 8 expressions for the 6 Ks) and each of those expressions may contain up to 6 of the constants).

__________________
J B
Register to Reply Score 1 for Good Answer
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#30
In reply to #27

Re: Solving System of Non-linear Equations

02/23/2024 9:46 AM

I couldn't find that paragraph in Help, probably because I'm on version 14.

But I tried the symbolic route. The results were all complex, but the imaginary parts something like 10-30, so can be ignored. Don't know why Mathcad does that. The real parts were the same as before, except for differerent combinations of signs. I expect you could find the various signs using the standard Find, by putting in different guess values.

Are the calculated Ks something like what you would expect for your application? Which would you expect to be +ve and which -ve? You can choose accordingly, but not each independently. The symbolic calc helps you see the available combinations, ++-+--, -++--+ etc.

I can't find a way to get a symbolic result incorporating the constants as variables (if that makes sense!). I think you'll just have to use different ones and save the results.

__________________
Give masochists a fair crack of the whip
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#32
In reply to #30

Re: Solving System of Non-linear Equations

02/25/2024 3:16 PM

You stated: "Are the calculated Ks something like what you would expect for your application? "

I do not know what an expected value would be for this application. Unlike many control problems, this one doesn't have an easy analogous mass/spring/damper or inductor/capacitor/resistor configuration, at least not one that's apparent to me yet.

You stated: "I can't find a way to get a symbolic result incorporating the constants as variables (if that makes sense!)."

Yes, that does make sense. I struggled with similar wording in one of my replies. I think of those constants as problem dependent parameters. For a different problem q11, q12, q13, Ef, and Eq may (most likely) will be different. But the structure of the problem and thus the solution for the K matrix will be the same. If I have a numerical solution for for K11 based on a given q11, but don't know the actual relationship between the two, then I won't know how to computer K11 for a separate problem using a different value of q11.

__________________
J B
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#28
In reply to #20

Re: Solving System of Non-linear Equations

02/23/2024 8:45 AM

My previous reply to your post 21 when I said I got the same results as you, it was using your initial values of Ef, Eq, q11, q22, q33 and g, not the ones I provided. However, when I used the ones I provided (as you did in your post 20), I did not get the same results you did. What initial guesses for the K terms did you use? I used the same values as you did in your post 21 and then also tried with 1 as an initial guess for all of them. As a matter of fact, when I choose the values of K variables that you show above as my initial guess, I get a completely different set of results:

k11 = 0.00028

K12 = 7.449*10^-5

K13 = 0.00299

k22 = 7.688*10^-5

K23 = -0.00341

K33 = .36858

__________________
J B
Register to Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#31
In reply to #28

Re: Solving System of Non-linear Equations

02/25/2024 10:45 AM

Strange.

For my #21, I used guess values K11=2, K12=3, K13=7, K22=5, K23=6, K33=10.

I ran it again with those guesses, and got the #21 results again.

I also did it again with your values for Eq etc, and again got the results in #20.

I made a bit of progress on the symbolic front, leaving the constants undefined, For a quadratic a*x2+b*x+c=0, it gave 2 results in terms of a, b and c. So I did it with 2 simultameous quadratics, and it worked, giving 8 results.

But it wasn't keen with your set of equations. Leaving just one of the constants undefined it didn't give a result after several minutes, though it didn't give an error message.

__________________
Give masochists a fair crack of the whip
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#34
In reply to #31

Re: Solving System of Non-linear Equations

02/25/2024 3:52 PM

This is strange indeed.

I reran with your constants and guesses in #21 and got your results using

Find(k11, k12, k13, k22, k23,k33) =

However, when I try to have Mathcad solve it symbolically like this:

Find(k11, k12, k13, k22, k23,k33)->

I get the message (not an error message, btw) saying the results are too large to display.

But when I try solve with your guesses and my constants and your guesses using

Find(k11, k12, k13, k22, k23,k33) =

I don't get anywhere near your results, but get the ones I posted in #28.

You stated: "But it wasn't keen with your set of equations. Leaving just one of the constants undefined it didn't give a result after several minutes, though it didn't give an error message"

If you click on the symbolic symbol (the right pointing arrow) Mathcad displays the message that the results are too be to be displayed. So it does actually computer the results, but isn't able to display them.

__________________
J B
Register to Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#35
In reply to #34

Re: Solving System of Non-linear Equations

02/26/2024 5:05 AM

When I use symbolic, with values for the constants, I get 8 sets of 6 solutions, all complex but with negligible imaginary parts (as #30).

With undefined constants it didn't give a solution, after many minutes, but no error message. Leaving just one constant, q11 undefined (to make it easier) same result and eventually went unresponsive! Maybe it's a difference between Mathcad 14 and 15.

One thing, when using (non-symbolic) Find, I prefer to label the unknowns with a dash, K`11, K`12 etc with the Ks as solutions, otherwise you can confuse the solutions with the guess values.

Have you tried putting the doubtful solutions back into the equations, as a check?

__________________
Give masochists a fair crack of the whip
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#37
In reply to #35

Re: Solving System of Non-linear Equations

02/26/2024 7:30 AM

I get a similar 8 sets of 6 solutions, 4 that are real and 4 that are complex (2 complex and an identical 2 complex with the imaginary part having an opposite sign as the 1st two).

Have you tried clicking on the area around Find()-> when you don't get a solution (using undefined constants)? That's when the message box stating the solution is too large to display pops up (for me).

I haven't tried using different arguments in the FIND function. That seems counter intuitive to me as Mathcad should be looking for the variables in the argument that are also in the equations. I'll give that a try when I have time.

I haven't tried putting doubtful solutions back in, but I did try ones that I believe are legitimate.

__________________
J B
Register to Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#39
In reply to #34

Re: Solving System of Non-linear Equations

02/26/2024 11:27 AM

You said If you click on the symbolic symbol (the right pointing arrow) Mathcad displays the message that the results are too be to be displayed. So it does actually computer the results, but isn't able to display them.

Tried that, but it didn't happen on mine.

You said (#37) I haven't tried using different arguments in the FIND function. That seems counter intuitive to me as Mathcad should be looking for the variables in the argument that are also in the equations. I'll give that a try when I have time.

I first did it with the same arguments, but didn't evaluate the results numerically. I then tried to check the results by plugging into the equations, and the results were all over the place, so I thought something was wrong. I think it was using the guess values in the check. When I evaluated the Ks first, the check was OK. But did it again and it was OK first time. I still think it's safer to keep the guess values separate from the ones you're trying to evaluate.

__________________
Give masochists a fair crack of the whip
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#36
In reply to #31

Re: Solving System of Non-linear Equations

02/26/2024 7:20 AM

You stated: "I made a bit of progress on the symbolic front, leaving the constants undefined, For a quadratic a*x2+b*x+c=0, it gave 2 results in terms of a, b and c. So I did it with 2 simultameous quadratics, and it worked, giving 8 results."

I've found the symbolic stuff quite helpful, but it does seem to have its limitations. For one thing, there doesn't seem to be a way to assign the symbolic solutions to a function or variable to it can be used in subsequent equations. One must manually copy the solutions and insert them where they're to be used. There may actually be a way to do that, but I haven't found it yet.

__________________
J B
Register to Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#38
In reply to #36

Re: Solving System of Non-linear Equations

02/26/2024 9:40 AM

In the case of 2 quadratics, if you do the symbolic Find(x,y), you get a 4 x 2 matrix with the formulas.You can select any of the 8 formulas by using Find(x,y)[i,j

Then define the coefficients and you can evaluate each one. Or define a matrix M by copying and pasting, typing = and see them all at once. You can define a function by copying and pasting any of the formuls in the matrix.

Not sure whether that helps!

__________________
Give masochists a fair crack of the whip
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#42
In reply to #38

Re: Solving System of Non-linear Equations

02/26/2024 4:38 PM

Ahhh, I hadn't tried the Find(x,y)[i,j, that's good to know. That made me think about getting a column (one set of solutions) by using the Find(x,y)Ctrl+6 (this gives Find(x,y)<> that allows one to put a value or variable between the < and > symbols representing which column to select). So it looks like this for a 3 equations 3 unknowns problem:

Unfortunately, those still aren't as useful as being able to define a matrix M to equal to one solution set (i.e. M=Find(...)<j> where j is the jth set of solutions which would allow me to use M in later calculations instead of having to manually copy the results.

I tried the Find(x,y)[i,j and it works when all constants are given values, but just keeps calculating forever when I try to solve it symbolically. I was hoping that by only looking for a single solution (just one of the 8 K11's) the solution wouldn't be too large for Mathcad to display and I'd actually be able to look at the relationship between K11 and the constants. <sigh>

__________________
J B
Register to Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#45
In reply to #42

Re: Solving System of Non-linear Equations

02/26/2024 5:06 PM

Can you explain a bit more what the problem is? For a given set of constants (which must be based on something) you can find all 6 Ks. Can you use those values in the next stage of the calcualation or procedure? Of course if the constants change so will the Ks, but you have to start somewhere!

__________________
Give masochists a fair crack of the whip
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#46
In reply to #45

Re: Solving System of Non-linear Equations

02/27/2024 12:33 PM

This is for a cue shaping algorithm for a 6 degree of freedom synergistic motion system used in flight simulation. Classical motion cueing algorithms have been linear and do not optimize use of the motion platform envelop. For instance, the systems would be tuned (gains adjusted) so that large acceleration commands to do not result in the motion being driven into the actuator stops (not the mechanical end of stroke stop of the actuators, but a software stop a few inches before the end of stroke). When a system with linear cue shaping is tuned this way, smaller accelerations cues tend to be attenuated significantly and thus don't add much training value.

The idea of non-linear cue shaping algorithms is that small cues won't be made insignificant. The non-linear optimal cue shaping filters approach is one that not only provides a non-linear cue shaping, but also optimizes the motion platform envelop spaces PLUS optimized the motion platform velocity spaces.

__________________
J B
Register to Reply
Guru

Join Date: Jul 2005
Location: Stoke-on-Trent, UK
Posts: 4496
Good Answers: 137
#49
In reply to #46

Re: Solving System of Non-linear Equations

02/28/2024 11:55 AM

That's well outside my sphere of expertise! I wouldn't presume to claim I could add anything.

But good luck with it.

__________________
Give masochists a fair crack of the whip
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#50
In reply to #49

Re: Solving System of Non-linear Equations

02/28/2024 12:42 PM

Don’t be silly. You’ve been a big help. I appreciate the comments and recommendations of everyone who’s commented.

__________________
J B
Register to Reply
Power-User

Join Date: May 2011
Posts: 102
Good Answers: 2
#23

Re: Solving System of Non-linear Equations

02/22/2024 2:30 PM

x2 + y2 + z2 = 16. a sphere of radius 4

x2 + y2 + z2 = 36. a sphere of radius 6

x + y + z = 50. a plane which never cuts the two concentric spheres

3 equations.. 3 variables ... no solution

Register to Reply
Power-User

Join Date: May 2011
Posts: 102
Good Answers: 2
#29

Re: Solving System of Non-linear Equations

02/23/2024 9:19 AM

In 2D ... i.e x,y relationshio .. graphically a "solution" is where the the two graphs meet ...

two linear relaionships .. unless parallel... will cross somwhere. .. but nonlinear may not..

nonlinear ... two parabolas ... a line & a parabola ...may never meet.

3D ... i.e. x,y,x ...three axes ... 3 variables ...3 linear relationships .... try it .... 3 nonlinear relationships ... try it ... we're looking for values of x y & z that solve all 3 conditions ...

Try it

Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#33
In reply to #29

Re: Solving System of Non-linear Equations

02/25/2024 3:17 PM

Oh yes, I recognize the value in graphing, for two and even three relationships, but not six.

__________________
J B
Register to Reply Score 1 for Good Answer
Power-User

Join Date: May 2011
Posts: 102
Good Answers: 2
#40
In reply to #33

Re: Solving System of Non-linear Equations

02/26/2024 1:23 PM

My contribution was meant to that in general there are no real number solutions to non-linear simultaneous equations ... even with two variables.

Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#44
In reply to #40

Re: Solving System of Non-linear Equations

02/26/2024 4:47 PM

I don't think that's necessarily true. I think there are some systems of non-linear simultaneous equations to which there are no real number solutions, I don't think that's true of all systems of non-linear simultaneous equations.

__________________
J B
Register to Reply
Power-User

Join Date: May 2011
Posts: 102
Good Answers: 2
#47
In reply to #44

Re: Solving System of Non-linear Equations

02/27/2024 5:55 PM

Sounds very challenging..

I've been retired 20 years ... analogue control of flow, level, temperature etc in oil & gas..

Digital control in early robotics in 1980s ... welding and cutting heavy steel for oil platforms..

In both cases we always twiddled around on site to optimise .... so many variables ... and unknowns.. theoretical & real world.

For this I started with two linear equations, no problem ... two straight lines cross somewhere

Two nonlinear with two variables ... maybe .. ignoring imaginary solutions..

Three nonlinear equations with three variables .. most unlikely that three solid shells .. intersect at a single point i.e. a value x,y,z that solves all three equations. Chance in a million?

Hence my conclusion that 4, 5, 6 equations & variables is impossible..

I trained for PPL in the 1970s in a Cesna 175 ... a realistic flight simulator taking account of all possibilities was not possible as g forces and real outside world view can't be simulated...

I shall follow your progress .. with an open mind ..AI is moving ahead ... there must be an iterative approach to this ...

Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#48
In reply to #47

Re: Solving System of Non-linear Equations

02/28/2024 10:36 AM

You stated "I trained for PPL in the 1970s in a Cesna 175 ... a realistic flight simulator taking account of all possibilities was not possible as g forces and real outside world view can't be simulated..."

No flight simulator is completely realistic as they are all models of reality and a model by definition is a subset of what it's modeling. That being said, since the 70s and 80s technology has made great strides in improving the simulations such that a great deal of training can, and does, take place in a simulator. The visual systems are remarkably good now. When I first began in the early to mid 80s, the visual scenes night scenes looked relatively realistic as there wasn't much content in the scene (just traffic head and tail lights moving around on streets and runway lights), but the day scenes were more cartoonish looking. The technology has advanced to where day scenes are quite realistic (not perfect one can still tell it's a generated image). The simulator motion has also improved, but is still limited by the fact that the simulated cockpit is physically attached to the ground by way of the motion actuators. The motion simulation is, as you alluded to, limited in that it's not possible to provide g forces. The motion systems are able to provide reasonable onset of small (less than 1-g) accelerations and even sustain some in the longitudinal and lateral axes as long as the accelerations aren't too large. Those types of motion systems are primarily used for the non-high performance aircraft (Cargo, rotary wings, commercial as opposed to F-16s).

__________________
J B
Register to Reply
Power-User

Join Date: May 2011
Posts: 102
Good Answers: 2
#51
In reply to #48

Re: Solving System of Non-linear Equations

02/28/2024 5:05 PM

Thanks JD ... wasn't there a system using cameras over a model landscape ..

My daughter is in film & TV and I appreciate how things have moved on since the 1980s .. when we thought the IBM AT or DEC PDP was the fastest robotics computer ... and Pixar hadn't arrived..

Complex control systems ... multidimensional maths .. all faded since my university days ..

I would present this to a university maths department for comment ... they'll want paying to work on it but it might show you whether there is a real useful solution...

Wish you success..... I'll follow as you all grapple with this...

Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#52
In reply to #51

Re: Solving System of Non-linear Equations

02/28/2024 5:22 PM

There may have been something like that at one point, but by the time I came along the visual images were computer generated. The image generators (computers) have always been pricy due to the computational requirements. The same goes with the database (terrain and airport information).
It’s been an interesting field to work in.

__________________
J B
Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#53
In reply to #51

Re: Solving System of Non-linear Equations

02/28/2024 5:33 PM

I’ve considered reaching out to the local university but I’m somewhat enjoying the challenge. At least for now. I’ve learned, and relearned, a lot over the past month. I am at the edge of my comfort and knowledge zone with this but I sense the light will come on some time soon. Or at least I’m hoping it does.

Thank you for your interest and your support.

__________________
J B
Register to Reply
Power-User

Join Date: May 2011
Posts: 102
Good Answers: 2
#54
In reply to #53

Re: Solving System of Non-linear Equations

02/29/2024 3:09 AM

Yeah ... stretch the brain cells

When I investigated this kind of problem ... lots of old stuff came back..

Differential equations with s for f(x) ... s2 for f'(x) .. I wondered why your equations are all first order i.e. no differentials.. all our control problems had dy/dx & d2y/dx2 as well as x.

The last one I worked on was a level control from an Allen- Bradley PLC5 ...I set PID to the design calculations and it was oscillating ... I cut off the D, lowered P and it stabilised .. hence on site twiddling.

Last thought... the IET has an active forum... maybe Quora..

Register to Reply
Guru

Join Date: Apr 2010
Location: About 4000 miles from the center of the earth (+/-100 mi)
Posts: 9910
Good Answers: 1141
#41

Re: Solving System of Non-linear Equations

02/26/2024 4:11 PM
  1. (K12 * Ef)2 + (K13 * Eq) 2 = q11
  2. K11 – k12 * K22 * Ef2 – K13 * K23 * Eq2 = 0
  3. g * K12 + K12 * K23 * Ef2 + K13 * K33 * Eq2 = 0
  4. (K22 * Ef) 2 + (K23 * Eq) 2 – 2 * K12= q22
  5. K13 – g * K22 – K22 * K23 * Ef2 – K23 * K33* Eq2 = 0
  6. (K33 * Eq) 2 + 2 * g * K23 + (K23 * Ef)2 = q33
Eq
1K12K13
2K11K12K13K22K23
3K12K13K23K33
4K12K22K23
5K13K22K23K33
6K23K33

If it helps out any, I noticed that equation 2 is the only one with unknown K11. So you really have 5 equations with 5 unknowns. If you solve these 5, you can solve equation 2 for K11.

Whether there's a real solution or not depends on the parameters Eq, Ef, q11, q12, q22, q33, and g. Since these equations are quadratic, solutions for the unknowns may be complex.

Register to Reply
Guru
Engineering Fields - Control Engineering - Time to take control United States - Member - New Member Engineering Fields - Systems Engineering - New Member Engineering Fields - Mechanical Engineering - New Member

Join Date: Apr 2009
Location: Tampa, Florida, USA
Posts: 2129
Good Answers: 87
#43
In reply to #41

Re: Solving System of Non-linear Equations

02/26/2024 4:43 PM

That's a good observation.

I'll give 5 equations 5 unknowns a try with Mathcad and see if it the solutions aren't too large to display. As I understand the optimal control theory, the complex solutions aren't valid and can be discarded, but at least one set of solutions should be real.

__________________
J B
Register to Reply
Register to Reply 54 comments

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

Codemaster (12); engineertony (7); JBTardis (24); Lehman57 (1); Rixter (1); rwilliams (3); SolarEagle (6)

Previous in Forum: Race Cars with No Drivers   Next in Forum: Rate

Advertisement