Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.5K Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Why do I have to evaluate twice before Plot correctly plots??

Posted 7 years ago
POSTED BY: Raymond Low
4 Replies
Posted 7 years ago

Yes, thank you John I keep forgetting the difference between

= -- assigns a value

== -- equates two expressions

:= -- delays evaluation

your method worked, also if I had used ":=" delayed evaluation also worked -- once you reminded me, I remembered....

POSTED BY: Raymond Low

Because yx=expr means "evaluate expr and set the value of y to it". If expr contains evaluatable subexpressions, they will be evaluated. Here, you're setting P after evaluating the expression that contains it. If P already had a value when you evaluated it in setting yx, changing its value will have no effect on yx.

For parameters like this, I like to use rules to define parameter sets. Leave P, EI, and L as undefined symbols, and define a parameter set as:

ps1= {EI->6, L->1000, P->100};

Then, at the point where you're ready to make the substitution of parameters for symbols, write expressions like yx/.ps1.

POSTED BY: John Doty
Posted 7 years ago

No, yx remains exactly the same, I might have clipped the P when I copied the image, but both formulas remain the same, nothing was changed. I only pressed "Shift -- Enter" a second time...But if you wish, look at the formula for "v" it is the same, yet the dimension on the y axis changed from -500 to -5...

POSTED BY: Raymond Low
Posted 7 years ago

yx is different in the two images.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard