Skip to main content
1-Visitor
August 8, 2017
Question

Iteration

  • August 8, 2017
  • 3 replies
  • 1694 views

Hey ,

can anyone help me with that failure in my code?

I want to understand this.

 

Best thx ,

Stefan

3 replies

1-Visitor
August 8, 2017

Right-click the error and select "Trace Error".

Then select "First".

 

It takes you to the for loop in the "Iter_neu" function.  You have specified the end of your for loop to be last(G), but you have not defined G.  Therefore, Mathcad sees G as the built-in dimension for magnetic-flux density, Gauss, which is not a vector so Mathcad cannot accept it in the function last(G). 

1-Visitor
August 8, 2017

After looking at your program a little more, I see that you are calling Inter_neu within Inter_neu.  Is that intentional?  What are you trying to achieve?

1-Visitor
August 8, 2017

One more observation for you: your for loop can only contain 2,147,483,647 elements (2^31 - 1).  That's the largest number for a 32-bit integer.  So in your first "Iter" function, the for loop cannot go from 1 to 10^99.  If you try, it will give the error "Object reference not set to an instance of an object."

 

I took a guess at what you were trying to do and attached it here.

1-Visitor
August 9, 2017

Hey,

 

thank you for the help and good morrning 😃

 

greetings Stefan