Skip to content

How to implement multi-dimensional independent variables? #400

Answered by jonathf
burakatakan asked this question in Q&A
Discussion options

You must be logged in to vote

I agree that examples of multivariate coordinates are lacking.

Following the quick tutorial, how about redefining the model solver. E.g. if you want a 2D mesh, you can do something like this:

coordinates = numpy.meshgrid(numpy.linspace(0, 10, 300), numpy.linspace(30, 40, 300))

def model_solver(parameters, coordinates=coordinates):
    """Simple ordinary differential equation solver."""
    alpha, beta = parameters
    return numpy.sin(alpha * coordinates[0, :]) * numpy.exp(beta * coordinates[1, :])

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@burakatakan
Comment options

Answer selected by burakatakan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants