Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to Mathcad 2

Status
Not open for further replies.

bigroo84

Structural
Dec 3, 2009
8
Hi,

Can anyone take a look at my file to see if I have understood the what is being asked of me properly as I have only just started Mathcad & need all the help I can get!

Thank you
 
Replies continue below

Recommended for you

It looks right. Couple of comments,

1. rather than copy the expression from V(x), just differentiate V(x) directly; this is a general principle and saves an awful lot of copy/paste or transcription problems.

2. use the keyword 'simplify' - this often gives a different, but equivalent, result to a plain symbolic evaluation

3. assign the symbolic result to a variable or function

4. do a quick numerical check if you're not sure about the result
 
 http://files.engineering.com/getfile.aspx?folder=756ee308-92d9-4ee8-96f5-966c9880a247&file=Engtips.mcd
Wow that sure does look a lot neater & 'simplified'.

What difference does the word 'simplify' do compared to Ctrl.
 
Okay so if I wanted to find a value of x where V'(x)=0 I presume I use a solve block.

If so would I now write:

dVs2(x):=0

Given

then put the dVs2(x) equal to something?
 
1. 'simplify' makes an attempt to make the expression less 'complex' according to whatever rules are built into the symbolic processor. ctl-. does a 'basic' job and goes for the first answer it comes across.

2. You could use a solve block, but better (in this instance) is to use the symbolic solve keyword

try

roots:=dVs2(x) solve,x->

this will show you the roots (in symbolic form); type 'roots=' to see the numeric values.

then

type 'dvs2(roots)='

to check they really are the zero points.

You could plot them on the graph by double-clicking on the plot, setting x-axis markers, then typing roots[0 and roots[1 into the placeholders.

To see the negative root, you'll need to add Im(dVs2(x)) to the plot
 
 http://files.engineering.com/getfile.aspx?folder=5550fa74-0ecb-4142-9bcd-576599fba34b&file=Engtips.mcd
Wow again! I'm learning so much just in 1 question!

Why isn't a solve block suitable here?

So do I understand you that roots returns a value of x when the f(x)=0

Im is also a new operator to me.

 
>> Why isn't a solve block suitable here?

A solve block is suitable, but the symbolic solve is simpler and more direct.

>> So do I understand you that roots returns a value of x when the f(x)=0

Yes. I could have been more explicit and said f(x)=0 solve x, but Mathcad assumes that's what meant.

== Im is also a new operator to me

Re is the counterpart for real, and you use |z| to get the magitude of complex number z and arg(z) to get the argument.
 
So the total volume was V(x)=(10+x)/6.sqrt(32-(5-x)^2) with x between 0 & 10.657, how do you get the maximum volume?

Do I plug in values for x within the range given?
 
if V(x) is a volume equation, then the maximum volume will occur at the root that gives a real volume (that is, roots[0 in my worksheet). Just write "V(roots[0)=" to get the answer.

You could also find the zeros of the volume using solve (there will be three of them) and then plot V(x) between the appropriate roots, and put roots[0 as a marker to validate that it really is the max volume.
 
 http://files.engineering.com/getfile.aspx?folder=d7093ef1-ef95-47bf-abc2-5d3a8b40d6cc&file=Engtips.mcd
Right I was okay up until the last bit & these are probably daft questions but you have helped me immensely so far:

What is the answer to the max volume as there are 3 values?
-10
10.657 (zero y value)(root)
-0.657 (zero y value)(root)

When you write "V(roots[0)=" what is the [ for?

Also how did you add another placeholder to the graph?
 
== What is the answer to the max volume as there are 3 values?
== -10,10.657 (zero y value)(root),-0.657 (zero y value)(root)

Sorry, those values are the zeros of V(x); I used them to show where the effective min and max x values were. If you plot V(x) between -11 and +11, you should see that the 2nd and 3rd roots correspond to the limits of the x values for a real volume.

The maximum volume is given at the root of the d/dx V(x) which gives a real result, ie ~6.733.

When you write "V(roots[0)=" what is the [ for?

That's the character you type to get a vector (strictly 'array') index placeholder. Most languages tend to use parentheses or brackets for vector indexing (eg, v(1) or v[1]), but Mathcad uses a subscripted index (unfortunately, I don't know how to show subscripts in this forum); typing v[1 gives access to the element of v with index 1 (Mathcad array indexing is zero-based by default).

Just to confuse beginners, there is another type subscript, the 'literal subscript' - type v.1 to get an example. In an indexed subscript, the subscript can be a number, variable, or other expression that evaluates to an integer. A literal subscript, however, is part of the name; it allows names such as epsilon0 to be expressed as they would appear in a text book.

Look them up in Help.

== Also how did you add another placeholder to the graph?

On the x and y axes, just type ',' then the new expression -this will plot the new expression (provided it's correct, of course).

The value root[0 is implemented as a 'marker'. Each 2D plot allows the user to put two markers on each axis, and is intended to allow the user to display a straight line running up (x axis) the plot or across (y axis) it. You set these by double-clicking on the plot to bring up the control dialog box and then allowing markers - again, see Help.
 
The maximum is shown as 14.933 only because you have not included very many points in the range variable x. To get the actual maximum, use the root of the first derivative x=6.733. V(6.733) = 15.017
 
Thanks excognito for all of your help & I will look at your notes when I get home. You have been a great help.

jghrist that is an interesting use of the first derivative root for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor