0
$\begingroup$

Modeling 1D diffusion of an enzyme, e, through a sphere with substrate, s, I arrive at the below equations: Kappa is a constant and D_r is the Diffusivity of the enzyme. The first "e" is actually meant to be exp

I then pass these equations to NDSolve, Evaluate at a range of r and t and Plot and Manipulate as follows.

 Manipulate[
    sol2 = NDSolve[{
    D[sub[rad, tim], tim] == -(sub[rad, tim]) (en[rad, tim]),
    D[en[rad, tim], 
      tim] == (1/(k2/(k2 + k1r)))*(D0/((length^2) e0*k1f))*
      D[(Exp[beta (1 - sub[rad, tim])] D[en[rad, tim], rad]), rad],
    (*initial conditions*)
    sub[rad, 0] == s0, en[rad, 0] == 0,
    (*boundary conditions*)
    en[0, tim] == 1, sub[1, tim] == 1
    }, {sub, en}, {rad, 0, r0}, {tim, 0, 10}];
 Plot[Evaluate[
   Table[{sub[rad, tim], en[rad, tim]} /. sol2, {tim, 1, 10}]], {rad, 
   0, 1}, PlotRange -> All, 
  AxesLabel -> {"Front Position", "Concentration"}, 
  PlotLegends -> {"substrate", "enzyme"}],
 {{s0, 1}, 1, 10, 1},
 {{k2, .5}, 0.1, 1},
 {{k1r, 0.5}, 0.1, 1},
 {{k1f, 1}, 1, 10, 1},
 {{r0, 1}, 0, 1},
 {{e0, 1}, 0.1, 1},
 {{D0, .001}, 0.001, 1},
 {{length, 1}, 1, 10},
 {{beta, 1}, 0, 6}
 ]
$\endgroup$
  • $\begingroup$ It looks like Toolbox is not compatible with version 12. $\endgroup$ – Alex Trounev May 2 at 11:12
  • $\begingroup$ The code contains many typos: 1) use == instead of = in (boundary conditions); 2) use D[,r] instead of $\nabla _r$ 3) replace 'c[r,t]` by (s[r, t]*e[r, t])/kappa; 4) to avoid division by 0 exclude e[r,0]== 0; 5) don't use Toolbox6) define constants kappa, $D_r$ ;7) add boundary conditions. $\endgroup$ – Alex Trounev May 2 at 12:24
  • $\begingroup$ Please include the error message name. $\endgroup$ – Michael E2 May 2 at 12:27
  • $\begingroup$ The first error @AlexTrounev points out sounds like the cause of the NDSolve error. Related: mathematica.stackexchange.com/questions/40314/… $\endgroup$ – Michael E2 May 2 at 12:29
  • $\begingroup$ @MichaelE2 Second::shdw: Symbol Second appears in multiple contexts {AutomaticUnits,Prototypes}; definitions in context AutomaticUnits may shadow or be shadowed by other definitions. Fifth::shdw: Symbol Fifth appears in multiple contexts {AutomaticUnits,Prototypes}; definitions in context AutomaticUnits` may shadow or be shadowed by other definitions. Molecule::shdw: Symbol Molecule appears in multiple contexts {AutomaticUnits,System}; definitions in context AutomaticUnits` may shadow or be shadowed by other definitions.` $\endgroup$ – Alex Trounev May 2 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.