Skip to main content
1-Visitor
January 26, 2015
Question

Symbolic calculation, units and programs in MP3.0

  • January 26, 2015
  • 9 replies
  • 2919 views

Hello to everyone,

I'm just giving a try to the MP3.0 trial version.

Basically, somewhere in the worksheet I need to find the max. value of a function over the range of its parameters.

Unfortunately I have some problems with the programming tools.

I'm struggling for a while to implement correctly the program I want as I'm not familiar with this programming feature of MathCAD, but I think there is a problem with units and/or external functions to the program.

I made a file with an example.

What do you think ?

9 replies

1-Visitor
January 26, 2015

When using ranges, if you use units, all elements must have units. If you use units, you must indicate the step size

test_prog_unit.png

for 0g to 10g by steps of 1g (but you can make it smaller if you want).

By the way, if you don't use units and don't specify step size, the default step size will be used (and it is 1).

24-Ruby IV
January 26, 2015

Adrien Thurin wrote:

By the way, if you don't use units and don't specify step size, the default step size will be used (and it is 1).

... or -1.

minone.png

Werner_E
25-Diamond I
January 26, 2015

1) What do you think that "unit" g should be? In Mathcad g is the constant of gravity (unless you redefine it), no matter if you label it as constant or as unit. If you want grams you should write gm.

2) When defining range variables with units, you have to provide the second value and to add units allover.
like: 0gm,1gm..10gm

1.png

Your second exampled worked because when you set up x e 0 .. [anything] you define a unitless scalar range with step 1. In my opinion the endvalue should throw an error as in your case its 10 g = 98.067 m/s^2 but it doesn't. Instead the loops goes up to 98 and the result you get is f(98,5).

1-Visitor
January 26, 2015

Woops ! I assumed the unit for grams was g and didn't check... shame on me !

Werner_E
25-Diamond I
January 26, 2015

Adrien Thurin wrote:

Woops ! I assumed the unit for grams was g

So did J G, I guess.