Composite Models: two-zone jets#

from jetset.jet_model import Jet
from jetset.plot_sedfit import PlotSED
from jetset.model_manager import FitModel

Here I present how to implement a two-zone model using the composite models are handled by the FitModel class. In the next release, I will provide a flexible convenience method (and, hopefully, the possibility to have mutual components IC emission).

We setup a two-zone model for an EC scenario, using a conical jet.

Setting the two components#

from jetset.jet_model import Jet
compact_jet=Jet(name='compact_jet',beaming_expr='bulk_theta')
===> setting C threads to 12
compact_jet.add_EC_component(['EC_DT','EC_BLR'],disk_type='BB')
#we make the jet conical
compact_jet.make_conical_jet()
adding par: R_H to  R
adding par: theta_open to  R
==> par R is depending on ['R_H', 'theta_open'] according to expr:   R =
np.tan(np.radians(theta_open))*R_H
setting R_H to 5.715026151380672e+16
#we set the proper dependencies for the EC fields
compact_jet.set_EC_dependencies()
adding par: L_Disk to  R_BLR_in
==> par R_BLR_in is depending on ['L_Disk'] according to expr:   R_BLR_in =
3E17*(L_Disk/1E46)**0.5
adding par: R_BLR_in to  R_BLR_out
==> par R_BLR_out is depending on ['R_BLR_in'] according to expr:   R_BLR_out =
R_BLR_in*1.1
adding par: L_Disk to  R_DT
==> par R_DT is depending on ['L_Disk'] according to expr:   R_DT =
2E19*(L_Disk/1E46)**0.5
compact_jet.show_model()
--------------------------------------------------------------------------------
model description:
--------------------------------------------------------------------------------
type: Jet
name: compact_jet
geometry: spherical

electrons distribution:
 type: plc
 gamma energy grid size:  201
 gmin grid : 2.000000e+00
 gmax grid : 1.000000e+06
 normalization:  True
 log-values:  False
 ratio of cold protons to relativistic electrons: 1.000000e+00

accretion disk:
 disk Type: BB
 L disk: 1.000000e+45 (erg/s)
 T disk: 1.000000e+05 (K)
 nu peak disk: 8.171810e+15 (Hz)
radiative fields:
 seed photons grid size:  100
 IC emission grid size:  100
 source emissivity lower bound :  1.000000e-120
 spectral components:
   name:Sum, state: on
   name:Sum, hidden: False
   name:Sync, state: self-abs
   name:Sync, hidden: False
   name:SSC, state: on
   name:SSC, hidden: False
   name:EC_DT, state: on
   name:EC_DT, hidden: False
   name:DT, state: on
   name:DT, hidden: False
   name:Disk, state: on
   name:Disk, hidden: False
   name:EC_BLR, state: on
   name:EC_BLR, hidden: False
external fields transformation method: blob

SED info:
 nu grid size jetkernel: 1000
 nu size: 500
 nu mix (Hz): 1.000000e+06
 nu max (Hz): 1.000000e+30

flux plot lower bound   :  1.000000e-30

--------------------------------------------------------------------------------
Table length=21
model namenamepar typeunitsvalphys. bound. minphys. bound. maxlogfrozen
compact_jet*R(D,theta_open)region_sizecm5.000000e+151.000000e+031.000000e+30FalseTrue
compact_jetR_H(M)region_positioncm5.715026e+160.000000e+00--FalseFalse
compact_jetBmagnetic_fieldgauss1.000000e-010.000000e+00--FalseFalse
compact_jetNH_cold_to_rel_ecold_p_to_rel_e_ratio1.000000e+000.000000e+00--FalseTrue
compact_jetthetajet-viewing-angledeg1.000000e-010.000000e+009.000000e+01FalseFalse
compact_jetBulkFactorjet-bulk-factorlorentz-factor*1.000000e+011.000000e+001.000000e+05FalseFalse
compact_jetz_cosmredshift1.000000e-010.000000e+00--FalseFalse
compact_jetgminlow-energy-cut-offlorentz-factor*2.000000e+001.000000e+001.000000e+09FalseFalse
compact_jetgmaxhigh-energy-cut-offlorentz-factor*1.000000e+061.000000e+001.000000e+15FalseFalse
compact_jetNemitters_density1 / cm31.000000e+020.000000e+00--FalseFalse
compact_jetgamma_cutturn-over-energylorentz-factor*1.000000e+041.000000e+001.000000e+09FalseFalse
compact_jetpLE_spectral_slope2.000000e+00-1.000000e+011.000000e+01FalseFalse
compact_jetT_DTDTK1.000000e+020.000000e+00--FalseFalse
compact_jet*R_DT(D,L_Disk)DTcm5.000000e+180.000000e+00--FalseTrue
compact_jettau_DTDT1.000000e-010.000000e+001.000000e+00FalseFalse
compact_jettau_BLRBLR1.000000e-010.000000e+001.000000e+00FalseFalse
compact_jet*R_BLR_in(D,L_Disk)BLRcm1.000000e+180.000000e+00--FalseTrue
compact_jet*R_BLR_out(D,R_BLR_in)BLRcm2.000000e+180.000000e+00--FalseTrue
compact_jetL_Disk(M)Diskerg / s1.000000e+450.000000e+00--FalseFalse
compact_jetT_DiskDiskK1.000000e+050.000000e+00--FalseFalse
compact_jettheta_open(M)user_defineddeg5.000000e+001.000000e+001.000000e+01FalseFalse
--------------------------------------------------------------------------------

Now we clone the compact jet to generate the extended region

extended_jet=compact_jet.clone()
===> setting C threads to 12
adding par: L_Disk to  R_DT
==> par R_DT is depending on ['L_Disk'] according to expr:   R_DT =
2E19*(L_Disk/1E46)**0.5
adding par: L_Disk to  R_BLR_in
==> par R_BLR_in is depending on ['L_Disk'] according to expr:   R_BLR_in =
3E17*(L_Disk/1E46)**0.5
adding par: R_BLR_in to  R_BLR_out
==> par R_BLR_out is depending on ['R_BLR_in'] according to expr:   R_BLR_out =
R_BLR_in*1.1
adding par: R_H to  R
adding par: theta_open to  R
==> par R is depending on ['R_H', 'theta_open'] according to expr:   R =
np.tan(np.radians(theta_open))*R_H

Setting the composite model#

extended_jet.name='extended_jet'
from jetset.model_manager import FitModel
composite_jet=FitModel(nu_size=500, name='composite_jet')
/Users/orion/miniforge3/envs/jetset/lib/python3.10/site-packages/jetset/model_manager.py:158: UserWarning: no cosmology defined, using FlatLambdaCDM(name="Planck13", H0=67.77 km / (Mpc s), Om0=0.30712, Tcmb0=2.7255 K, Neff=3.046, m_nu=[0.   0.   0.06] eV, Ob0=0.048252)
  warnings.warn(m)
composite_jet.add_component(compact_jet)
composite_jet.add_component(extended_jet)

We set the functional expression for the model composition

composite_jet.composite_expr='extended_jet+compact_jet'
composite_jet.show_pars()
Table length=42
model namenamepar typeunitsvalphys. bound. minphys. bound. maxlogfrozen
compact_jet*R(D,theta_open)region_sizecm5.000000e+151.000000e+031.000000e+30FalseTrue
compact_jetR_H(M)region_positioncm5.715026e+160.000000e+00--FalseFalse
compact_jetBmagnetic_fieldgauss1.000000e-010.000000e+00--FalseFalse
compact_jetNH_cold_to_rel_ecold_p_to_rel_e_ratio1.000000e+000.000000e+00--FalseTrue
compact_jetthetajet-viewing-angledeg1.000000e-010.000000e+009.000000e+01FalseFalse
compact_jetBulkFactorjet-bulk-factorlorentz-factor*1.000000e+011.000000e+001.000000e+05FalseFalse
compact_jetz_cosmredshift1.000000e-010.000000e+00--FalseFalse
compact_jetgminlow-energy-cut-offlorentz-factor*2.000000e+001.000000e+001.000000e+09FalseFalse
compact_jetgmaxhigh-energy-cut-offlorentz-factor*1.000000e+061.000000e+001.000000e+15FalseFalse
compact_jetNemitters_density1 / cm31.000000e+020.000000e+00--FalseFalse
compact_jetgamma_cutturn-over-energylorentz-factor*1.000000e+041.000000e+001.000000e+09FalseFalse
compact_jetpLE_spectral_slope2.000000e+00-1.000000e+011.000000e+01FalseFalse
compact_jetT_DTDTK1.000000e+020.000000e+00--FalseFalse
compact_jet*R_DT(D,L_Disk)DTcm5.000000e+180.000000e+00--FalseTrue
compact_jettau_DTDT1.000000e-010.000000e+001.000000e+00FalseFalse
compact_jettau_BLRBLR1.000000e-010.000000e+001.000000e+00FalseFalse
compact_jet*R_BLR_in(D,L_Disk)BLRcm1.000000e+180.000000e+00--FalseTrue
compact_jet*R_BLR_out(D,R_BLR_in)BLRcm2.000000e+180.000000e+00--FalseTrue
compact_jetL_Disk(M)Diskerg / s1.000000e+450.000000e+00--FalseFalse
compact_jetT_DiskDiskK1.000000e+050.000000e+00--FalseFalse
compact_jettheta_open(M)user_defineddeg5.000000e+001.000000e+001.000000e+01FalseFalse
extended_jetgminlow-energy-cut-offlorentz-factor*2.000000e+001.000000e+001.000000e+09FalseFalse
extended_jetgmaxhigh-energy-cut-offlorentz-factor*1.000000e+061.000000e+001.000000e+15FalseFalse
extended_jetNemitters_density1 / cm31.000000e+020.000000e+00--FalseFalse
extended_jetgamma_cutturn-over-energylorentz-factor*1.000000e+041.000000e+001.000000e+09FalseFalse
extended_jetpLE_spectral_slope2.000000e+00-1.000000e+011.000000e+01FalseFalse
extended_jetT_DTDTK1.000000e+020.000000e+00--FalseFalse
extended_jet*R_DT(D,L_Disk)DTcm5.000000e+180.000000e+00--FalseTrue
extended_jettau_DTDT1.000000e-010.000000e+001.000000e+00FalseFalse
extended_jettau_BLRBLR1.000000e-010.000000e+001.000000e+00FalseFalse
extended_jet*R_BLR_in(D,L_Disk)BLRcm1.000000e+180.000000e+00--FalseTrue
extended_jet*R_BLR_out(D,R_BLR_in)BLRcm2.000000e+180.000000e+00--FalseTrue
extended_jetL_Disk(M)Diskerg / s1.000000e+450.000000e+00--FalseFalse
extended_jetT_DiskDiskK1.000000e+050.000000e+00--FalseFalse
extended_jet*R(D,theta_open)region_sizecm5.000000e+151.000000e+031.000000e+30FalseTrue
extended_jetR_H(M)region_positioncm5.715026e+160.000000e+00--FalseFalse
extended_jetBmagnetic_fieldgauss1.000000e-010.000000e+00--FalseFalse
extended_jetNH_cold_to_rel_ecold_p_to_rel_e_ratio1.000000e+000.000000e+00--FalseTrue
extended_jetthetajet-viewing-angledeg1.000000e-010.000000e+009.000000e+01FalseFalse
extended_jetBulkFactorjet-bulk-factorlorentz-factor*1.000000e+011.000000e+001.000000e+05FalseFalse
extended_jetz_cosmredshift1.000000e-010.000000e+00--FalseFalse
extended_jettheta_open(M)user_defineddeg5.000000e+001.000000e+001.000000e+01FalseFalse

Linking pars in the composite model#

Important

since we want the two-zone to share the same jet, we link all the jet-related parameters in the two model. For a pure SSC scenario, of course, you will not have the dusty tours, and the accretion disk.

linked_pars=['z_cosm','theta_open','theta','T_Disk','L_Disk','T_DT']
for par in linked_pars:
    composite_jet.link_par(par_name=par,from_model='extended_jet',to_model='compact_jet')
adding par: z_cosm to  z_cosm
adding par: theta_open to  theta_open
adding par: theta to  theta
adding par: T_Disk to  T_Disk
adding par: L_Disk to  L_Disk
adding par: T_DT to  T_DT

Important

Spectral components which are the same (i.e. duplicated), as the DT an the Disk, must be hidden in the jet component were are linked.

#we hide the duplicated components from DT and Disk
composite_jet.extended_jet.spectral_components.DT.hidden=True
composite_jet.extended_jet.spectral_components.Disk.hidden=True
composite_jet.show_pars()
Table length=42
model namenamepar typeunitsvalphys. bound. minphys. bound. maxlogfrozen
compact_jet*R(D,theta_open)region_sizecm5.000000e+151.000000e+031.000000e+30FalseTrue
compact_jetR_H(M)region_positioncm5.715026e+160.000000e+00--FalseFalse
compact_jetBmagnetic_fieldgauss1.000000e-010.000000e+00--FalseFalse
compact_jetNH_cold_to_rel_ecold_p_to_rel_e_ratio1.000000e+000.000000e+00--FalseTrue
compact_jettheta(M)jet-viewing-angledeg1.000000e-010.000000e+009.000000e+01FalseFalse
compact_jetBulkFactorjet-bulk-factorlorentz-factor*1.000000e+011.000000e+001.000000e+05FalseFalse
compact_jetz_cosm(M)redshift1.000000e-010.000000e+00--FalseFalse
compact_jetgminlow-energy-cut-offlorentz-factor*2.000000e+001.000000e+001.000000e+09FalseFalse
compact_jetgmaxhigh-energy-cut-offlorentz-factor*1.000000e+061.000000e+001.000000e+15FalseFalse
compact_jetNemitters_density1 / cm31.000000e+020.000000e+00--FalseFalse
compact_jetgamma_cutturn-over-energylorentz-factor*1.000000e+041.000000e+001.000000e+09FalseFalse
compact_jetpLE_spectral_slope2.000000e+00-1.000000e+011.000000e+01FalseFalse
compact_jetT_DT(M)DTK1.000000e+020.000000e+00--FalseFalse
compact_jet*R_DT(D,L_Disk)DTcm6.324555e+180.000000e+00--FalseTrue
compact_jettau_DTDT1.000000e-010.000000e+001.000000e+00FalseFalse
compact_jettau_BLRBLR1.000000e-010.000000e+001.000000e+00FalseFalse
compact_jet*R_BLR_in(D,L_Disk)BLRcm9.486833e+160.000000e+00--FalseTrue
compact_jet*R_BLR_out(D,R_BLR_in)BLRcm1.043552e+170.000000e+00--FalseTrue
compact_jetL_Disk(M)Diskerg / s1.000000e+450.000000e+00--FalseFalse
compact_jetT_Disk(M)DiskK1.000000e+050.000000e+00--FalseFalse
compact_jettheta_open(M)user_defineddeg5.000000e+001.000000e+001.000000e+01FalseFalse
extended_jetgminlow-energy-cut-offlorentz-factor*2.000000e+001.000000e+001.000000e+09FalseFalse
extended_jetgmaxhigh-energy-cut-offlorentz-factor*1.000000e+061.000000e+001.000000e+15FalseFalse
extended_jetNemitters_density1 / cm31.000000e+020.000000e+00--FalseFalse
extended_jetgamma_cutturn-over-energylorentz-factor*1.000000e+041.000000e+001.000000e+09FalseFalse
extended_jetpLE_spectral_slope2.000000e+00-1.000000e+011.000000e+01FalseFalse
extended_jetT_DT(L,compact_jet)DTK------FalseTrue
extended_jet*R_DT(D,L_Disk)DTcm6.324555e+180.000000e+00--FalseTrue
extended_jettau_DTDT1.000000e-010.000000e+001.000000e+00FalseFalse
extended_jettau_BLRBLR1.000000e-010.000000e+001.000000e+00FalseFalse
extended_jet*R_BLR_in(D,L_Disk)BLRcm9.486833e+160.000000e+00--FalseTrue
extended_jet*R_BLR_out(D,R_BLR_in)BLRcm1.043552e+170.000000e+00--FalseTrue
extended_jetL_Disk(L,compact_jet)Diskerg / s------FalseTrue
extended_jetT_Disk(L,compact_jet)DiskK------FalseTrue
extended_jet*R(D,theta_open)region_sizecm5.000000e+151.000000e+031.000000e+30FalseTrue
extended_jetR_H(M)region_positioncm5.715026e+160.000000e+00--FalseFalse
extended_jetBmagnetic_fieldgauss1.000000e-010.000000e+00--FalseFalse
extended_jetNH_cold_to_rel_ecold_p_to_rel_e_ratio1.000000e+000.000000e+00--FalseTrue
extended_jettheta(L,compact_jet)jet-viewing-angledeg------FalseTrue
extended_jetBulkFactorjet-bulk-factorlorentz-factor*1.000000e+011.000000e+001.000000e+05FalseFalse
extended_jetz_cosm(L,compact_jet)redshift------FalseTrue
extended_jettheta_open(L,compact_jet)user_defineddeg------FalseTrue

setting pars in the extended and compat components#

We now place the extended region at a larger scale compared to the compact one, i.e. we increase R_H, and we scale also the particle density and the magnetic field B.

Note

The magnetic field could be scaled automatically, setting in both the components (compact_jet and extended_jet) the same functional dependency as shown in Depending parameters, for the depending B field case.

composite_jet.compact_jet.parameters.R_H.val=1E18
composite_jet.extended_jet.parameters.R_H.val=5E19
composite_jet.extended_jet.parameters.gamma_cut.val=1E3
composite_jet.extended_jet.parameters.B.val=0.001
composite_jet.extended_jet.parameters.N.val=1
composite_jet.eval()
composite_jet.extended_jet.spectral_components.DT.hidden=True
composite_jet.extended_jet.spectral_components.Disk.hidden=True
composite_jet.eval()
p=composite_jet.plot_model(skip_components=False)
p.setlim(y_min=1E-16)
../../../../_images/Composite_model_two_zone_38_0.png