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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Solve Block Iteration in Prime 3.0

ptc-6765804
1-Newbie

Solve Block Iteration in Prime 3.0

I'm trying to get a solution to a system of equations. I've got two equations, two unknowns. I can use the solve function to get the answers, but have no way of saving those answers to a matrix that I can use further down the line. I've attached my MathCAD sheet. The function I'm having issues with is on the next to last page.

Thanks for any help.

Mike

2 REPLIES 2

It seems to me that you arnot really firm with the basics of Prime.

I noticed that you assigned 45 and 90 to variables which later obviously are used as angles. You have to be aware that Prime as many other math progs default to radian. So either assign pi/2, etc. or add the (pseudo) unit deg, if, as I assume, you want that value be seen as angle in degree.

Furthermore I am not sure if you are aware, that by default Prime counts vector elements beginning with 0, not with 1. You have used most of the times ranges beginning with 1 to index your vectors but on one occasion you assign a value to h index 0, So I am not sure.

The main problem is, that you misused ranges and abviously are confused abou the differences between ranges and vectors. Ranges should be used on three occasions only: Index matrices and vectors, acting as variable in a programmed for-loop and as independent variable in a plot.

The result of your symbolic solve looks like a (nested) vector, but it isn't as all you see is the result of applying a range (m). Thats the reason Prime refuses to assign the result to a variable.

After correcting the use of ranges/vectors from the beginning of your sheet I would advice that you create a function depending an lamba which will return a single pair of solutions and later use that function by feeding it vector. You may use the symbolic solve as you did but I would rather advise to use a numeric solve block.

On last remark. On your lat page you have a range i 1.. 5 and assign m[i:=vector(1,3,4,7,9). I guess you are not sure what you are creating by this assignment. You are NOT cretaing a vector consisting of 5 values, but a 6-element vector. The first element of this vector is 0 (because your i range begins with 0) and every other element is the 5-element vector you assigned. Take a look yourself and type m= and you may also like to go to the "Matrices/Tables" ribbon and unckeck "Collapse Nested Matrices". I am pretty sure that you did not intend to create that nested vector.

I realized the range issue last night while working through this issue some more. I also realized that I could just take the equations that I'm attempting to solve for and solve them symolically first, then use those equations back in the main program as two seperate variables.

I'll fix the angle and range issue today and see if that works.

I appreciate the help!

M

Top Tags