Skip to content
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

Updating documentation #102

Merged
merged 3 commits into from
Sep 8, 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
24 changes: 10 additions & 14 deletions docs/src/modelicaSystem.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Advanced API

A Julia style scripting API that handles low level API calls.
## ModelicaSystem

```@docs
Expand All @@ -11,7 +12,9 @@ OMJulia.OMCSession
OMJulia.quit
```

Let us see the usage of ModelicaSystem with the help of Modelica model `ModSeborgCSTRorg`
### Example
Let us see the usage of [`ModelicaSystem`](@ref) with the help of Modelica model
`ModSeborgCSTRorg`

```modelica
model ModSeborgCSTRorg
Expand Down Expand Up @@ -59,7 +62,7 @@ equation
y_T = T;
end ModSeborgCSTRorg
```
### Example

```@repl ModSeborgCSTRorg-example
using OMJulia
mod = OMJulia.OMCSession()
Expand All @@ -73,13 +76,14 @@ ModelicaSystem(mod,

## WorkDirectory

For each OMJulia session a temporary work directory is created and the results are
published in that working directory.
For each [`OMJulia.OMCSession`](@ref) session a temporary work directory is created and
the results are published in that working directory.
In order to get the work directory use [`getWorkDirectory`](@ref).

```@docs
getWorkDirectory
```

```@repl ModSeborgCSTRorg-example
getWorkDirectory(mod)
```
Expand Down Expand Up @@ -112,12 +116,7 @@ getSimulationOptions
getSolutions
```

Three calling possibilities are accepted using getXXX() where "XXX" can be any of the above functions (eg:) getParameters().
1. getXXX() without input argument, returns a dictionary with names as keys and values as values.
2. getXXX(S), where S is a string of names.
3. getXXX(["S1","S2"]) where S1 and S1 are array of string elements

### Examples of using Get Methods
### Examples

```@repl ModSeborgCSTRorg-example
getQuantities(mod)
Expand Down Expand Up @@ -146,6 +145,7 @@ getSimulationOptions(mod)
getSimulationOptions(mod, ["stepSize","tolerance"])
```
### Reading Simulation Results

To read the simulation results, we need to simulate the model first and use the getSolution() API to read the results

```@repl ModSeborgCSTRorg-example
Expand Down Expand Up @@ -176,10 +176,6 @@ setParameters
setSimulationOptions
```

Two setting possibilities are accepted using setXXXs(),where "XXX" can be any of above functions.
1.setXXX("Name=value") string of keyword assignments
2.setXXX(["Name1=value1","Name2=value2","Name3=value3"]) array of string of keyword assignments

### Examples

```@repl ModSeborgCSTRorg-example
Expand Down
3 changes: 2 additions & 1 deletion docs/src/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ plt = plot(df,
x=:time, y=:h,
mode="lines",
Layout(title="Bouncing Ball", height = 700))

OMJulia.quit(mod)
```

```@example ModelicaSystem-example
PlotlyDocumenter.to_documenter(plt) # hide
OMJulia.quit(mod) # hide
```

## Scripting API with sendExpression
Expand Down
Loading