# Is it possible to use Julia as a co-simulator in conjunction to PSCAD/EMTDC or MATLAB

**URL:** <https://discourse.julialang.org/t/is-it-possible-to-use-julia-as-a-co-simulator-in-conjunction-to-pscad-emtdc-or-matlab/52516>\
**Category:** Modelling & Simulations\
**Created:** [December 28, 2020, 2:33pm UTC](https://discourse.julialang.org/t/is-it-possible-to-use-julia-as-a-co-simulator-in-conjunction-to-pscad-emtdc-or-matlab/52516 "2020-12-28T14:33:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anchasatish](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/anchasatish/32/20094_2.png) [@anchasatish](https://discourse.julialang.org/u/anchasatish)\
**Post date:** [December 28, 2020, 2:33pm UTC](https://discourse.julialang.org/t/is-it-possible-to-use-julia-as-a-co-simulator-in-conjunction-to-pscad-emtdc-or-matlab/52516/1 "2020-12-28T14:33:06Z")

</div>

I want to use Julia programming for running optimization of the system whose dynamic modeling is made in EMTDC/PSCAD, or MATLAB, i.e., optimization problem solved in Julia and output of this optimization solution is given to the dynamic model in PSCAD or MATLAB. Again the output of this simulation is given as input to Julia for determining optimal solution (i.e., optimization).  
As I found some Julia modules like PowerModels.jl for the application of power systems optimization, I want to use the same in my research work. If we can use Julia as a co-simulation, please let me know how to do it.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 29, 2020, 2:06pm UTC](https://discourse.julialang.org/t/is-it-possible-to-use-julia-as-a-co-simulator-in-conjunction-to-pscad-emtdc-or-matlab/52516/2 "2020-12-29T14:06:36Z")

</div>

> [@anchasatish](#):
>
> optimization problem solved in Julia and output of this optimization solution is given to the dynamic model in PSCAD or MATLAB

You can call the objective function using

> **[GitHub - JuliaInterop/MATLAB.jl: Calling MATLAB in Julia through MATLAB Engine](https://github.com/JuliaInterop/MATLAB.jl)**
>
> Calling MATLAB in Julia through MATLAB Engine. Contribute to JuliaInterop/MATLAB.jl development by creating an account on GitHub.

and use a black box optimizer, eg

> **[GitHub - robertfeldt/BlackBoxOptim.jl: Black-box optimization for Julia](https://github.com/robertfeldt/BlackBoxOptim.jl)**
>
> Black-box optimization for Julia. Contribute to robertfeldt/BlackBoxOptim.jl development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [December 29, 2020, 2:10pm UTC](https://discourse.julialang.org/t/is-it-possible-to-use-julia-as-a-co-simulator-in-conjunction-to-pscad-emtdc-or-matlab/52516/3 "2020-12-29T14:10:41Z")

</div>

We are building one as part of the larger ModelingToolkit project. It’s not quite ready yet so currently we’re pycalling to fmupy.
