cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

System of Equations

nascar4us-disab
1-Newbie

System of Equations

I have a system of equations (15 eq, 15 unknowns). I have defined everything for the equations, including the initial guesses of the unknown variables. I am trying to use the Given/Find solution block, but I am not getting an answer. I should get different values of the unknowns with different values of 't'. I don't know what I'm doing wrong.
75 REPLIES 75

It's not because you have 15 equations that you will have a solution for all the 15 unknown. On the top, the domain of existence is of prime importance a well as the guesses. You may have to use an alternate solver, inspired from the attached posted few days ago.
Mathcad 14 should have no problem, if you think it may be problem (which I doubt), then dress the system as per the attached and "Save as 11". Just the system, nothing more, nothing less. These solvers are very universal.

jmG
ELSID
4-Participant
(To:ptc-1368288)

Take a GOOD look at your equations. Looks like you do not use all of the unknown variables ... thus 12 unknowns for 15 variables trying to solve.

What jmG posted should shorten your work sheet tremendously.

For some reason the find option was set to Quasi-Newton. You should always use the Levenberg-Marquardt option. With that option, you get a solution.

But are you sure about your value for theta? It is awfully large. Remember, angles in Mathcad are always in radians, so your value of 40 repreents close to six complete revolutions. Unusual.

BTW, Mathcad supports Greek letters, so you could use θ instead of spelling out theta.
__________________
� � � � Tom Gutman

The Minerr function has to be written explicitly. This worksheet is as you indicated a partial solution.

On 10/29/2009 11:02:52 PM, study wrote:
>The Minerr function has to be
>written explicitly. This
>worksheet is as you indicated
>a partial solution.
______________________________

As it looks, x, y, z indicates a 2d trajectory, yet to be imagined.

jmG



Thanks for the help. I looked at the file that study posted, and I can't find any difference in what I posted, other than the solver type being different. I went back to my original file and changed the solver type and it still doesn't solve? I also went back and changed my theta equation (leaving it solving in radians instead of degrees) and it still doesn't solve.

Apparently I'm still missing and/or not understanding something.

I am going to try and see it I can get the equations in the matrix form to see if I can the worksheet to look a bit nice and also see if I can get it to solve.

thanks again!

On 11/2/2009 12:36:50 PM, nascar4us wrote:
>Thanks for the help. I looked
>at the file that study posted,
>and I can't find any
>difference in what I posted,
>other than the solver type
>being different. I went back
>to my original file and
>changed the solver type and it
>still doesn't solve? I also
>went back and changed my theta
>equation (leaving it solving
>in radians instead of degrees)
>and it still doesn't solve.
>
>Apparently I'm still missing
>and/or not understanding
>something.
>
>I am going to try and see it I
>can get the equations in the
>matrix form to see if I can
>the worksheet to look a bit
>nice and also see if I can get
>it to solve.
>
>thanks again!
_______________________________

You just need to organize Theodore solver a bit (Yellow) and plot to see if the solution makes sense, it does to me but you are still far from a visible 3D solution, for which solution you have to spline 2d and replot for more eggs in the 3D plotting basket. 2d spline on a 5 x 5 matrix, that is a little bit not enough, decently !

jmG



Simply changing the soolve algorithm results in a solution. The attached sheet is your original sheet with the algorithm changed to L-M, and a display of the solution added. I don't know what you did that you did not get this solution.

There may be an issue with theta. Is the it supposed to be in degrees or radians? There may also be a limited range of theta for which solutions exist.
__________________
� � � � Tom Gutman

Attached, verify 10 of 15 equations.

Regards. Alvaro.

You cannot find individual elements of a vector. MC11 allows this as syntax, but it doesn't actually do it -- it actually varies the entire vector, returning only the selected elements. In later versions that syntax has been disallowed completely.
__________________
� � � � Tom Gutman

On 11/2/2009 5:34:47 PM, Tom_Gutman wrote:
>You cannot find individual elements of a vector ... it actually varies the entire vector, returning only the selected elements.

I know, but do you check the others answers posted? Maybe vary the entire vector, but give more zeros into the original equations.

Regards. Alvaro.

On 11/2/2009 5:44:18 PM, adiaz wrote:
>On 11/2/2009 5:34:47 PM, Tom_Gutman
>wrote:
>>You cannot find individual elements of a vector ... it actually varies the entire vector, returning only the selected elements.
>
>I know, but do you check the others
>answers posted? Maybe vary the entire
>vector, but give more zeros into the
>original equations.
>
>Regards. Alvaro.
______________________________________
"Others answers", i.e: Theodore & Jean
They both work and agree and are QN.
Just need be organized a bit to look pro.

jmG


On 11/2/2009 6:37:55 PM, jmG wrote:
>On 11/2/2009 5:44:18 PM, adiaz wrote:
>>On 11/2/2009 5:34:47 PM, Tom_Gutman
>>wrote:
>>>You cannot find individual elements of a vector ... it actually varies the entire vector, returning only the selected elements.
>>
>>I know, but do you check the others
>>answers posted? Maybe vary the entire
>>vector, but give more zeros into the
>>original equations.
>>
>>Regards. Alvaro.
>______________________________________
>"Others answers", i.e: Theodore & Jean
>They both work and agree and are QN.
>Just need be organized a bit to look
>pro.
>
>jmG
>____________________________

An incomplete project proposition may be completed depending upon the interpretation, in that case it means my interpretation as long as the user has DAEP installed, butt at it.

jmG



On 11/2/2009 6:37:55 PM, jmG wrote:
>On 11/2/2009 5:44:18 PM, adiaz wrote:
>>On 11/2/2009 5:34:47 PM, Tom_Gutman
>>wrote:
>>>You cannot find individual elements of a vector ... it actually varies the entire vector, returning only the selected elements.
>>
>>I know, but do you check the others
>>answers posted? Maybe vary the entire
>>vector, but give more zeros into the
>>original equations.
>>
>>Regards. Alvaro.
>______________________________________
>"Others answers", i.e: Theodore & Jean
>They both work and agree and are QN.
>Just need be organized a bit to look
>pro.
>
>jmG
>____________________________

An incomplete project proposition may be completed depending upon the interpretation, in that case it means my interpretation as long as the user has DAEP installed, look at the resulting possible 3D surface plot .

jmG



No, I haven't bothered checking the answers. I believe them -- and the question is about getting answers, not that the answers are incorrect.

The equations that involve only the elements being found should be satisfied (with your incorrect formulation), those involving other elements may or may not be satisfied, depending on whether find actually changes those values or not. Note that as vectors the system is very under determined, leaving wide scope for find to choose among possible answers.
__________________
� � � � Tom Gutman

Well Tom, you're absolutely right, as usual. My setup was incorrect. Here, corrected. All answers checks now.

I don't see free variables, I count 15 variables, and 15 equations.

Regards. Alvaro.

Solution pasted for mc14 users.

Regards. Alvaro.

Wow, you guys have just taken the ball and ran with this!! I finally got my initial issue fixed. I opened up the sol(7).mcd for MC14 and I like that formatting. It was actually a solution that I was going to try to solve for using the symbolic toolbox.

However, when I opened the file, I still have an error with the Find equation, which then causes errors in some of the equations after that one.

Any particular reason for that?

Again thank you guys tremendously!!

On 11/2/2009 11:00:57 PM, nascar4us wrote:
>Wow, you guys have just taken
>the ball and ran with this!! I
>finally got my initial issue
>fixed. I opened up the
>sol(7).mcd for MC14 and I like
>that formatting. It was
>actually a solution that I was
>going to try to solve for
>using the symbolic toolbox.
>
>However, when I opened the
>file, I still have an error
>with the Find equation, which
>then causes errors in some of
>the equations after that one.
>
>Any particular reason for
>that?
>
>Again thank you guys
>tremendously!!

If you find you keep getting different results, it is worth doing a "repair" on your installation, starting with oldest version first.

Sometimes that windows linkages between different variants of the windows updates causes hassles. A repair puts them back in place. [I've lossed over some of the many "windows" style issues that this hides...]

Philip Oakley

It's not that I get different answers. The line in the code where the the "Find" command is used is not solving. I'm getting the error, "Something is wrong with the solve block used to define this function" and x1 is highlighted in red.

On 11/3/2009 10:17:54 AM, nascar4us wrote:
>It's not that I get different
>answers. The line in the code
>where the the "Find" command
>is used is not solving. I'm
>getting the error, "Something
>is wrong with the solve block
>used to define this function"
>and x1 is highlighted in red.
______________________________

And what does it say ?
"This variable is not defined above" ?
There is about a dozen of error messages associated with Given/Find ! Your Mathcad version may have � the previous versions an/or different.

jmG



Alvaro is still solving for elements of a vector. He has put in additional constraints and included all elements of the vector, so that it works in MC11. But that syntax is still illegal in MC14, and is not good practice in MC11. The find shoulc be only for non-subscripted variables, although they may be scalars or arrays.

Alvaro did not deal with the issue of the units for theta, the solution might not be meaningful.
__________________
� � � � Tom Gutman

Ok, so if I understand right, there is no way to solve for the unknowns using the Find function and no way to solve the same equations using the symbolic solver?!

This would not be good.

On 11/3/2009 3:19:01 PM, nascar4us wrote:
>Ok, so if I understand right,
>there is no way to solve for
>the unknowns using the Find
>function and no way to solve
>the same equations using the
>symbolic solver?!
>
>This would not be good.
_____________________________

If you can on paper, there will be symbolic result. If you can't solve algebraically on paper because it involves iterative processes, then you won't get a symbolic result, which symbolic result might be of little or no interest. I think you have nothing in hand from any of the work sheets so far.

You seem to justify and value a system that has no model.

jmG



The find function works with your original sheet, provided you set it to the L-M option. I posted that sheet earlier. Alvar is misusing vectors in his formulation, which is why that doesn't work.

There is a question as to the range of theta's for which you can get solutions. The effective value in your original sheet works. Removing the radians to degrees factor results in a value that doesn't work. I don't know if there is simply no solution with that theta, or whether there is a solution but your guess values are to far off for it to be found. Guess values matter.
__________________
� � � � Tom Gutman

On 11/3/2009 1:38:34 PM, Tom_Gutman wrote:
>Alvaro is still solving for elements of a vector.

I'm obstinate, I know 🙂

>He has put in additional constraints and included all elements of the vector, so that it works in MC11. But that syntax is still illegal in MC14, ...

I apologize that I misreading "further version" as mcad15 in an above post, thinking that the full construction could be working in mc14.

> ... and is not good practice in MC11.

Probably yes, but rescue Find as vectorial tool into mcad11.

>Alvaro did not deal with the issue of the units for theta, the solution might not be meaningful.

Theta isn't used inside the solve block, and only interacts over z6, solve separatelly.

Well, if Find reject vectors, so sorry Find, you're not my friend. Let me be more obstinate, because I go to use vectors again.

Hope attached works in mathcad 14: Newton Raphson with linear numerical Jacobian.

Regards. Alvaro.

Find does not reject vectors, it rejects elements of vectors.
__________________
� � � � Tom Gutman

>I'm obstinate, I know :-)< [Alvaro]
____________________________

Nothing wrong but maths should inspire by inspection. It does to me looking at the last line of the Given/Find. Knowing nothing about the system so represented by the relationships, clearly the cos is a function, maybe a thing like "direction cosine" among a set of ending trajectories. Therefore the supplementary relationships you have used shouldn't be there. In Given/Find , there are 15 unknowns related by 15 equations in the respective point coordinates system, that solves the problem. More puzzling is the fact that only QN solves, here again an insufficient conclusion. No nothing about the system, maybe none of the solvers are capable, and no source, no reference, just a humming bird trajectory.

jmG

PS: look again at Theodore solution that has physical meaning. Your plot makes no sense to me because i can't see. True, I didn't even try because of the more solutions than the system is supposed to solve for.

Given-Find with partial setup, Given-Find with full setup, and my user Newton Raphson function have all the same answer, with more than ten decimal places.

Problem looks very clear: the geometry of a system of linkage bars, with the usual restrictions.

Attached, the solution of the system for a range of angles from 80 to 300 degrees, which looks with very geometrical sense.

Further developing can make x,y,z solutions as functions of theta, and finally, theta as function of time, with the eventual access to the derivatives of the positions.

Regards. Alvaro.
Top Tags