Automatic solver selection
Abstract
A method, performed by a computer device, may include receiving a request to automatically select a solver for a simulation of an executable graphical model, determining a Jacobian matrix for the executable graphical model, calculating a stiffness of the executable graphical model based on the determined Jacobian matrix, and determining whether the calculated stiffness is greater than a stiffness threshold. The method may further include automatically selecting an implicit solver as the solver for the simulation, in response to determining that the calculated stiffness is greater than the stiffness threshold, automatically selecting an explicit solver as the solver for the simulation, in response to determining that the calculated stiffness is not greater than the stiffness threshold, and performing the simulation using the selected solver.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method, performed by a computer device, the method comprising:
receiving a request to automatically select a solver for a simulation of an executable graphical model, wherein the processing is performed by the computer device; determining a Jacobian matrix for the executable graphical model, wherein the determining is performed by the computer device; calculating a stiffness of the executable graphical model based on the determined Jacobian matrix, wherein the calculating is performed by the computer device; determining whether the calculated stiffness is greater than a stiffness threshold, wherein the determining is performed by the computer device; automatically selecting an implicit solver as the solver for the simulation, when the calculated stiffness is greater than the stiffness threshold, wherein the selecting is performed by the computer device; automatically selecting an explicit solver as the solver for the simulation, when the calculated stiffness is not greater than the stiffness threshold, wherein the selecting is performed by the computer device; and performing the simulation using the selected solver, wherein the performing is performed by the computer device.
2 . The method of claim 1 , wherein calculating the stiffness of the executable graphical model based on the determined Jacobian matrix includes:
calculating the stiffness based on a ratio of a maximum real part of an eigenvalue of the Jacobian matrix to a minimum real part of an eigenvalue of the Jacobian matrix.
3 . The method of claim 1 , further comprising:
determining a maximum step size for the selected implicit or explicit solver based on eigenvalues of the Jacobian matrix.
4 . The method of claim 3 , wherein determining a maximum step size for the selected implicit or explicit solver based on eigenvalues of the Jacobian matrix includes:
determining the eigenvalues of the Jacobian matrix; identifying an eigenvalue, of the determined eigenvalues, associated with a highest natural frequency; determining a highest forcing frequency used as input to the executable graphical model; and selecting the maximum step size based on a period associated with a maximum of the highest natural frequency and the highest forcing frequency.
5 . The method of claim 1 , wherein receiving the request to automatically select a solver for a simulation of an executable graphical model includes:
providing a user interface to select a simulation configuration, wherein the user interface includes an option to automatically select a solver for a simulation; and receiving a selection of the option to automatically select a solver for a simulation.
6 . The method of claim 1 , further comprising:
determining a computation cost associated with the Jacobian matrix, in response to automatically selecting the implicit solver for the simulation; determining that the computation cost associated with the Jacobian matrix is greater than a computation cost threshold; and changing the selection to select an explicit solver, in response to determining that the computation cost associated with the Jacobian matrix is greater than the computation cost threshold.
7 . The method of claim 1 , further comprising:
selecting a first type of solver for a first set of one or more states associated with the executable graphical model; and selecting a second type of solver for a second set of one or more states associated with the executable graphical model, wherein the first type of solver is different from the second type of solver.
8 . The method of claim 1 , wherein calculating the stiffness of the executable graphical model based on the determined Jacobian matrix includes:
selecting one or more states associated with the executable graphical model; and calculating a stiffness associated with the selected one or more states; and wherein the method further comprises: automatically selecting an implicit solver for the selected one or more states, in response to determining that the calculated stiffness, associated with the determined eigenvalue, is greater than the stiffness threshold; and automatically selecting an explicit solver for the selected one or more states, in response to determining that the calculated stiffness, associated with the determined eigenvalue, is not greater than the stiffness threshold.
9 . The method of claim 8 , further comprising:
determining a tolerance associated with the selected one or more states; determining whether the tolerance exceeds a tolerance threshold; and automatically selecting an explicit solver for the selected one or more states, in response to determining that the tolerance exceeds the tolerance threshold.
10 . The method of claim 1 , further comprising:
determining a re-computed the Jacobian matrix during the simulation of the executable graphical model; re-computing the stiffness of the executable graphical model based on the re-computed Jacobian matrix; and changing the selected implicit or explicit solver to a different solver during the simulation, in response to re-computing the stiffness.
11 . The method of claim 10 , wherein determining re-computed Jacobian matrix during the simulation of the executable graphical model includes:
storing the Jacobian matrix in memory prior to determining the re-computed Jacobian matrix.
12 . The method of claim 1 , further comprising:
receiving selection of a fixed step solver for the simulation of the executable graphical model; determining a maximum step size based on least one of the eigenvalues of the Jacobian matrix and the forcing frequencies used as input into the executable graphical model; determining a highest specified frequency for the executable graphical model; and selecting a step size for the fixed step solver based on a minimum of the determined maximum step size and the determined highest specified frequency.
13 . A non-transitory computer-readable medium storing instructions executable by one or more processors, the non-transitory computer-readable medium comprising:
one or more instructions to store an executable graphical model of a dynamic system; one or more instructions to receive a request to automatically select a solver for a simulation of the executable graphical model; one or more instructions to determine a Jacobian matrix of the executable graphical model; one or more instructions to calculate a stiffness of the executable graphical model based on the determined Jacobian matrix; one or more instructions to determine whether the calculated stiffness is greater than a stiffness threshold; one or more instructions to automatically select an implicit solver as the solver for the simulation, in response to determining that the calculated stiffness is greater than the stiffness threshold; one or more instructions to automatically select an explicit solver as the solver for the simulation, in response to determining that the calculated stiffness is not greater than the stiffness threshold; and one or more instructions to perform the simulation using the selected solver.
14 . The non-transitory computer-readable medium of claim 13 , further comprising:
one or more instructions to calculate the stiffness based on a ratio of a maximum eigenvalue of the Jacobian matrix to a minimum eigenvalue of the Jacobian matrix.
15 . The non-transitory computer-readable medium of claim 13 , further comprising:
one or more instructions to determine a maximum step size for the selected implicit or explicit solver based on eigenvalues of the Jacobian matrix.
16 . The non-transitory computer-readable medium of claim 15 , wherein the one or more instructions to determine the maximum step size for the selected implicit or explicit solver based on the eigenvalues of the Jacobian matrix include:
one or more instructions to determine the eigenvalues of the Jacobian matrix; one or more instructions to identify an eigenvalue, of the determined eigenvalues, associated with a highest natural frequency; one or more instructions to determine a highest forcing frequency used as input to the executable graphical model; and one or more instructions to select a maximum step size for the selected implicit or explicit solver based on a period associated with a maximum of the highest natural frequency and the highest forcing frequency.
17 . The non-transitory computer-readable medium of claim 13 , wherein the one or more instructions to receive the request to automatically select a solver for a simulation of the executable graphical model include:
one or more instructions to provide a user interface to select a simulation configuration, wherein the user interface includes an option to automatically select a solver for a simulation; and one or more instructions to receive a selection of the option to automatically select a solver for a simulation.
18 . The non-transitory computer-readable medium of claim 13 , further comprising:
one or more instructions to determine a computation cost associated with the Jacobian matrix, in response to automatically selecting the implicit solver for the simulation; one or more instructions to determine that the computation cost associated with the Jacobian matrix is greater than a computation cost threshold; and one or more instructions to change the selection to select an explicit solver, in response to determining that the computation cost associated with the Jacobian matrix is greater than the computation cost threshold.
19 . The non-transitory computer-readable medium of claim 13 , further comprising:
one or more instructions to select a first type of solver for a first set of one or more states associated with the executable graphical model; and one or more instructions to select a second type of solver for a second set of one or more states associated with the executable graphical model, wherein the first type of solver is different from the second type of solver.
20 . The on-transitory computer-readable medium of claim 13 , further comprising:
one or more instructions to select one or more states associated with the executable graphical model; one or more instructions to calculate a stiffness associated with the selected one or more states; one or more instructions to automatically select an implicit solver for the selected one or more states, in response to determining that the calculated stiffness, associated with the determined eigenvalue, is greater than the stiffness threshold; and one or more instructions to automatically select an explicit solver for the selected one or more states, in response to determining that the calculated stiffness, associated with the determined eigenvalue, is not greater than the stiffness threshold.
21 . The non-transitory computer-readable medium of claim 20 , further comprising:
one or more instructions to determine a tolerance associated with the selected one or more states; one or more instructions to determine whether the tolerance is greater than a tolerance threshold; and one or more instructions to automatically select an explicit solver for the selected one or more states, in response to determining that the tolerance is greater than the tolerance threshold.
22 . The non-transitory computer-readable medium of claim 13 , further comprising:
one or more instructions to determine a re-computed Jacobian matrix during the simulation of the executable graphical model; one or more instructions to re-compute the stiffness of the executable graphical model based on the re-computed Jacobian matrix; and one or more instructions to change the selected implicit or explicit solver to a different solver during the simulation, in response to re-computing the stiffness.
23 . The non-transitory computer-readable medium of claim 22 , wherein the one or more instructions to determine the re-computed Jacobian matrix during the simulation of the executable graphical model include:
one or more instructions to store the Jacobian matrix in memory prior to determining the re-computed Jacobian matrix.
24 . The non-transitory computer-readable medium of claim 13 , further comprising:
one or more instructions to receive selection of a fixed step solver for the simulation of the executable graphical model; one or more instructions to determine a maximum step size based on at least one of the eigenvalues of the Jacobian matrix and the forcing frequencies used as input into the executable graphical model; one or more instructions to determine a highest specified frequency for the executable graphical model; and one or more instructions to select a step size for the fixed step solver based on a minimum of the determined maximum step size and the determined highest specified frequency.
25 . A computing device, comprising:
a memory storing executable instructions for implementing an executable graphical model of a dynamic system; and a processor to:
receive a request to automatically select a solver for a simulation of the executable graphical model;
determine a Jacobian matrix of the executable graphical model;
calculate a stiffness of the executable graphical model based on the determined Jacobian matrix;
determine whether the calculated stiffness is greater than a stiffness threshold;
automatically select an implicit solver as the solver for the simulation, in response to determining that the calculated stiffness is greater than the stiffness threshold;
automatically select an explicit solver as the solver for the simulation, in response to determining that the calculated stiffness is not greater than the stiffness threshold; and
perform the simulation using the selected solver.Join the waitlist — get patent alerts
Track US2013116988A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.