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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! 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

Here's how to properly use vectors to simplify the setup. Note that solutions seem to exist only for a limited range of θ.
__________________
� � � � Tom Gutman

Here's an animation of the system.
__________________
� � � � Tom Gutman

On 11/3/2009 10:06:25 PM, Tom_Gutman wrote:
>Here's how to properly use
>vectors to simplify the setup.
>Note that solutions seem to
>exist only for a limited range
>of
>�.
__________________

> Tom Gutman
______________________________

I can see your interpretation. As a matter of fact I had posted many sheets doing this kind of project. One of them was the "Gamma gauge shuttle", successfully done. From recollection: before you joined the collab. In association with the 2d plot, you should manage to get an export. If the visiting collab is interested in the data , please read my 80 pages "Mathcad for Engineers_Given/Find".

jmG

PS: Hint attached

On 11/3/2009 10:06:25 PM, Tom_Gutman wrote:
>Here's how to properly use vectors to simplify the setup.

For Given/Find, you're right

>Note that solutions seem to exist only for a limited range of (theta).

The max and min for theta was natural, also if for some special angle, incluiding a range, that make a "big" hole in the range of theta.

But I believe that the hole around 180 deg is because we use the same guesses for all the theta range. An iterative method must to be used to start with a new guess near the desired point to check if it is that the case.

Regards. Alvaro.

Hope attached works in mathcad 14.

Complete vectorial setup for Given-Find. Not hole at 180 deg, same range for theta. Restrictions derived from input data for distances. Assumed that if values check the restrictions they are valid.

Regards. Alvaro.

>Complete vectorial setup for Given-Find<<br> ________________________

Not yet for both responders. The visiting collab does not have a usable project in hand. No export = no project done, ASAT [As Simple As That] !



jmG

I know the system will solve, as I have seen some results from the system. So this means there must be a symbolic answer as well.

Sorry I ask so many questions and don't understand some of the things you guys mention. I am used to doing things in Matlab, but I was told that I could solve this system in Mathcad in order to get the equations that could be programmed into another language.

>I know the system will solve, as I have seen some results from the system. So this means there must be a symbolic answer as well.<<br> __________________________________

Solving does not prove the solution is valid if you can't prove. A solution does not mean either it results from symbolic, rather from purely numerical solver. More you keep secret about the system, closer to the recycle bin. What you had originally in your GivenFind, is it what you have coded from Matlab. If so, did you check Theodore and my reply versus Matlab. What does Matlab give ? That will surely help.

jmG

On 11/4/2009 1:35:04 PM, nascar4us wrote:
>I know the system will solve, as I have seen some results from the system. So this means there must be a symbolic answer as well.

If I don't interpret bad what you understand by symbolic, you're saying that because there are a numerical answer for the problem, must to be a symbolic expression that gives the solution, for example, the roots for a polynom of 5-th degree.

For the giving problem, could be that there are, could not, think that isn't very interesting.

I know three definitions (or more) of "symb ans":

1. Anything with numbers and letters. In the case of the poly: roots(p(x),x), even can't simplify.

2. Simplify expression, that is: answers with different flops (FLoating Operations Per Second), simpler are those with less flops, or other criteria (mathcad sometimes use string lengths).

3. Those things that gives Maple or Mathematica: any thing that differ from the arguments into a function.

Regards. Alvaro.
ELSID
4-Participant
(To:AlvaroDíaz)

Tom,
How did you do the animation? That would be a great article for PTC!

jmG,
I did a search in the collab for "Mathcad for Engineers_Given/Find" Could not find a file. Can you re-post or send me to link?

I just used the create animation, selecting the plot. The actual animation process is all dialog driven, and not embedded in the worksheet itself.
__________________
� � � � Tom Gutman

On 11/4/2009 12:32:35 PM, ElSid wrote:
...
>jmG,
>I did a search in the collab
>for "Mathcad for
>Engineers_Given/Find" Could
>not find a file. Can you
>re-post or send me to link?
____________________________

This is the last posted version.
Please go strictly by the rules up the work sheet

http://collab.mathsoft.com/read?88093,11

When you open this work sheet
1. DO NOTHING
2. wait few seconds
3. drag the scroll bar down to the very bottom in one shot !
4. wait until the last plot is complete
5. scroll � page by � page back up
6. navigate, copy/paste each section of interest


jmG

Much too complicated for my taste.

I think the hole at π is real. The reason you don't get that hole is because you restated the condition involving θ, giving it a very low weight compared to the other conditions. Notice that that condition is not exactly zero (to the displayed precision) at 180°. If you change it back to compare the actual distances your formulation shows the same hole at θ=π
__________________
� � � � Tom Gutman

On 11/4/2009 2:47:25 PM, Tom_Gutman wrote:
>Much too complicated for my taste.

Yes, for this only asking for a numerical testing, nothing more.

>I think the hole at π is real. The reason you don't get that hole is because you restated the condition involving θ, giving it a very low weight compared to the other conditions.

Looking at plots probably discontinuity at 180 was avoidable. And looking the system looks as punctual.

In the worksheet using user NR function it is clear that the problem is that the Jacobian is zero at 180. And probably is to closed to zero around 180, for this reason "hole" is a range. That meaning not that there are not solution around 180 deg, but the program need other technique to solve the system, one without Jac (even eventually they can fail if the hole is real, which is probably the case here)

But what surprising-me is that Find have the same problem that my routine. What is usual is taking the cond number before eval J^-1 and decide which method is better. At the end, all holes are ranges, numerically, but seems that ranges are too longs in the punctual holes with Given-Find.

Regards. Alvaro.

After some analysis, I disagree. I don't think the hole at 180° is avoidable. Your "solution" at 180° is not actually a solution, your first condition (the last in the original formulation) is not actually met. You divided that equation by d61. That reduced the value of the error to where it could sneak in under the CTOL value (which your sheet also has larger than the original sheet).

Which sheet are you referring to with the Jacobian?
__________________
� � � � Tom Gutman

On 11/4/2009 4:48:22 PM, Tom_Gutman wrote:
>After some analysis, I disagree. I don't think the hole at 180� is avoidable.

Avoidable discontinuity is those that lim for the left and lim for the right have the same value.(Other disc is a jump: finite or infinite lef, infinite right or infinite both).

Looking at the plots seems that this is the case. Also, by the nature of the problem.

>Your "solution" at 180� is not actually a solution, your first condition (the last in the original formulation) is not actually met.

Numerically, 180 deg involves Pi, an irrational, then can't be evaluate never with enogh precission.

If you prove that at 180 deg there are an unavoidable discontinuity, and givind the nature of the problem, this is a natural limit for the problem, and theta can't throw from 179 deg to 181. Could be. But a continuity test over 31 variables is desire out.

>You divided that equation by d61. That reduced the value of the error to where it could sneak in under the CTOL value (which your sheet also has larger than the original sheet).

For me the question is how to avoid an avoidable discontinuity in the practice. Driving the error in the equation that have the problem, is one simple.

>Which sheet are you referring to with the Jacobian?

File

http://collab.mathsoft.com/~Mathcad2000/upload/sol_NR.mcd

have a routine for Newton-Raphson method over several variables, NR(F,A) that evaluates the jacobian inside, which could be refined taking derivatives with central difference or others. Also, the jacobian can be defined outside of this procedure.

Regards. Alvaro.

You have avoided the hole by accepting solutions that are not really solutions. Dividing through by d61 does not result in a real solution, it only allows find to consider a non-solution as a solution.

The condition involving θ is such that at θ=180° the d61 segment must be precisely vertical (its total length equals Δz). But the remaining constraints do not allow it to be precisely vertical. Hence no solution for that θ.

If you are willing to accept non-solutions to avoid failures to find, you can get "solutions" for all values of θ by simply changing find to minerr. That is effectively what you have done with respect to that one constraint.

BTW, the hole is not just a point (as I had earlier supposed) but does cover a range. It errors when within about 1% of π. Changing CTOL may change the size of the hole.
__________________
� � � � Tom Gutman

On 11/4/2009 9:47:57 PM, Tom_Gutman wrote:
>You have avoided the hole by accepting solutions that are not really solutions.

That happing every mornings. Try to tell to polyroots that 2.002 are not a really solution:



Symbolic calculus it's allways superior to numerical, but not applicable to all situations. And human resources are part of situations.

>Dividing through by d61 does not result in a real solution, it only allows find to consider a non-solution as a solution.

If makers of polyroots code can cosiderer bad solutions as procedures answers, I can too.

>The condition involving θ is such that at θ=180� the d61 segment must be precisely vertical (its total length equals Δz). But the remaining constraints do not allow it to be precisely vertical. Hence no solution for that θ.

Yes, that the reason for the punctual hole, but we have a range one. So, question is how to drive the size of the range (because allways go to be a range).

>If you are willing to accept non-solutions to avoid failures to find, you can get "solutions" for all values of θ by simply changing find to minerr. That is effectively what you have done with respect to that one constraint.

An very usual technique, if find not work, try with minerr, maybe there are some kind of answer.

>BTW, the hole is not just a point (as I had earlier supposed) but does cover a range. It errors when within about 1% of π. Changing CTOL may change the size of the hole.

Actually, I'm not only divide by d61. Also take square root over the squares sum, eliminate the square in d_hk, and change it's sign. This for have a better control over the calculus, estimating in the same scale as x,y,z the answers given by check() or sys() functions.

To have full control over each equation, one can equate the eqn to zero, and choose a factor. This factor could be function of TOL and CTOL. In a system which it is very sensible to one of they equations, like this, it isn't a bad idea, and do this for only this sensible equation.

Regards. Alvaro.

Polyroots is a really bad implementation, and the (default) LaGuerre is really bad. Here you have a repeated root, which generally causes coniptions for many numeric algorithms (proper solving of polynomials calls for removal of repeated roots first). I suggest, if you feel you must use polyroots, that you automatically choose the companion matrix option, which is much better. For this case it gives about eight digit accuracy. BTW, I don't think polyroots is sensitive to TOL.

IMO just because the default polyroots produces a clearly unacceptable answer for your particular example is not a justification for accepting an incorrect answer for the original problem in this thread.
__________________
� � � � Tom Gutman

On 11/5/2009 12:50:59 AM, Tom_Gutman wrote:
>Polyroots is a really bad implementation ...

This is obvious 😆

>BTW, I don't think polyroots is sensitive to TOL.

I don't considerer this, but now that you say looks more obvious too.

>IMO just because the default polyroots produces a clearly unacceptable answer for your particular example is not a justification for accepting an incorrect answer for the original problem in this thread.

You're right, I'm only searching (with previous advice, i.e. I post about this search before as I have the ws)

But wrote like this seems that I posted delivery a bad solution. I don't understand very well what you are saying, excusme if it is concequence of my english learning.

But you jump from

"No, I haven't bothered checking the answers. I believe them -- and the question is about getting answers, not that the answers are incorrect. " (T. Gutman, #16)

to this other. Teaching teach me that errors occurs any_where_any_time (ask to the king of Holland visiting Mexico if not!). But the discussed file have not "errors". Was posted with the following text:

"Complete vectorial setup for Given-Find. Not hole at 180 deg, same range for theta. Restrictions derived from input data for distances. Assumed that if values check the restrictions they are valid. " (A. Diaz, #35)

Thus, I say specifically that the file have made in some context, with some assumptions. The true criteria for accepting and not reject the solutions appear explicit. If you ignore them, obviously, you can say anything that you want. In which case I have the option to ask you: �why ignore the assumptions under the file was posted?.

Regards. Alvaro.

PD: Even english have not (open) question mark 🙂

You are correct that purported answers should be checked, in a complete application. But when I'm doing sheets to deal with Mathcad issues, I will often ignore that. Further, if I get a result from find I am willing to accept that all of the stated constraints are met to within CTOL. Exactly what that means in terms of the actual problem mayh vary with the form of the constraints.

In my formulation all the constraints are in terms of length. The CTOL value is left at the original poster's value of 1E-6 (not the default of 1E-3). Given that, and that the lengths are originally given to four decimal places (a total of seven significan digits) I did no feel the need to add explicit checking of the answers. The problem requirements are exactly the constraints, and the constraints were checked by find.

My statement that your solution is not a proper solution (at θ=π) was actually based on your checking in your sheet. When I looked at the check at the critical point, I saw that the conditions were not in fact met, and further cecking showed how you had rescaled one of the conditions, allowing it to pass the find check while not being compatible with the rest of the problem.

BTW, I did not examine the possibility of different guess values. In this sort of system it is no uncommon for there to be multiple feasible configurations, effectively selected by the guess values, and the range of validity can be different for the different configurations. Since the original poster did not post any of the solutions he claims exist (from other sources), I can't tell what the nature of those solutions might be. What configuration they represent, what θ values they cover, and what accuracy is imposed.
__________________
� � � � Tom Gutman

On 11/5/2009 3:20:59 AM, adiaz wrote:
...

Ah, I forgot: I also change the guesses for some values like what I introduce if don't know the answers.

Regards. Alvaro.


Yes, I noticed that you changed the guess values. I played around with the guess values a bit, and found that, within the set I used (presumably representing the same configuration) they made no difference. The hole at π is not due to the guess values, it is inherent in the conditions, which cannot be met to the original tolerances at π.
__________________
� � � � Tom Gutman

>Original post is in mc14, I capture the ws from other post, can't remember from hwo.<<br> ==> Isn't from Theodore ?
>... because I don't know how to do this with several variables<<br> ==> ask the the originator if he has the Matlab hint. Sure it can be done manually.

jmG

>to this other. Teaching teach me that errors occurs any_where_any_time ... But the discussed file have not "errors". Was posted with the following text<<br> _______________________

Never mind the text, that's not what you put in a thesis or remit to the client o to a machine shop ... a red result and no explanation of the red.

Nobody said your work sheet had errors, only that it does not produce an export. Red result is not necessarily an error, it just tells you are not doing correct for the end purpose. You don't seem to understand what an export is as well as Tom Gutman. Can you give a table of the solution to the client if red, I bet no. In Tom Gutman work sheet, I have an export within the limit of the solver, which I haven't pushed further. You are mentioning root, root of what in a multiple solver. Given/Find does not seeds ... so, end of the story. TOL/CTOL of what ? try to squeeze the initials, but that is " un travail de moine" because there is no algebraic immediate inspection.



That would be a great feature you could suggest PTC, i.e: imagine/invent a way to seed Given/Find, inspired of the seeded root scanner that solves the function declared not solvable by Mathematica.

jmG

On 11/5/2009 3:51:30 AM, jmG wrote:

>... a red result and no explanation of the red.

I don't explain why mathcad derivative don't converge because have not importance, but, because there are a red, say what's could be further steps.

>Nobody said your work sheet had errors, only that it does not produce an export. Red result is not necessarily an error, it just tells you are not doing correct for the end purpose.

By parts, like integrals (or as says Jacks). Not allways an export is necessary. A red tells only that the function employed is inadequate, so, use other. If mathcad built in Find don't work, use NR, if mathcad built in derivative don't work, write a working procedure. This is what red tells me.

>You don't seem to understand what an export is as well as Tom Gutman. Can you give a table of the solution to the client if red, I bet no.

Don't worry, I do. An export is preparing a measurable entity from one system to another.

In chemical engineering you have a lot of examples of exports, taking each system as unitary process.

Given that a bit is a dimension like time or distance, in computation why have also systems (mathcad, excel) and exports (measurables entitys, called data with bit as dimension).

For example if the client want a gear, probably I need an export. I design the gear and the export is an autocad draw, because this is what I need to make the gear into a rotating machine. To do this I use excel to design the gear, and macros to do the export: the autocad draw.

Ocasionally an export include some kind of table, in the cases most simples. But here I think that you confusing an export with the process of discretization.

If my export go to be some kind of table, I never starting defining functions. I starting defining ranges, and by mathcad architecture probably don't need at all using functions. Taking this as example, probably I start discretizing t. To do this I first select the number of points that I want to examine (temporal points) and divide the time interval with this number, say it N. Then don't write theta as funciton of t, only use a range index. At the step of the solver, I call Find N times in the same place, without defining nothing as function of nothing. What it's writing as x(t) in the ws, thinking in an export go to be wriging as x[i. To eval derivatives for an export I never think using mathcad diff, use matlab diff, which only take the diff(erence) between vector elements and then divide by an increment h. This is working for an export. Actually is the usual matlab method.

>In Tom Gutman work sheet, I have an export within the limit of the solver, which I haven't pushed further.

This limit was posted in the NR version, and probably it is physical limit.

>You are mentioning root, root of what in a multiple solver.

See the NR file with more attention: NR(F,A) was writing like one variable solver, but find roots for F and A vectors. Looking X as column vector of unknows, obviously, they are roots (in a multiple solver).

>Given/Find does not seeds ... so, end of the story.

In a matlab programming style is much easy taking each solution as the new guess for the next value to be solved. But this destroy functional methods, and I don't like this. And doing this with the answer of Find as function give me long time answers.

>That would be a great feature you could suggest PTC, i.e: imagine/invent a way to seed Given/Find, inspired of the seeded root scanner that solves the function declared not solvable by Mathematica.

You're right, Given/Find can be improved in a lot of ways, this is one with big importance. This can be implemented with the option "remember", which says a function that not destroy what before was evaluated between callings.

Regards. Alvaro.

Alvaro,

Let's make it clear on what you don't understand in this project. I'm the client, I don't care the maths and you don't have to know my end use (it could be for Patent Pending), I gave the problem to 3 potential bidders: Alvaro, Tom Gutman, Joe Blo. I want a data table for my machine shop or lab or whatever use that I'm the only one knowing more about my "Patent".
The specification is then: solve the system and give me a data table of the solution(s) that I can read in Excel.
Alvaro and Tom Gutman you return me a red result with a conclusive preach that you can't or don't know how to get my data for Excel. As the client, I have a serious problem because I don't know yet if it is possible or not. Next day or afternoon, Joe Blo comes in with a data table ... guess where my $ go and with whom I'm going to deal with.
Don't fly away of the objective, just do it in steps that can be traced and used. Only within these few days, at least one collab mentioned the preference for Excel plot (his client, paper ...) and another collab who has better graphic package. So, get rid of the first red, and I will return the red derivative in data table only with Mathcad as is, and/or from the collab collection. No project should bang on the wall.
Get rid of the red result, complete the project.

Between the two of you, how do you know you are not missing something ? Especially if you are exclusive and so exclusive of comments and working works sheet from "others".

I departs from this project, waiting your mutual final sheet, and if there is anything valid I will add to the collection "Mathcad for Enginers_Given Find" and will not forget to reference the source of the solution only because this project has no source in this collab, just a project out of the blue.

Cheers Alvaro, Jean


There are other search engines besides Leverberg-Marquart,etc., such as manifold smoothing, damped in-exact Newton. etc.

If Alvaro desires, there is a famous saying I recall from World War I history = - "If you know of a better hole, go to it."

>>The specification is then: solve the system and give me a data table of the solution(s) that I can read in Excel.<<

If that is what you were asking for, and you were offering real money for that, then that is what I would provide. But that is not what the original post requested, nor did the poster offer any money. The question is about the behaviour and use of Mathcad, and that is what I did.
__________________
� � � � Tom Gutman
Announcements

Top Tags