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

Defining an equation with range varibles

trip12345
4-Participant

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

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

View solution in original post

12 REPLIES 12

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

 

 

YornEngtang
13-Aquamarine
(To:Werner_E)

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

 
 

 

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

trip12345
4-Participant
(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.

Something like the attached?

LucMeekes_0-1594928599052.png

 

 

Success!
Luc

 

YornEngtang
13-Aquamarine
(To:LucMeekes)

I'm really thank for shared me about this idea.

Your question does not match the problem discussed here in this thread. Why don't you open a new thread with your question?

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

The attached sheet should help.

Werner_E_0-1594935241232.png

 
 

 

 

 

YornEngtang
13-Aquamarine
(To:Werner_E)

I would to many thank to you 

YornEngtang
13-Aquamarine
(To:Werner_E)

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

Can you help explain me please? thank you in advance.  

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

View solution in original post

YornEngtang
13-Aquamarine
(To:Werner_E)

Thank you so much Werner_E 

trip12345
4-Participant
(To:Werner_E)

This message helped me the most. It helped to print out the range variable to make sure the program processed it. I accidentally accepted the wrong answer as a solution and I don't know how to change it. Oh well, this threads been taken over.

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."