Skip to content

Commit 314363f

Browse files
committed
docu: little changes in tutorial
1 parent 8434627 commit 314363f

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

docs/src/tutorial/CollisionHandling.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ plot(bouncingSphere, "free.r", figure=1)
3636
3737
end
3838
```
39+
or
40+
```julia
41+
julia> import Modia3D
42+
julia> include("$(Modia3D.path)/test/Tutorial/BouncingSphere.jl")
43+
```
44+
3945
The commands above generate an instance of the model, simulate it and generate the following plot:
4046

4147
![Tutorial-Collision](../../resources/images/Tutorial/bouncingSphere.png)

docs/src/tutorial/GettingStarted.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ An [Object3D](@ref) constructor is the core element of Modia3D. It defines a coo
88

99
## 1. Pendulum
1010

11-
In the following example a simple pendulum is defined. This example is a copy of: `$(Modia3D.path)/test/Tutorial/Pendulum1.jl`
11+
In the following example a simple pendulum is defined. This example is a copy of: `$(Modia3D.path)/test/Tutorial/Pendulum1.jl`. [Here](https://github.com/ModiaSim/Modia3D.jl/wiki/Full-Installation-Guide-for-Julia,-Modia3D,-Modia#running-julia-code-with-vs-codiumvs-code) is a short description of how to execute a Julia file in VS Code,
1212

1313
```julia
1414
module Pendulum1
@@ -30,10 +30,10 @@ plot(pendulum, "rev.phi")
3030

3131
end
3232
```
33-
or
33+
or execute it in the Julia `REPL`
3434
```julia
35-
import Modia3D
36-
include("$(Modia3D.path)/test/Tutorial/Pendulum1.jl")
35+
julia> import Modia3D
36+
julia> include("$(Modia3D.path)/test/Tutorial/Pendulum1.jl")
3737
```
3838

3939
The `world` [Object3D](@ref) has feature [Scene](@ref) and is therefore the inertial system. The `body` Object3D is a [Solid](@ref) and defines the pendulum as a mass point with `mass = 1.0`. The `bodyFrame` Object3D defines a coordinate system on the `body` that is translated along the x-axis. A revolute joint connects `world` with `bodyFrame`.
@@ -73,8 +73,8 @@ end
7373
```
7474
or
7575
```julia
76-
import Modia3D
77-
include("$(Modia3D.path)/test/Tutorial/Pendulum2.jl")
76+
julia> import Modia3D
77+
julia> include("$(Modia3D.path)/test/Tutorial/Pendulum2.jl")
7878
```
7979

8080
Open the [three.js editor](https://threejs.org/editor/), import (File --> Import) the [json file](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4) `Pendulum2.json` in your working directory and inspect the model:
@@ -122,8 +122,8 @@ end
122122
```
123123
or
124124
```julia
125-
import Modia3D
126-
include("$(Modia3D.path)/test/Tutorial/Pendulum3.jl")
125+
julia> import Modia3D
126+
julia> include("$(Modia3D.path)/test/Tutorial/Pendulum3.jl")
127127
```
128128

129129
The commands above generate an instance of the model, simulate it and generate the following plot:
@@ -136,20 +136,21 @@ The commands above generate an instance of the model, simulate it and generate t
136136
All examples of this tutorial are stored in `$(Modia3D.path)/test/Tutorial`.
137137

138138
```julia
139-
include("$(Modia3D.path)/test/Tutorial/Pendulum1.jl")
140-
include("$(Modia3D.path)/test/Tutorial/Pendulum2.jl")
141-
include("$(Modia3D.path)/test/Tutorial/Pendulum3.jl")
142-
include("$(Modia3D.path)/test/Tutorial/BouncingSphere.jl")
139+
julia> import Modia3D
140+
julia> include("$(Modia3D.path)/test/Tutorial/Pendulum1.jl")
141+
julia> include("$(Modia3D.path)/test/Tutorial/Pendulum2.jl")
142+
julia> include("$(Modia3D.path)/test/Tutorial/Pendulum3.jl")
143+
julia> include("$(Modia3D.path)/test/Tutorial/BouncingSphere.jl")
143144
```
144145

145146
To run all tests without graphics, execute:
146147

147148
```julia
148-
include("$(Modia3D.path)/test/runtests.jl")
149+
julia> include("$(Modia3D.path)/test/runtests.jl")
149150
```
150151

151152
To run all tests with visualization and plots, execute:
152153

153154
```julia
154-
include("$(Modia3D.path)/test/runtestsWithGraphics.jl")
155+
julia> include("$(Modia3D.path)/test/runtestsWithGraphics.jl")
155156
```

0 commit comments

Comments
 (0)