Skip to main content
1-Visitor
March 20, 2017
Solved

Variable's value change in worksheet

  • March 20, 2017
  • 1 reply
  • 1912 views

Hello, new at using Mathlab 14, I have a problem with unwanted variable's value change based on it's location on the worksheet. In the attached file, variable's K33,5 value changes by moving it above/below worksheet's first horizontal line and I cannot understand why. Help needed.

Best answer by LucMeekes

You're experiencing numerical inaccuracy.

The initial definition of K3 is:

After redefinition is changes to:

So e.g. K3[0,0 changes from:

to

while none of the parameters (E, I, A, a) are zero.

This means that K3[0,0 changes from E*A/a to E*A/a+12*0 unchanged.

K3[1,0 changes from 0 to

which is 0, because there's a sin(180 deg)=0 in both parts, But when you evaluate it numerically, you get:

Which is a number very small compared to 186*10^6.

They are 10^6/10^-9=10^17 apart, which is about the numerical accuracy of Mathcad.

Luc

1 reply

23-Emerald IV
March 20, 2017

No magic, just Mathcad (not Matlab).

That is because just above the 'first horizontal  line, at the far left, you redefine K3 to be the old K3 multiplied with T3 and its transpose.

Success!

Luc

trama1-VisitorAuthor
1-Visitor
March 20, 2017

Thank you for your answer, the problem is, that the new K3 is supposed to be identical to the old one with a few changes in (+/-), yet if i check K3(1,0) which is suppose to be 0, it has a different value. Am I missing something here ? Sorry for the trouble.

LucMeekes23-Emerald IVAnswer
23-Emerald IV
March 20, 2017

You're experiencing numerical inaccuracy.

The initial definition of K3 is:

After redefinition is changes to:

So e.g. K3[0,0 changes from:

to

while none of the parameters (E, I, A, a) are zero.

This means that K3[0,0 changes from E*A/a to E*A/a+12*0 unchanged.

K3[1,0 changes from 0 to

which is 0, because there's a sin(180 deg)=0 in both parts, But when you evaluate it numerically, you get:

Which is a number very small compared to 186*10^6.

They are 10^6/10^-9=10^17 apart, which is about the numerical accuracy of Mathcad.

Luc