Quantcast
Channel: PTC Community: Message List
Viewing all articles
Browse latest Browse all 12262

Re: Mixing ODE and find

$
0
0

Fred, I just had a look a your sheet again to see whats the problem because it should work OK the way you had set it up. I think I found the cause for the wrong value for R. Its the match() function and a simple precision problem which can be coped with in several ways:

 

1) Decrease TOL to something like 10^-10

 

2) Replace the calculation line for dx to take the mean of all indices wich match would return

1.png

3) Omit the match function completely and use some sort of interpolation (linear should be good enough here)

2.png

BTW, any specific reason you had set up your ODE using the charge function instead of the voltage function directly? A clever idea to use the constant R as second "function" to solve for. Incidentally we can do without that trick if we resort to a small program which creates the vector D for rxfixed on the fly. See attached file.

Personally I still prefer the odesolve approach but think its a pity we don't have any control anymore in Prime as of the algorithm used.


Viewing all articles
Browse latest Browse all 12262

Trending Articles