- #1

- 4

- 0

Hi all,

I'm a newbie at MATLAB and currently trying to model a chromatographic process, I have a PDE to be solved in the form of c*D(C_RH)/Dz = D(f)/Dz + s (see code below for what functions c, f and s are made of)

I have defined constant values for each of the individual parameters which make up functions c, f and s with the exception of the parameter C_RH which has yet to be solved.

Also z= linspace(0, 1, 5)

t = linspace(0, 1, 20)

Now I have the following matlab code for solving the PDE:

Note: d(C_RH)dz in matlab code is supposed to represent D(C_RH)/Dz

this is the way PDE terms were written in a matlab example script for solving PDEs.

I am getting a errors saying that the value assigned to c, f and s appears to be unused. Also errors saying 'Parse error at dz: usage might be invalid MATLAB syntax'.

Can anybody me help please?

Regards

I'm a newbie at MATLAB and currently trying to model a chromatographic process, I have a PDE to be solved in the form of c*D(C_RH)/Dz = D(f)/Dz + s (see code below for what functions c, f and s are made of)

I have defined constant values for each of the individual parameters which make up functions c, f and s with the exception of the parameter C_RH which has yet to be solved.

Also z= linspace(0, 1, 5)

t = linspace(0, 1, 20)

Now I have the following matlab code for solving the PDE:

Matlab:

```
[c,f,s] = pdefun(z,t,C_RH,dC_RHdz)
[c,f,s] = pdex1pde(z,t,C_RH,dC_RHdz)
c = epsilon_t*C_H_cation+epsilon_e*K_a_sucrose;
f = (D_L_sucrose)*epsilon_e*((C_H_cation)+(K_a_sucrose))*d(C_RH)dz;
s = -u*((C_H_cation)+(K_a_sucrose))*d(C_RH)dz;
```

this is the way PDE terms were written in a matlab example script for solving PDEs.

I am getting a errors saying that the value assigned to c, f and s appears to be unused. Also errors saying 'Parse error at dz: usage might be invalid MATLAB syntax'.

Can anybody me help please?

Regards

Last edited by a moderator: