Skip to main content
1-Visitor
July 14, 2020
Solved

Defining an equation with range varibles

  • July 14, 2020
  • 1 reply
  • 7563 views

I am writing a system of equations and I want to plug values in for my remaining unknowns from a range of values and graph the resulting function. I actually want to have several variables be range variables while known variables are just one value. Do I need to build filler matrices for the single value variables to match up the matrix size or can MathCAD see the single variables as scalars to multiply by the matrices? I want to solve the system of equations with a brute force method instead of solving at many different points to cancel out variables. Any help is appreciated. I will be searching the help files until I get some help figuring this out.

 

PS in the example I set a range variable of step size 1 N/mm to 100 N/mm and have the other variables defined as single value variables but I get the error message "This value must be a scalar or a matrix"

Best answer by Werner_E

This tread is still about the question "Defining an equation with range varibles" posed by user trip12345.

 

Please open a new thread with your question and state in more detail what you need.
I showed how to do this here: https://community.ptc.com/t5/PTC-Mathcad/Pi-and-Prime-numbers/m-p/678000/highlight/true#M191012

1 reply

25-Diamond I
July 14, 2020

You must be aware of the difference between a range and a vector.

Range variables should be used only for

1) indexing a matrix or vector

2) specifying the range of abscissa values in a 2D-plot

3) a for-loop in a program

 

In all other cases you should use vectors for a list of values.

There is an undocumented trick which quickly turns a range into a vector via inline evaluation which I used in the picture below. Doing calculations with vectors can be tricky and to be on the safe side you should use vectorization (I didn't in the screenshot below) to avoid unwanted effects.

Werner_E_0-1594755359889.png

A much better way IMHO would be to set up functions. In your example TABLE could be defined as a function if CHAIR (or maybe with all the other variables as function arguments, too) and could then be called with the vector as function argument. Here I used vectorization:

Werner_E_1-1594755629224.png

 

 

1-Visitor
July 16, 2020

Dear all, Please help me, how to plot many circle equation in one axis ?

 
 

 

23-Emerald IV
July 16, 2020

Prime complains that the index j to xo must be an integer. It apparently isn't coupled to your definition of j as a range.

Check your labels. The defined j is labelled as a 'variable', the index j (to x0 and y0) is a default '-'.

 

Success!
Luc