# Running simulation in command line mode

**URL:** <https://forum.certara.com/t/running-simulation-in-command-line-mode/3611>\
**Category:** PML School\
**Created:** [June 8, 2022, 1:28pm UTC](https://forum.certara.com/t/running-simulation-in-command-line-mode/3611 "2022-06-08T13:28:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vetpharma](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@vetpharma](https://forum.certara.com/u/vetpharma)\
**Post date:** [June 8, 2022, 1:28pm UTC](https://forum.certara.com/t/running-simulation-in-command-line-mode/3611/1 "2022-06-08T13:28:41Z")

</div>

Hi,

I am trying to run simulations from the command line. My final model (.MDL) is a simple one compartment (following) model. I would like to run a simulation with a different dose level from the command line. so I created a dummy table for simulation as .csv file. Now, the question is how I should change the following script (PML) in the model file below to be able to simulate the new dose by command and receive the sim table as an output?

test(){  
cfMicro(A1, Cl / V, first = (Aa = Ka))  
dosepoint(Aa)  
C = A1 / V  
error(CEps = 28.5596588388192)  
observe(CObs = C + CEps \* sqrt(1 + C^2 \* (CMultStdev/sigma())^2))  
stparm(Ka = tvKa \* exp(nKa))  
stparm(V = tvV \* exp(nV))  
stparm(Cl = tvCl \* exp(nCl))  
stparm(CMultStdev = tvCMultStdev)  
fixef(tvKa = c(, 0.60176277128161, ))  
fixef(tvV = c(, 0.0144284881142417, ))  
fixef(tvCl = c(, 0.0299291076746268, ))  
fixef(tvCMultStdev = c(, 0.458258322029198, ))  
ranef(diag(nV, nCl, nKa) = c(1.0100196, 0.92041129, 0.9488175))  
}

Best  
Amir

---

<div class="post-metadata">

**Author:** ![cradhakr](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@cradhakr](https://forum.certara.com/u/cradhakr)\
**Post date:** [June 8, 2022, 1:55pm UTC](https://forum.certara.com/t/running-simulation-in-command-line-mode/3611/2 "2022-06-08T13:55:30Z")

</div>

Hi Amir,

I have attached a project file with a sample simulation. Also, there are a few youtube links that could be of use to you.

[Forum\_A\_sim.phxproj](https://forum.certara.com/uploads/short-url/wNBBf49QNZlwvlgUvqwXaUfSpI4.phxproj) (444 KB)

Hi,

I am trying to run simulations from the command line. My final model (.MDL) is a simple one compartment (following) model. I would like to run a simulation with a different dose level from the command line. so I created a dummy table for simulation as .csv file. Now, the question is how I should change the following script (PML) in the model file below to be able to simulate the new dose by command and receive the sim table as an output?

test(){  
cfMicro(A1, Cl / V, first = (Aa = Ka))  
dosepoint(Aa)  
C = A1 / V  
error(CEps = 28.5596588388192)  
observe(CObs = C + CEps \* sqrt(1 + C^2 \* (CMultStdev/sigma())^2))  
stparm(Ka = tvKa \* exp(nKa))  
stparm(V = tvV \* exp(nV))  
stparm(Cl = tvCl \* exp(nCl))  
stparm(CMultStdev = tvCMultStdev)  
fixef(tvKa = c(, 0.60176277128161, ))  
fixef(tvV = c(, 0.0144284881142417, ))  
fixef(tvCl = c(, 0.0299291076746268, ))  
fixef(tvCMultStdev = c(, 0.458258322029198, ))  
ranef(diag(nV, nCl, nKa) = c(1.0100196, 0.92041129, 0.9488175))  
}

Best  
Amir

---

<div class="post-metadata">

**Author:** ![cradhakr](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@cradhakr](https://forum.certara.com/u/cradhakr)\
**Post date:** [June 8, 2022, 1:58pm UTC](https://forum.certara.com/t/running-simulation-in-command-line-mode/3611/3 "2022-06-08T13:58:06Z")

</div>

> [@cradhakr](#):
>
> [http://https://www.youtube.com/watch?v=daSpOq1mczc](http://https//www.youtube.com/watch?v=daSpOq1mczc)
> 
> [http://https://www.youtube.com/watch?v=4PpZHGAHlsQ](http://https//www.youtube.com/watch?v=4PpZHGAHlsQ))
> 
> Hi Amir,
> 
> I have attached a project file with a sample simulation. Also, there are a few youtube links that could be of use to you. ([https://www.youtube.com/watch?v=daSpOq1mczc](https://www.youtube.com/watch?v=daSpOq1mczc)
> 
> [https://www.youtube.com/watch?v=4PpZHGAHlsQ](https://www.youtube.com/watch?v=4PpZHGAHlsQ))
> 
> [Forum\_A\_sim.phxproj](https://forum.certara.com/uploads/short-url/wNBBf49QNZlwvlgUvqwXaUfSpI4.phxproj) (444 KB)
> 
> Hi,
> 
> I am trying to run simulations from the command line. My final model (.MDL) is a simple one compartment (following) model. I would like to run a simulation with a different dose level from the command line. so I created a dummy table for simulation as .csv file. Now, the question is how I should change the following script (PML) in the model file below to be able to simulate the new dose by command and receive the sim table as an output?
> 
> test(){  
> cfMicro(A1, Cl / V, first = (Aa = Ka))  
> dosepoint(Aa)  
> C = A1 / V  
> error(CEps = 28.5596588388192)  
> observe(CObs = C + CEps \* sqrt(1 + C^2 \* (CMultStdev/sigma())^2))  
> stparm(Ka = tvKa \* exp(nKa))  
> stparm(V = tvV \* exp(nV))  
> stparm(Cl = tvCl \* exp(nCl))  
> stparm(CMultStdev = tvCMultStdev)  
> fixef(tvKa = c(, 0.60176277128161, ))  
> fixef(tvV = c(, 0.0144284881142417, ))  
> fixef(tvCl = c(, 0.0299291076746268, ))  
> fixef(tvCMultStdev = c(, 0.458258322029198, ))  
> ranef(diag(nV, nCl, nKa) = c(1.0100196, 0.92041129, 0.9488175))  
> }
> 
> Best  
> Amir

---

<div class="post-metadata">

**Author:** ![vetpharma](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@vetpharma](https://forum.certara.com/u/vetpharma)\
**Post date:** [June 21, 2022, 10:22am UTC](https://forum.certara.com/t/running-simulation-in-command-line-mode/3611/4 "2022-06-21T10:22:47Z")

</div>

> [@cradhakr](#):
>

Hi Cradhakr,

Thanks for your reply. I think I should elaborate a bit on my work. I built a popPk for L-dopa. Now, what I am trying to do, is making a platform (such as a website) for physicians to be able to see the simulated PK profile of L-Dopa with different dose levels and various dosing interval. This required that I have four components to be able to run simulations from a command line. which I have them.

[Certara Phoenix Assistance](https://onlinehelp.certara.com/phoenix/8.3/index.html#t=topics%2FRunning_NLME_Engines_in_Command_Line_Mode.htm&rhsearch=command%20line&rhhlterm=command%20line&rhsyns=%20)

I know how to build this website connecting that to the command line to run simulations.

The only problem that I have is what I should do in the PML code of my .MDL file to be able to run simulations through command line (without needing to open software).

I hope I could express my idea more clearly.

p.s. the youtube links are not accessible. Could you please check their address?

---

<div class="post-metadata">

**Author:** ![cradhakr](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@cradhakr](https://forum.certara.com/u/cradhakr)\
**Post date:** [June 22, 2022, 9:38pm UTC](https://forum.certara.com/t/running-simulation-in-command-line-mode/3611/5 "2022-06-22T21:38:55Z")

</div>

> [@vetpharma](#):
>
> Hi Cradhakr,
> 
> Thanks for your reply. I think I should elaborate a bit on my work. I built a popPk for L-dopa. Now, what I am trying to do, is making a platform (such as a website) for physicians to be able to see the simulated PK profile of L-Dopa with different dose levels and various dosing interval. This required that I have four components to be able to run simulations from a command line. which I have them.
> 
> [Certara Phoenix Assistance](https://onlinehelp.certara.com/phoenix/8.3/index.html#t=topics%2FRunning_NLME_Engines_in_Command_Line_Mode.htm&rhsearch=command%20line&rhhlterm=command%20line&rhsyns=%20)
> 
> I know how to build this website connecting that to the command line to run simulations.
> 
> The only problem that I have is what I should do in the PML code of my .MDL file to be able to run simulations through command line (without needing to open software).
> 
> I hope I could express my idea more clearly.
> 
> p.s. the youtube links are not accessible. Could you please check their address?

Hi,

I have to check with my technical team on this and get back to you.

Thanks

Mouli
