Clear Filters
Clear Filters

ODE with Initial Conditions - Electroporation

2 views (last 30 days)
I have to solve the following ODE equation. I have all the variables imported into code already (including Ur). I have to solve the ODE for when Vm = 0, 0.3, 0.45,0.5,0.6 for two separate initial conditions: r=1E-8 and r=5E-10.
I then have to graph each Vm for each r (for a total of 10 plots).
All I was provided was:
options=odeset('MaxStep',1e-7);
tspan=[0 1e-3];
This is my code:
%Electroporation Project
sym vars
D=5E-14; %diffusion coefficient for pore radius
kB=1.38E-23; %boltzmann constant
T=310; %temperature
F=0.70E-9; %max electric force
rh = 0.97E-9; %velocity constant
rt = 0.31E-9; %velocity constant
B=1.4E-19; %steric repulsion energy (beta)
rs = 0.51E-9; %minimum radius of hydrophilic pores (r star)
g=1.8E-11; %edge energy (gamma)
s=-1E-4; %sigmaeff
r1=1E-8; %10 nm initial condition 1
r2 = 5E-10; %0.5nm initial condition 2
V = 0; %solving ODE for these values for both r1 and r2
%Equation dr/dt=Ur
U1=(D/kB*T)
U2=((V^2*F)*(r1+rt)/(1+rh))
U3=(4*B)*(rs/r1)^4*(1/r1)-2*pi*g+2*pi*s*r1
U=(U1*(U2+U3))
options=odeset('MaxStep',1e-7);
tspan=[0 1e-3];
[t,U] =ode45(@(t,U) U,tspan,r1, options)
figure
plot(t,U)
xlabel('t')
ylabel('U')
legend('Vmax=0, r1=10nm')
Can someone please help me.
  2 Comments
Star Strider
Star Strider on 28 Feb 2020
Post what you have coded.
Note that the ode45 call should be (in the for loop that passes the requisite values for ‘Vm’):
[t{j},r{j}] =ode45(@(t,U) U(t,r,Vm(j),sigmaeff), tspan, r1, options);
Change that to conform to your existing code for ‘U’.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!