The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 ODE in Matlab

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Easwaran Posted - 08/16/2004 : 4:14:18 PM
I wrote a small program in Matlab to solve an ODE. It is almost same as vdpode of matlab except that the differential equations is changed. The code i wrote is,

tspan = [0, pi];
y0 = [0;pi/4];

% Solve the problem using ode45
ode45(@f,tspan,y0);
% ------------------------------------------------------------
function dydt = f(t,y)
dydt = [sin(y(1))];

I get a error indicating that,
"Solving F requires an initial condition vector of length 1."

I dont understand why. Since this is a first order equation, one initial condition would suffice. That is why, i have written y0 = [0,pi/4];
But i dont understand what is this error and how can it be rectified.

Can somebody help me.

With Regards,
V. Easwar

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000