Note
Go to the end to download the full example code
JacobianΒΆ
An example to define a Jacobian object
from pygetdp import Jacobian
from pygetdp.helpers import build_example_png, print_html
Instanciate the Jacobian
object
jac = Jacobian()
Then we define the different Jacobians as follow:
for js, s in enumerate(["Vol", "Sur", "Lin"]):
jac.add(Name=s) # add a new Jacobian item
jac.items[js].add() # add a new case
# add a new item in this case with Region and Jacobian type
jac.items[js].cases[0].add(Region="All", Jacobian=s)
print_html(jac.code)
Jacobian{
{ Name Vol;
Case {
{ Region All; Jacobian Vol; }
}
}
{ Name Sur;
Case {
{ Region All; Jacobian Sur; }
}
}
{ Name Lin;
Case {
{ Region All; Jacobian Lin; }
}
}
}
Finally we write and render the code as png
build_example_png(jac.code)
Total running time of the script: (0 minutes 0.637 seconds)