Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help me solve a differential equation with MATLAB

Status
Not open for further replies.

Fractional-N

Full Member level 1
Full Member level 1
Joined
Oct 15, 2007
Messages
97
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
2,071
how to solve differential equation by matlab

48_1224950666.jpg


i want to solve the above differential equation in matlab.
i wrote this m-file:

Code:
function dv=diffv(t,vv)
vv=[0;1];
v=vv(1);
vdot=vv(2);

l=1e-5;
c=1e-6;

vdot=vdot;
vdoubledot=5/(l*c)-vdot/c*(3/10*(v-21/4)^2-2)-vdot/(l*c);
dv=[vdot;vdoubledot];
[T,V]=ode15s(@diffv,[0 0.1],[0 0]);
plot(T,V(:,1),'-')

the above program return an error:
??? Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N)
to change the limit. Be aware that exceeding your available stack space can
crash MATLAB and/or your computer.

Error in ==> funfun\private\odearguments at 227

then i removed the 2 last line and type it in command window. the error is gone but the plot is a line. it must be a sinusoidal.

Code:
function dv=diffv(t,vv)
vv=[0;1];
v=vv(1);
vdot=vv(2);

l=1e-5;
c=1e-6;

vdot=vdot;
vdoubledot=5/(l*c)-vdot/c*(3/10*(v-21/4)^2-2)-vdot/(l*c);
dv=[vdot;vdoubledot];
 

anyone knows how to solve a differential equation with matlab??

i really need help
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top