# DAMMmodel.jl Can't Work

**URL:** <https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101>\
**Category:** General Usage\
**Tags:** question, package\
**Created:** [July 12, 2022, 12:41pm UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101 "2022-07-12T12:41:45Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 12, 2022, 12:41pm UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/1 "2022-07-12T12:41:45Z")

</div>

Hi all,

I am trying this Julia package:  
[https://github.com/CUPofTEAproject/DAMMmodel.jl](https://github.com/CUPofTEAproject/DAMMmodel.jl)

After typing `using DAMMmodel’, I get this error:  
**UndefVarError: DAMMfdata not defined**  
**UndefVarError: DAMMviz not defined**

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [July 12, 2022, 1:49pm UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/2 "2022-07-12T13:49:26Z")

</div>

Works OK here:

```julia
(@v1.8) pkg> activate @Temp
  Activating project at `~/.julia/environments/Temp`

(@Temp) pkg> add DAMMmodel
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...

# ... a few moments later ...

julia> using DAMMmodel

julia> DAMMfdata(3)
3×3 DataFrame
 Row │ Tₛ θ Rₛ       
     │ Float64 Float64 Float64  
─────┼────────────────────────────
   1 │ 36.6 0.6 10.2602
   2 │ 39.6 0.7 1.5
   3 │ 3.6 0.2 2.21687
   
julia>

```

I didn’t attempt the fancy stuff though…

---

<div class="post-metadata">

**Author:** ![AlexisRenchon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexisrenchon/32/13328_2.png) [@AlexisRenchon](https://discourse.julialang.org/u/AlexisRenchon)\
**Post date:** [July 12, 2022, 2:43pm UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/3 "2022-07-12T14:43:32Z")

</div>

Hi Freya\_the\_Goddess,  
did you get it to work?  
What version do you have, it should be v0.1.18

```julia
(@v1.7) pkg> status
  Status `C:\Users\feu__\.julia\environments\v1.7\Project.toml`
  [7af7f183] DAMMmodel v0.1.18

```

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 12, 2022, 2:49pm UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/4 "2022-07-12T14:49:08Z")

</div>

The missing part to make it works:

```julia
activate @Temp

```

I didn’t know it is necessary to create a Temp directory.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 12, 2022, 2:52pm UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/5 "2022-07-12T14:52:07Z")

</div>

It works for DAMMfdata, I need to activate a Temp directory first…  
This is my version:

```julia
 [7af7f183] DAMMmodel v0.1.18

```

How to input / create our own DAMMfdata?  
Can we use CSV ? I think we can just follow the format of DAMMfdata…  
or is it more efficient to change the parameters in the DAMMviz()?

Makie rendering took a very long time. But it is the best they say.

I want to create a visualization / package like this but for Population Differential Equation, simpler than DAMMmodel.jl how to get started to create a package like yours @AlexisRenchon ?

![Capture d’écran_2022-07-12_21-48-32](https://global.discourse-cdn.com/julialang/original/3X/0/b/0b4b3ae04353a15d6094dd711da8a95025356e22.png)

This one took 15 minutes to finally finish:

 ![Capture d’écran_2022-07-12_22-08-14](https://global.discourse-cdn.com/julialang/original/3X/5/1/5140cfecfaf7b6277e3d37121e0c81fe83b61021.png)

maybe my RAM of 16 GB is not enough.

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [July 12, 2022, 3:02pm UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/6 "2022-07-12T15:02:36Z")

</div>

> [@Freya\_the\_Goddess](#):
>
> ```julia
> activate @Temp
> 
> ```
> 
> I didn’t know it is necessary to create a Temp directory.

`activate @Temp` just creates a project called “temp” in your “project/environments” folder. It’s useful if you want to try packages out but don’t want to have to deal with possible interactions with all your other packages you’ve installed. So I was able to test DAMMmodel.jl easily for you, and when I change back to my current project I don’t have to think about it again.

---

<div class="post-metadata">

**Author:** ![AlexisRenchon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexisrenchon/32/13328_2.png) [@AlexisRenchon](https://discourse.julialang.org/u/AlexisRenchon)\
**Post date:** [July 12, 2022, 4:30pm UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/7 "2022-07-12T16:30:36Z")

</div>

I created the function `DAMMfdata()` just to test things easily (it is a function to make fake data quickly). You don’t even need to follow the exact format of DAMMfdata, as long as you have vectors of Float64 data, you can make it work. For example you can load a dataframe using `CSV` and `DataFrames`.

As cormullion said, you should not have to use `activate @temp`, does it work without it now? If not, there may be a conflict with other packages from your environment, I am not sure.

`Makie` will take a long time the first time, but it will be fast after that. 15 minutes is really long though! it is much faster for me, maybe 1 minute the first time, then 1 second (haven’t tested).

For creating your own package, you should read and follow some tutorials about creating Julia packages, and then feel free to get inspiration from `DAMMmodel.jl`, all the code is accessible on GitHub. I am happy to help

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 12, 2022, 5:47pm UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/8 "2022-07-12T17:47:48Z")

</div>

I always create a new environment for each new project.

```julia
mkdir new_project
cd new_project
julia --project="."
]add xxx

```

You don’t have to, but it makes it possible to use different versions of the same package per project. I often want to use old versions for old projects and new versions for new projects.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 13, 2022, 12:04am UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/9 "2022-07-13T00:04:08Z")

</div>

I try to use another OS and it can’t load DAMMfdata.  
But the first OS can use it. Why I have to use `activate @Temp` to make DAMMmodel works? Is it something wrong with my JULIA’ packages installation? Which packages are at fault for this? How to check it?

Aside from that, I want to create this simple Logistic equation:  
[https://en.wikipedia.org/wiki/Logistic\_function](https://en.wikipedia.org/wiki/Logistic_function)

for modeling population growth, it is only simple 2D graphs, but perhaps can be made into 3D…

 ![Capture d’écran_2022-07-13_06-59-37](https://global.discourse-cdn.com/julialang/original/3X/1/8/18b65f22db1cfc20f104ba090dcff8b5cf073dd2.png)

---

<div class="post-metadata">

**Author:** ![AlexisRenchon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexisrenchon/32/13328_2.png) [@AlexisRenchon](https://discourse.julialang.org/u/AlexisRenchon)\
**Post date:** [July 13, 2022, 12:41am UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/10 "2022-07-13T00:41:08Z")

</div>

What OS do you use? I use Linux Mint.

I recommend reading [this](https://pkgdocs.julialang.org/v1/environments/) to learn how to work with Environments in Julia.

For example, it looks like this:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/f/ef5ed26f78ab7abd6b7fe28721215ee3c0f3df65.png)

Your new project directory will now have 2 files, Manifest.toml and Project.toml, like this

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/f/5f550b95c9c256cc40c4e72da6e4ebb77ba712a6.png)

You should now see the package by doing `]status`, call the package `using DAMMmodel`, and use its functions, like this

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/6/160b8e0dc05915cca56fa9ffd41e13cb992898ec.png)

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [July 13, 2022, 12:49am UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/11 "2022-07-13T00:49:26Z")

</div>

If you start julia in the folder of your project like this:

```julia
julia --project

```

then there is no need to activate it separately.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 13, 2022, 4:52am UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/12 "2022-07-13T04:52:39Z")

</div>

Thanks for this info. A nice shortcut

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 13, 2022, 4:54am UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/13 "2022-07-13T04:54:44Z")

</div>

I am able to do it after `activate .`

Then I have to close the Julia REPL and then open again so it can works.

My first OS: CAELinux  
The second OS: GFreya OS(I created it from Linux From Scratch version 11.0)

Thanks for the step by step tutorial.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [July 14, 2022, 12:32am UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/14 "2022-07-14T00:32:11Z")

</div>

@AlexisRenchon  
I add DAMMmodel in my newly package, I want to know when I do ‘add DAMMmodel’ is it adding all the dependencies on DAMMmodel that I can use for my package?

/DAMMmodel.jl-master/src/functions/viz/DAMMviz.jl is the file that I can use to edit the function right?

![Capture d’écran_2022-07-14_07-26-15](https://global.discourse-cdn.com/julialang/original/3X/0/1/01639ad8d60b30592f66f2f49b920603bd57cb28.png)

---

<div class="post-metadata">

**Author:** ![AlexisRenchon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexisrenchon/32/13328_2.png) [@AlexisRenchon](https://discourse.julialang.org/u/AlexisRenchon)\
**Post date:** [July 15, 2022, 12:14am UTC](https://discourse.julialang.org/t/dammmodel-jl-cant-work/84101/15 "2022-07-15T00:14:39Z")

</div>

I am not sure that you get all dependencies (like for example `Makie`) if you just have `DAMMmodel` is your package module. I don’t think so? You can test it.

The model is in src/functions/maths/DAMM.jl  
and src/functions/viz/DAMMviz.jl is a GLMakie interactive plot
