Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
help with ode45 function

Subject: help with ode45 function

From: Lee

Date: 10 Feb, 2013 03:06:17

Message: 1 of 1

Hello,
I'm trying to solve a first-order differential equation using 'ode45', and it is taking way too long. I'm wondering if I am doing something wrong.

Basically, the ODE I'm trying to solve is V' = constant*f(V)

So, I have a fun1.m file:

function f = fun1(t,Vm)

gk = 0.415;
gcl = 0.582;
gna = 0.01;
Ek = -74.7*10^-3;
Ena = 54.2*10^-3;
Ecl = -65.8*10^-3;
Cm = 1e-6;

f = (-1/Cm)*(gk*(Vm-Ek)+gna*(Vm-Ena)+gcl*(Vm-Ecl));

Then, I am doing:

clear all
Vm_initial = -60*10^-3;
[t1 f1] = ode23('fun1',[0 10],Vm_initial);
plot(t1,f1);

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us