14 Replies Latest reply: Feb 16, 2012 4:28 AM by Lilli

# ARGH! Where is my mistake

Dear everybody!

You find enclosed my MathCAD file.

My equations depend of THETA, I know by mesure the pressure following THETA.

Why FI"(THETA) isn't a function?

• ###### Re: ARGH! Where is my mistake

Are the values of Theta in the excell table in degrees?
If so then assign the degree unit to theta ( theta:=theta*deg) and drop the degree assignments in the functions.

It's a little confusing using angular velocity in radians/s and funcitons that have theta in degrees combined with functions with theta in radians.

• ###### Re: ARGH! Where is my mistake

The sheet you posted has no data for theta or P(theta); the readfile structuresdon't store the data. As soon as I create values for theta, all the functions develop values.

• ###### Re: ARGH! Where is my mistake

Thanks all! Unfortunately, the functions don't all develop! If you look your sheet, j"(q) and after doesn't develop, Strangely if I write

j"(q):=(j'(q)*j'(q)-q)*tanj(q) it's develop, why. It's the same thing after ??????

• ###### Re: ARGH! Where is my mistake

You need to vectorize some of the equations.

Mathcad will automatically vectroize, sometimes. I've see situations where Mathcad appeared to vectorize automatically, because it gave multiple results. But if you then vectorize, the answer is different (and correct).

Some of you equations that don't produce multiple results just need to be vectorized, but others should be checked to see if the result when vectorized is the same.

You could also put Theta=0..rows()Theta and P=0..rows(P) at the beginning and it will do the same thing (I did not try though).

It also looks like you need to assign units to P, P=P*psi, or whatever.

• ###### Re: ARGH! Where is my mistake

Hello Wayne,

I'm not sure to understand. I added the unit for the P value after your fist respond. I come to solved the problem, I suppresed the excel relation for Theta but now I don't know how to use my pressure.

• ###### Re: ARGH! Where is my mistake

Mathcad will automatically vectroize, sometimes. I've see situations where Mathcad appeared to vectorize automatically, because it gave multiple results. But if you then vectorize, the answer is different (and correct).

It's a very dangerous situation. I had that happen to me recently. It tends to happen when you have two vectors with one equation.

Mike

• ###### Re: ARGH! Where is my mistake

A simple example of what Wayne was talking about.

Mike

• ###### Re: ARGH! Where is my mistake

Now, I'm block went I try to use my P values.

Mike, I tried to use your sheet, (Previous thread) but without result for this problem.

My problem is the follow:

For q = 2°, P = 0.859 bar,

For q = 4°, P = 0.863 bar,

For q = 6°, P = 0.867 bar,

...

For q = 360°, P = 0.854 bar

How to take into account this point?

• ###### Re: ARGH! Where is my mistake

Sorry I have come late into this thread. You haven't defined theta or P in your sheet. Firstly you either have to define that or make each function dependant of theta.

I cannot see where in your sheet P is being calculated and therefore cannot see which value of theta relates to which pressure.

Mike

• ###### Re: ARGH! Where is my mistake

At the begining of the sheet I've q:=2°,4°..360° and Pq:=PV600.xls. I know this relation but I don't know how to put it into MathCAD

• ###### Re: ARGH! Where is my mistake

Lilli:

See attached; For Theta, use a vector, not a range variable
You imported 2 columns from Excel, you only want the second column.

A few of places you still had the degree unit in the function
I vecotrized everything, don't know if they all needed to be though.

I made no attempt the check the results.

Wayne

• ###### Re: ARGH! Where is my mistake

Hello wayne!

It's strange for me to use the vector, for the graphs I must use the dot representation and not the line.

Unfortunatly I'm always stop on the equation of piston load that is equal to :

-Spiston*Pq-Mpiston*Gpiston(q) with:

Spiston : m²

Pq : Pa

Mpiston : kg

Gpiston(q) : m/s²

How to write this equation?

I have just 179 values for Pq but 360 for Gpiston(q)

• ###### Re: ARGH! Where is my mistake

Actually, if you import both columns your sheet will work as written.

One of the things Mathcad can do isfit functions to data. Before I realized that importingg the whole file solved your problem, I was trying to develop P as a function of theta. That would allow you to use functions instead of vectors.

• ###### Re: ARGH! Where is my mistake

Thanks at all ! Currently, I continue to improve my systeme. I think that is not finish but for the moment the problem are solve.