How can I create a ParallelTable with finer resolution at certain points?

Mathematica Asked on May 9, 2021

For example, say I have a function testfunc already defined to take one argument $x$. This command would create a table of testfunc for $x$ from $0.1$ to $0.9$ in steps of $0.1$:


Suppose I know that testfunc varies substantially more between $0.4 < x < 0.5$, so I want the ParallelTable to evaluate that region with more resolution. How can I run the command for $0.1 < x < 0.4, 0.5 < x < 0.9$ in steps of $0.1$, but the middle region in steps of $0.01$?

A first guess is to use something like ParallelTable[testfunc[x],{x,{Range[0.1,0.4,0.1],Range[0.41,0.49,0.01],Range[0.5,0.9,0.1]}}]

But it does not give the desired result.

enter image description here

In this case my desired result would be {0.1, 0.01},{0.2,0.04},{0.3,0.09},{0.4,0.16},{0.41,0.1681},{0.42,0.1764} ... etc.

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP