Tag Archives: Integration

Julia and MATLAB can coexist. Let us show you how.

By: Great Lakes Consulting

Re-posted from: https://blog.glcs.io/juliacon-2025-preview

This post was written by Steven Whitaker.

Have you ever wished you could start using the Julia programming languageto develop custom models?Does the idea of replacingoutdated MATLAB code and modelsseem overwhelming?

Or maybe you don’t plan to replace all MATLAB code,but wouldn’t it be excitingto integrate Julia codeinto existing workflows?

Also, technicalities aside,how do you convince your colleaguesto make the leapinto the Julia ecosystem?

I’m excited to sharean announcement!At this year’s JuliaCon,I will be speaking abouta small but significant stepyou can take to start adding Juliato your MATLAB codebase.

Great news!You can transition to Julia smoothlywithout completely abandoning MATLAB.There’s a straightforward methodto embrace the best of both worlds,so you won’t needto rewrite your legacy models from scratch.

I’ll give my full talk in July,but if you don’t want to wait,keep readingfor a sneak peek!

Background

The GLCS.io teamhas been developing Julia-based solutions since 2015.Over the past 4 years,we’ve had the pleasure of redesigning and enhancing Julia modelsfor our clients in the finance, science, and engineering sectors.Its incredible speed and versatility have transformedhow we tackle complex computations together.However,we also fully acknowledge the reality:MATLAB continues to hold a significant placein countless companies and research labs worldwide.

For decades,MATLAB has been the benchmarkfor data analysis, modeling, and simulationacross scientific and engineering fields.There are likely hundreds of thousands of MATLAB licenses in use,with millions of userssupporting an unimaginable number of models and codebases.

Even for a single company,fully transitioning to Juliaoften feels insurmountable.The vast amount of existing MATLAB codepresents a significant challenge for any team considering adopting Julia.

Yet, unlocking Julia’s power is vital for companiesaiming to excel in today’s competitive landscape.The question isn’t if companiesshould adopt Julia—it’s how to do it.

Companies should blend Juliawith their MATLAB environments,ensuring minimal disruption and optimal resource use.This strategic integrationdelivers meaningful gainsin accuracy, performance, and scalabilityto transform operations and drive success.

JuliaCon Preview

At JuliaCon,I’m excited to share how youcan seamlessly integrate Juliainto existing MATLAB workflows—a processthat has delivered up to 100x performance improvementswhile enhancing code quality and functionality.Through a real-world model,I’ll highlight design patterns,benchmark comparisons,and valuable business case insightsto demonstrate the transformative potential of integrating Julia.

(Spoiler alert:the performance improvement is more than 100xfor the example I will show at JuliaCon.)

What We Offer

Unlock high-performance modeling!Our dedicated team is hereto integrate Julia into your MATLAB workflows.Experience a strategic, step-by-step process tailoredfor seamless Julia-MATLAB integration,focused on efficiency and delivering measurable results:

  1. Tailored Assessment:Pinpoint challenges and opportunities for Julia to address.
  2. MATLAB Benchmarking:Establish a performance baseline to measure progress and impact.
  3. Julia Model Development:Convert MATLAB models to Juliaor assist your team in doing so.
  4. Julia Integration:Combine Julia’s capabilities with your existing MATLAB workflows for optimal results.
  5. Roadmap Alignment:Validate performance improvements,create a strong business case for leadership,and agree on future support and innovation.

Check out our website for more details.

Summary

By attending my JuliaCon talk,you will learnhow to seamlessly integrate Juliainto your existing MATLAB codebase.And by leveraging our support at GLCS,you can adopt Juliawithout disruption—unlocking faster computations,improved models,and better scalabilitywhile retaining the strengthsof your MATLAB codebase.

Are you or someone you knowexcited about harnessing the power of Julia and MATLAB together?Let’s connect! Schedule a consultation todayto discover incredible performance gains of 100x or more.

Additional Links

MATLAB is a registered trademarkof The MathWorks, Inc.

Cover image:The JuliaCon 2025 logowas obtained from https://juliacon.org/2025/.

]]>

#MonthOfJulia Day 20: Calculus

Julia-Logo-Calculus

Mathematica is the de facto standard for symbolic differentiation and integration. But many other languages also have great facilities for Calculus. For example, R has the deriv() function in the base stats package as well as the numDeriv, Deriv and Ryacas packages. Python has NumPy and SymPy.

Let’s check out what Julia has to offer.

Numerical Differentiation

First load the Calculus package.

julia> using Calculus

The derivative() function will evaluate the numerical derivative at a specific point.

julia> derivative(x -> sin(x), pi)
-0.9999999999441258
julia> derivative(sin, pi, :central)       # Options: :forward, :central or :complex
-0.9999999999441258

There’s also a prime notation which will do the same thing (but neatly handle higher order derivatives).

julia> f(x) = sin(x);
julia> f'(0.0)                             # cos(x)
0.9999999999938886
julia> f''(0.0)                            # -sin(x)
0.0
julia> f'''(0.0)                           # -cos(x)
-0.9999977482682358

There are functions for second derivatives, gradients (for multivariate functions) and Hessian matrices too. Related packages for derivatives are ForwardDiff and ReverseDiffSource.

Symbolic Differentiation

Symbolic differentiation works for univariate and multivariate functions expressed as strings.

julia> differentiate("sin(x)", :x)
:(cos(x))
julia> differentiate("sin(x) + exp(-y)", [:x, :y])
2-element Array{Any,1}:
 :(cos(x))    
 :(-(exp(-y)))

It also works for expressions.

julia> differentiate(:(x^2 * y * exp(-x)), :x)
:((2x) * y * exp(-x) + x^2 * y * -(exp(-x)))
julia> differentiate(:(sin(x) / x), :x)
:((cos(x) * x - sin(x)) / x^2)

Have a look at the JuliaDiff project which is aggregating resources for differentiation in Julia.

Numerical Integration

Numerical integration is a snap.

julia> integrate(x -> 1 / (1 - x), -1 , 0)
0.6931471805602638

Compare that with the analytical result. Nice.

julia> diff(map(x -> - log(1 - x), [-1, 0]))
1-element Array{Float64,1}:
 0.693147

By default the integral is evaluated using Simpson’s Rule. However, we can also use Monte Carlo integration.

julia> integrate(x -> 1 / (1 - x), -1 , 0, :monte_carlo)
0.6930203819567551

Sympy-logo

Symbolic Integration

There is also an interface to the Sympy Python library for symbolic computation. Documentation can be found here. You might want to restart your Julia session before loading the SymPy package.

julia> using Sympy

Revisiting the same definite integral from above we find that we now have an analytical expression as the result.

julia> integrate(1 / (1 - x), (x, -1, 0))
log(2)
julia> convert(Float64, ans)
0.6931471805599453

To perform symbolic integration we need to first define a symbolic object using Sym().

julia> x = Sym("x");                       # Creating a "symbolic object"
julia> typeof(x)
Sym (constructor with 6 methods)
julia> sin(x) |> typeof                    # f(symbolic object) is also a symbolic object
Sym (constructor with 6 methods)

There’s more to be said about symbolic objects (they are the basis of pretty much everything in SymPy), but we are just going to jump ahead to constructing a function and integrating it.

julia> f(x) = cos(x) - sin(x) * cos(x);
julia> integrate(f(x), x)
     2            
  sin (x)         
- ─────── + sin(x)
     2     

What about an integral with constant parameters? No problem.

julia> k = Sym("k");
julia> integrate(1 / (x + k), x)
log(k + x)

We have really only grazed the surface of SymPy. The capabilities of this package are deep and broad. Seriously worthwhile checking out the documentation if you are interested in symbolic computation.

newton_and_leibniz

I’m not ready to throw away my dated version of Mathematica just yet, but I’ll definitely be using this functionality often. Come back tomorrow when I’ll take a look at solving differential equations with Julia.

The post #MonthOfJulia Day 20: Calculus appeared first on Exegetic Analytics.