cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

5-Regular Member

## Defining an equation with range varibles

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"

1 ACCEPTED SOLUTION

Accepted Solutions
24-Ruby V
(To:YornEngtang)

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

I showed how to do this here: https://community.ptc.com/t5/PTC-Mathcad/Pi-and-Prime-numbers/m-p/678000/highlight/true#M191012

12 REPLIES 12
24-Ruby V
(To:trip12345)

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.

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:

13-Aquamarine
(To:Werner_E)

23-Emerald III
(To:YornEngtang)

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

5-Regular Member
(To:YornEngtang)

I don't think we have figured out how to graph a circle equation in the environment and have the graphing capabilities keep up. MathCAD is weaker in the graphing capabilities and honestly it's a sale game with content to create something that the market likes and actually reads. The art portion of this work is definitely pay to play.

I find that brute force methods get the job done but you have to explain so much about the inherit error in calculating with computational power alone when you don't have any experience to tell you what to design.

If you post sample files of what you mean, the community could help you write something that does a quadrant of a graph for spherical computations. Imagine taking it to spherical coordinates. Once you spend all the time writing that code it would keep your units really well to carry calculations for a long time.

I'm not supposed to share any of my files but I can write a quick example of what I mean to do because I like math and it's fun to problem solve in the environment. I'm looking for extra work if you ever want to reach out ideas for collaboration; I just need some definition to problem statements.

23-Emerald III
(To:YornEngtang)

Something like the attached?

Success!
Luc

13-Aquamarine
(To:LucMeekes)

24-Ruby V
(To:YornEngtang)

The problem and the circle program you used looks familiar to me 😉

The attached sheet should help.

13-Aquamarine
(To:Werner_E)

I would to many thank to you

13-Aquamarine
(To:Werner_E)

Dear Mr. Werner_E and all  , Can we convert this equation circle to rectangular array as picture above?

24-Ruby V
(To:YornEngtang)

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