Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Trying to finish solving this problem but keep running into an error. Error message is "This value must be an integer" Mathcad file is attached.
There are two problems with the ranges you defined.
Francesco did address the first one (which you didn't ask for) as you had defined ranges i and j right in the front of your sheet with 0..1. So the plots consists of 2 points only. Guess the plots should have been i:=0..I and j:=0..J instead. As you don't use them otherwise its better to define them just in front of the plot.
The calculation of EX and EY which Francesco changed in his picture were perfectly correct in your sheet, too. Francesco just provided an alternate way.
I would prefer to use (EX EY):=... instead of E:=...
That means you assign the result of your program directly to a 1 x 2 matrix. Later in your sheet you simply would use EX instead of E[0,0 etc.
The second problem (and thats the one which throws the error you mentioned) is because of the ranges i:=10^-16..24 you defined. This results in a range consisting of non-integer values (second value would be 1+10^-16) which can't be used to index your array ex. Furthermore multiplying those values by 4 still results in non-interger values which of course can't be used to index E[0,0 (or EX).
Obviously its your goal to create a vector field plot with less values than the 101 you have for better clarity and you have to omit the first and last values in your arrays to avoid the division by zero.
So why not just use ranges from 1 to 24 ? This creates the arrays you have in mind with the small drawback that ex[0,0 and ey[0,0 never are assigned values and so they default to zero.
You should reset ex and ey by assigning them any scalar value before using the same variable names for a different array!