Drasil icon indicating copy to clipboard operation
Drasil copied to clipboard

WIP making ODEs work in Julia

Open B-rando1 opened this issue 1 year ago • 2 comments

Unfortunately we can't quite finish getting ODEs in Julia, but this should guide the way when we're ready.

The reason we can't finish is because the ODE library uses structs, and the Julia renderer doesn't support structs yet.

Other changes:

  • I changed how Julia imports libraries, as that was previously incorrect. I will create a separate PR for this.
  • I changed how Julia represents empty lists. Previously any empty list was simply []; now it is Type[] - e.g. an empty list of doubles is Float64[]. The reason for this is because Julia assigns [] the type Array{Any}, which causes problems when you need it to be type Array{Float}, for example. I will also create a separate PR for this.
  • I created the populateSolList' function, which acts like the populateSolList but without accessing a field. I think that once we have structs in Julia, we won't need this function.
  • I removed the [] case from applyWithNamedArgs, as it was causing problems.

I commented most of the things that need to be changed once we have structs. You can also refer to my test case here to compare.

@JacquesCarette @smiths @balacij feel free to give any feedback or ask any questions you have.

Contributes to #3918

B-rando1 avatar Aug 21 '24 15:08 B-rando1

Why did you change Bundled to Unbundled in one example? Also, if you could rebase, so that it's easier to see what's new in just this PR?

JacquesCarette avatar Aug 23 '24 03:08 JacquesCarette

I changed the example to Unbundled since Julia can't support Bundled until we add Structs. Basically I just needed a way to see/show what code it was outputting for one of the ODE examples. Since adding Structs to Julia should unblock both ODEs and Bundled, we can probably put it back to Bundled by the time this PR is finished.

B-rando1 avatar Aug 23 '24 13:08 B-rando1