Skip to content

format markdown #2050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
style = "sciml"
format_markdown = true
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- This repository follows the [SciMLStyle](https://github.com/SciML/SciMLStyle) and the SciML [ColPrac](https://github.com/SciML/ColPrac).
- Please run `using JuliaFormatter, ModelingToolkit; format(joinpath(dirname(pathof(ModelingToolkit)), ".."))` before commiting.
- Add tests for any new features.
- This repository follows the [SciMLStyle](https://github.com/SciML/SciMLStyle) and the SciML [ColPrac](https://github.com/SciML/ColPrac).
- Please run `using JuliaFormatter, ModelingToolkit; format(joinpath(dirname(pathof(ModelingToolkit)), ".."))` before commiting.
- Add tests for any new features.
37 changes: 15 additions & 22 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,36 @@ The ModelingToolkit.jl package is licensed under the MIT "Expat" License:

> Copyright (c) 2018-22: Yingbo Ma, Christopher Rackauckas, Julia Computing, and
> contributors
>
>
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
>
>
> of this software and associated documentation files (the "Software"), to deal
>
>
> in the Software without restriction, including without limitation the rights
>
>
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
>
>
> copies of the Software, and to permit persons to whom the Software is
>
>
> furnished to do so, subject to the following conditions:
>
>
>
>
> The above copyright notice and this permission notice shall be included in all
>
>
> copies or substantial portions of the Software.
>
>
>
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
>
>
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>
>
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
>
>
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
>
>
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
>
>
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
>
>
> SOFTWARE.
>
>

The code in `src/structural_transformation/bipartite_tearing/modia_tearing.jl`,
which is from the [Modia.jl](https://github.com/ModiaSim/Modia.jl) project, is
Expand Down
11 changes: 5 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# ModelingToolkit v8 Release Notes


### Upgrade guide

- `connect` should not be overloaded by users anymore. `[connect = Flow]`
informs ModelingToolkit that particular variable in a connector ought to sum
to zero, and by default, variables are equal in a connection. Please check out
[acausal components tutorial](https://docs.sciml.ai/ModelingToolkit/stable/tutorials/acausal_components/)
for examples.
- `connect` should not be overloaded by users anymore. `[connect = Flow]`
informs ModelingToolkit that particular variable in a connector ought to sum
to zero, and by default, variables are equal in a connection. Please check out
[acausal components tutorial](https://docs.sciml.ai/ModelingToolkit/stable/tutorials/acausal_components/)
for examples.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# ModelingToolkit.jl


[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged)
[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/ModelingToolkit/stable/)

[![codecov](https://codecov.io/gh/SciML/ModelingToolkit.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/SciML/ModelingToolkit.jl)
[![Coverage Status](https://coveralls.io/repos/github/SciML/ModelingToolkit.jl/badge.svg?branch=master)](https://coveralls.io/github/SciML/ModelingToolkit.jl?branch=master)
[![Build Status](https://github.com/SciML/ModelingToolkit.jl/workflows/CI/badge.svg)](https://github.com/SciML/ModelingToolkit.jl/actions?query=workflow%3ACI)

[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle)

ModelingToolkit.jl is a modeling framework for high-performance symbolic-numeric computation
Expand Down Expand Up @@ -121,7 +120,9 @@ plot(sol, idxs = (a, lorenz1.x, lorenz2.z))
![](https://user-images.githubusercontent.com/17304743/187790221-528046c3-dbdb-4853-b977-799596c147f3.png)

# Citation

If you use ModelingToolkit.jl in your research, please cite [this paper](https://arxiv.org/abs/2103.05244):

```
@misc{ma2021modelingtoolkit,
title={ModelingToolkit: A Composable Graph Transformation System For Equation-Based Modeling},
Expand Down
61 changes: 31 additions & 30 deletions docs/src/basics/AbstractSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,29 @@ model manipulation and compilation.
### Subtypes

There are three immediate subtypes of `AbstractSystem`, classified by how many independent variables each type has:
* `AbstractTimeIndependentSystem`: has no independent variable (e.g.: `NonlinearSystem`)
* `AbstractTimeDependentSystem`: has a single independent variable (e.g.: `ODESystem`)
* `AbstractMultivariateSystem`: may have multiple independent variables (e.g.: `PDESystem`)

- `AbstractTimeIndependentSystem`: has no independent variable (e.g.: `NonlinearSystem`)
- `AbstractTimeDependentSystem`: has a single independent variable (e.g.: `ODESystem`)
- `AbstractMultivariateSystem`: may have multiple independent variables (e.g.: `PDESystem`)

## Constructors and Naming

The `AbstractSystem` interface has a consistent method for constructing systems.
Generally, it follows the order of:

1. Equations
2. Independent Variables
3. Dependent Variables (or States)
4. Parameters
1. Equations
2. Independent Variables
3. Dependent Variables (or States)
4. Parameters

All other pieces are handled via keyword arguments. `AbstractSystem`s share the
same keyword arguments, which are:

- `system`: This is used for specifying subsystems for hierarchical modeling with
reusable components. For more information, see the [components page](@ref components).
- Defaults: Keyword arguments like `defaults` are used for specifying default
values which are used. If a value is not given at the `SciMLProblem` construction
time, its numerical value will be the default.
- `system`: This is used for specifying subsystems for hierarchical modeling with
reusable components. For more information, see the [components page](@ref components).
- Defaults: Keyword arguments like `defaults` are used for specifying default
values which are used. If a value is not given at the `SciMLProblem` construction
time, its numerical value will be the default.

## Composition and Accessor Functions

Expand All @@ -43,32 +44,32 @@ total set, which includes that of all systems held inside.

The values which are common to all `AbstractSystem`s are:

- `equations(sys)`: All equations that define the system and its subsystems.
- `states(sys)`: All the states in the system and its subsystems.
- `parameters(sys)`: All parameters of the system and its subsystems.
- `nameof(sys)`: The name of the current-level system.
- `get_eqs(sys)`: Equations that define the current-level system.
- `get_states(sys)`: States that are in the current-level system.
- `get_ps(sys)`: Parameters that are in the current-level system.
- `get_systems(sys)`: Subsystems of the current-level system.
- `equations(sys)`: All equations that define the system and its subsystems.
- `states(sys)`: All the states in the system and its subsystems.
- `parameters(sys)`: All parameters of the system and its subsystems.
- `nameof(sys)`: The name of the current-level system.
- `get_eqs(sys)`: Equations that define the current-level system.
- `get_states(sys)`: States that are in the current-level system.
- `get_ps(sys)`: Parameters that are in the current-level system.
- `get_systems(sys)`: Subsystems of the current-level system.

Optionally, a system could have:

- `observed(sys)`: All observed equations of the system and its subsystems.
- `get_observed(sys)`: Observed equations of the current-level system.
- `get_continuous_events(sys)`: `SymbolicContinuousCallback`s of the current-level system.
- `get_defaults(sys)`: A `Dict` that maps variables into their default values.
- `independent_variables(sys)`: The independent variables of a system.
- `get_noiseeqs(sys)`: Noise equations of the current-level system.
- `get_metadata(sys)`: Any metadata about the system or its origin to be used by downstream packages.
- `observed(sys)`: All observed equations of the system and its subsystems.
- `get_observed(sys)`: Observed equations of the current-level system.
- `get_continuous_events(sys)`: `SymbolicContinuousCallback`s of the current-level system.
- `get_defaults(sys)`: A `Dict` that maps variables into their default values.
- `independent_variables(sys)`: The independent variables of a system.
- `get_noiseeqs(sys)`: Noise equations of the current-level system.
- `get_metadata(sys)`: Any metadata about the system or its origin to be used by downstream packages.

Note that if you know a system is an `AbstractTimeDependentSystem` you could use `get_iv` to get the
Note that if you know a system is an `AbstractTimeDependentSystem` you could use `get_iv` to get the
unique independent variable directly, rather than using `independent_variables(sys)[1]`, which is clunky and may cause problems if `sys` is an `AbstractMultivariateSystem` because there may be more than one independent variable. `AbstractTimeIndependentSystem`s do not have a method `get_iv`, and `independent_variables(sys)` will return a size-zero result for such. For an `AbstractMultivariateSystem`, `get_ivs` is equivalent.

A system could also have caches:

- `get_jac(sys)`: The Jacobian of a system.
- `get_tgrad(sys)`: The gradient with respect to time of a system.
- `get_jac(sys)`: The Jacobian of a system.
- `get_tgrad(sys)`: The gradient with respect to time of a system.

## Transformations

Expand Down
Loading