This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

isaccelerated(SimFunction)

Determine if SimFunction object is accelerated

Syntax

tf = isaccelerated(F)
tf = isaccelerated(F,computerType)

Arguments

FSimFunction object created by the createSimFunction method of a SimBiology model.
computerTypeCharacter vector specifying a computer type. You can specify any valid archstr supported by the function computer.

Description

tf = isaccelerated(F) returns true if SimFunction object F is accelerated for the current type of computer or false otherwise.

tf = isaccelerated(F,computerType) returns true if F is accelerated for the specified type of computer or false otherwise.

Note

F is automatically accelerated at the first function execution. However, manually accelerate the object if you want it accelerated in your deployment applications.

Examples

collapse all

This example uses the Lotka-Volterra (predator-prey) model described by Gillespie [1].

Load the sample project containing the lotka model.

sbioloadproject lotka;

Create a SimFunction object f with c1 and c2 as input parameters to be scanned, and y1 and y2 as the output of the function with no dose.

f = createSimFunction(m1,{'Reaction1.c1', 'Reaction2.c2'},{'y1', 'y2'}, [])
f = 

SimFunction

Parameters:

         Name         Value       Type    
    ______________    _____    ___________

    'Reaction1.c1'      10     'parameter'
    'Reaction2.c2'    0.01     'parameter'

Observables: 

    Name      Type   
    ____    _________

    'y1'    'species'
    'y2'    'species'

Dosed: None

The SimFunction object f is not set for acceleration at the time of creation. But it will be automatically accelerated when executed.

f.isAccelerated
ans =

     0

Define an input matrix that contains parameter values for c1 and c2.

phi = [10 0.01];

Run simulations until the stop time is 5 and plot the simulation results.

sbioplot(f(phi,5))

Confirm the SimFunction object f was accelerated during execution.

f.isAccelerated
ans =

     1

References

[1] Gillespie D.T. "Exact Stochatic Simulation of Coupled Chemical Reactions," (1977) The Journal of Physical Chemistry, 81(25), 2340-2361.

Introduced in R2012b