Skip to main content
15-Moonstone
July 16, 2022
Solved

Puzzled - two calculations that give different results

  • July 16, 2022
  • 2 replies
  • 2660 views

I have two questions about the attached worksheet:

1. I am trying to calculate two functions in two different ways: One by using a program, the other using the step function. The program gives expected results and  for one of the functions, the step function expression agrees. For the other, it does not. Obviously, I am doing something wrong, but I cannot see what it is - I  thought I set them up in the same way.

2. When I eliminate an argument from the function, that I do not think is used, I get an error with "augument". This is something else I cannot understand.

Best answer by LucMeekes

Does the error in CallEvolve2() resolve if you call Evolve2() instead of Evolve1() in the one but last line?

 

Success!
Luc

2 replies

LucMeekes23-Emerald IVAnswer
23-Emerald IV
July 16, 2022

Does the error in CallEvolve2() resolve if you call Evolve2() instead of Evolve1() in the one but last line?

 

Success!
Luc

15-Moonstone
July 18, 2022

Thanks, Luc. I should have caught that. 

25-Diamond I
July 16, 2022

@JohnRudnicki wrote:

I have two questions about the attached worksheet:

1. I am trying to calculate two functions in two different ways: One by using a program, the other using the step function. The program gives expected results and  for one of the functions, the step function expression agrees. For the other, it does not. Obviously, I am doing something wrong, but I cannot see what it is - I  thought I set them up in the same way.

2. When I eliminate an argument from the function, that I do not think is used, I get an error with "augument". This is something else I cannot understand.


ad 1)

I have not studied the details and so cannot say, why "StateSlip" fails for the first 71 time values with results larger than 10^307. But you can get rid of those erranous values by using the "on error" statement to replace them with NaN's and as you can see the plot of the remaining values seems to look like you expected:

Werner_E_0-1658014990648.png

Here you can see up to which value of" t" the function fails

Werner_E_1-1658015510699.png

Error tracing leads us to this function call:

Werner_E_0-1658015821435.png

 

ad 2)

As Luc already suspected you forgot to call "Evolve2" instead of "Evolve1". Calling Evolve1 with only five arguments instead of the expected six means that the results are ot values but functions in one argument. These can't be augmented with "T", hence the error message.

 

 

15-Moonstone
July 18, 2022

Thanks, Werner,

 

1. Hmm. With the additional information you provided I will look again to see if I can figure out what is going on.

 

2. Yes, I called the wrong "Evolve"