I’ve decided to try and use PieceWise in my boundary conditions for my 4 coupled PDEs, but it doesn’t seem to work out nicely. I’m receiving the error:

**NDSolve::overdet: There are fewer dependent variables, {IPB[z,t],IPF[z,t],IS1B[z,t],IS1F[z,t]}, than equations, so the system is overdetermined.**

Paramters:

`ROCP = 1; RICP = 0; ROCS1 = 0.5; RICS1 = 1; L = 5 10^-2; n = 1.556; c = 3 10^10; lR = 3; R1 = 0.99; gP = 20; gS1 = 20; sigmaSP = 10^-13; toffset = 5 10^-9; twidth = 10 10^-9; Energy = 1.3 10^-13; rad = 0.015; PumpInt = ((Energy)/(twidth ))/(Pi rad^2) ; PumpPeak = Exp[0.5 ((-toffset)/(twidth))^2] PumpInt; lc = n lR; alphaP = L/(2 lc); alphaS1 = (L - Log[R1])/(2 lc); tmax = 20 10^-9; `

The 4 PDEs I’m solving are:

`PDE = {D[IPF[z, t], z] == -(n/c) D[IPF[z, t], t] - gP IPF[z, t]*(IS1F[z, t] + IS1B[z, t]) - alphaP IPF[z, t], -D[IPB[z, t], z] == -(n/c) D[IPB[z, t], t] - gP IPB[z, t] (IS1F[z, t] + IS1B[z, t]) - alphaP IPB[z, t], D[IS1F[z, t], z] == -(n/c) D[IS1F[z, t], t] + gS1 IS1F[z, t] (IPF[z, t] + IPB[z, t]) - alphaS1 IS1F[z, t] + sigmaSP (IPF[z, t] + IPB[z, t]), -D[IS1B[z, t], z] == -(n/c) D[IS1B[z, t], t] + gS1 IS1B[z, t] (IPF[z, t] + IPB[z, t]) - alphaS1 IS1B[z, t] + sigmaSP (IPF[z, t] + IPB[z, t])}; `

And the Boundary conditions are:

`BC = {IPF[z, t] == PieceWise[{{PumpPeak*Exp[-0.5 ((t - toffset)/twidth)^2], z == 0 && t > 0}, {0, 0 <= z <= lR && t == 0}}], IPB[z, 0] == 0, IPB[lR, t] == IPF[lR, t] ROCP, IS1F[0, t] == IS1B[0, t] RICS1, IS1B[lR, t] == IS1F[lR, t] ROCS1, IS1F[z, 0] == 0, IS1B[z, 0] == 0}; `

And the NDSolve:

`solInt = NDSolve[{PDE, BC}, {IPF, IPB, IS1F, IS1B}, {z, 0, lR}, {t, 0, tmax}, MaxStepFraction -> {1/750, 1/10}, Method -> {"BDF", "MaxDifferenceOrder" -> 5}, InterpolationOrder -> All]; `

The main idea behind the boundary conditions is that IPF[z,t] = 0 at time t = 0 and for any z in the range 0 – lR, but for t > 0 and z = 0, it will have the form of the Gaussian equation.

Is it possible to impose these initial conditions?

Side note: Sorry if my post are similar, I didn’t know if I should piggyback on my last question or if this was something I should ask from scratch.

Cheers!