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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Two equaitons, two unknowns, 1200 data points

qbonds
1-Newbie
14 REPLIES 14
MikeArmstrong
5-Regular Member
(To:qbonds)

Quenton,


I think it was me who asked you to post a worksheet. Welcome to the forum.

A few queries from your worksheet.

Why have you made everything a function of i? - You have already defined your data vectors Q2 & Q3.

You say that X,Y,Z have already been calculated - I cannot see them.


Also, where is Q1 calculated?


On another note, the way you have constructed your worksheet makes it very hard to read and follow. Maybe have it all aligned to the left and in calculation order.


Mike

Hello Mike, and thanks for being so helpful.

1. I defined everything as a function because I was under the impression that if i defined them as vectors, i.e. Q1_i I could not manipulate the equations accordingly; put them in the form of linear equations, solve for unknowns, etc..

-is there a beter way?

2. X, Y, Z, or L1, L2,... e1,e2,e3 are calculated in formulas preceeding Q2 and Q3

3. Ok I will redo the worksheet and highlight the items from 2 above.

RichardJ
19-Tanzanite
(To:qbonds)

Quenton Bonds wrote:

I am trying to find T1(i) and T2(i)

You already have T1 and T2 defined in terms of measured values, so why are you trying to solve for them?

Well I have T1 and T2 defined because the "Find" finction requires an initial guess. Yes I have measured valued but in my analysis I am trying to find T1 and T2 from Q2 and Q3 to compare the results, so I used the meaured values as the initial guess.

RichardJ
19-Tanzanite
(To:qbonds)

Quenton Bonds wrote:

Well I have T1 and T2 defined because the "Find" finction requires an initial guess. Yes I have measured valued but in my analysis I am trying to find T1 and T2 from Q2 and Q3 to compare the results, so I used the meaured values as the initial guess.

OK. I understand. You were trying to do a symbolic evaluation though, which actually does not require guess values. A numeric evaluation does.

The attached shows how to do what you want, but only in principle. There are no reasonable values of T1 and T2 that satisfy your equations. Since the data is from a real system the obvious conclusion is that your equations are wrong.

RichardJ
19-Tanzanite
(To:RichardJ)

Here's a version saved in MC11 format for those without MC14 of MC15. The symbolics no longer work properly though (even in MC14 or MC15) because it's lost track of the units.

WOW Thanks so much for your valuable insight...

I have been using mathcad for a while and I don't know why some of these things aren't the easiest to understand.

0. No the answers should not be in Kelvin, they ar in F and this is correct for "this" set of equations.

1. I did know know the symbolic operators output "symbolic" solutions only; therefore I was not trying to solve the equation in terms of symbols.

2. Thanks for the clarification on solving for variables not functions. Yes that should have been an assignment operator.

3. I'm not sure what you plotted in the numerical solution analysis: f(T1, T2)?

-Is this Q2 interms of T1 and or T2 at one point?

-why did it only require f in the plot? I am assuming this gives you f for all 1197 points?

4. What do you mean by the equations being wrong? I'm 100percent sure they are correct b.c. when I substitue the measured values for T1 and T2 we are using for the "geuss" I get correct number for Q2 and Q3.

I really appreciate the time you've put into helping me with this! I'm learning some things that i did not know. Is there a good resource to where you learned this stuff?

RichardJ
19-Tanzanite
(To:qbonds)

3. I'm not sure what you plotted in the numerical solution analysis: f(T1, T2)?

-Is this Q2 interms of T1 and or T2 at one point?

-why did it only require f in the plot? I am assuming this gives you f for all 1197 points?

f and f2 are the expressions on the RHS side of your equations. q2 and q3 are the expressions on the LHS of your equations. They are evaluated for one value of i (which defines which value of T3 and TDN to use) over a range of T1 and T2 (so no, they do not show all 1197 points, they are for only one point). They are quickplots, so they only require the function name. In a Quickplot the function must be of two variables, which are plotted on the "X" and "Y" axes. You set the range for each plot by going to the QuickPlot tab under "properties". Possible values of T1 and T2 that satisfy the first equation are where the planes for f and Q2 intersect. Possible values of T1 and T2 that satisfy the second equation are where the planes for f2 and Q3 intersect. In the range plotted there are no values of T1 and T2 for which both equations are satisfied. In fact, you can see that the planes for f and f2 are almost parallel, so you need to go a very long way from the plotted values until you would find values of T1 and T2 that would satisfy both equations (from the symbolic solve we know that T1 and T2 would in fact have to be on the order of -10^20 and 10^20).

4. What do you mean by the equations being wrong? I'm 100percent sure they are correct b.c. when I substitue the measured values for T1 and T2 we are using for the "geuss" I get correct number for Q2 and Q3

No you don't. Not even close. See the attached worksheet.

Is there a good resource to where you learned this stuff?

No, not really. You have been using Mathcad for "a while", but I have been using it (extensively) for over 15 years.

smile.gif

PhilipOakley
5-Regular Member
(To:qbonds)

Quenton Bonds wrote:

I posted this on the old forum and was asked to post a worksheet:

Attached is the old message and worksheet:

Hello I am trying to solve:
Two equations, with
Two unknowns, with
multiple data points (1100),
-I obviously don't want to enter all 1100 pts into a matrix

I tried the using the solve function but I could not get it to work.

the equations are something like:
Q(i)=X*T(i)+T2(i)*Y....
Q2(i)=X*T1(i)...











Quenton,

Not sure which type of "solve" you are looking for..? Is it that you need 1100 separate answers, one pair per data line; or, are you looking for a single best fit value for T1 and T2 averaged across all of the data?

depending on which it is changes significantly the method of solution.

Philip

Hello Philip,

Yes I need 1100 separate answers for T1 and T2 just as I have 1100 data points.

IRstuff
3-Visitor
(To:qbonds)

Well, you've got your two equations, so the solutions are well known.

http://en.wikipedia.org/wiki/System_of_linear_equations

You use indices to create the array of solutions

qbonds
1-Newbie
(To:IRstuff)

Thanks, but I'm aware of that method however, the problem is not as simple as it seems if you look at the mathcad worksheet. If I am missing somthing will you please clarify?

PhilipOakley
5-Regular Member
(To:qbonds)

Quenton Bonds wrote:

Thanks, but I'm aware of that method however, the problem is not as simple as it seems if you look at the mathcad worksheet. If I am missing somthing will you please clarify?

I am guessing that what you are needing a method for running through the 1100 results in sequence, one at a time, and finding a mechnism for reading and saving the results.

This can be "a problem" in the sense that MathCAD is not a regular programming language, and in normal circumstances does NOT throw away results (which is probably why you need advice given the potential size of your data and intermediate results). The exception is functions and programmes where destructive assignment is allowed.

One approach is to read all the data, process it line at a time, using functions (and embeded programme constructs) and simply record the corresponding answers. This has the drawback that you can't see or check the intermediate results. Usually one has to develop most of the code in-line for a single result, then package the code as a function (and sub-functions!), test that then run the top function across each data value.

This is one area where MathCAD could enhance its interface to leverage some of the expectations of 'real world programmers' (who think loops, with its destructive assignment is not a side effect...)

Philip

Your project for 1200 points [300 pairs of solutions]

is solved in "Mathcad Usage" July 28, 09:22

jmG

Top Tags