solving a differential equation

how do i solve it

댓글 수: 4

Ameer Hamza
Ameer Hamza 2018년 5월 5일
This is obviously a homework question. Please tell what have you already tried. What are the specific problems you are facing? Then we can guide you about that problem.
Amjad Green
Amjad Green 2018년 5월 5일
편집: Walter Roberson 2018년 5월 5일
not sure if my method is right way to solve
function vdot = amjad1(t,v )
%UNTITLED5 Summary of this function goes here
% Detailed explanation goes here
R=1e3;L=0.8;C=1e-3;
vdot(1)=v(2);
vdot(2)=(-1/(R*C))*v(2)-(1/(L*C)*vdot(1));
vdot=vdot';
end
then in command window
[t,v]=ode45('amjad1','[0:8]','[10 0]')
What is sunplot ? Did they mean subplot ?
The timespan and initial conditions should not be in quotes. Also it is better to use function handles than quoted function names
[t, v] = ode45(@amjad1, 0:8, [10 0])
vdot(2)=(-1/(R*C))*v(2)-(1/(L*C)*v(1));
instead of
vdot(2)=(-1/(R*C))*v(2)-(1/(L*C)*vdot(1));
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

답변 (1개)

Birdman
Birdman 2018년 5월 7일

0 개 추천

Use Symbolic approach:
R=1000;L=0.8;C=1e-3;
syms v(t)
eq=diff(v,2)+(1/(R*C))*diff(v)+v/(L*C)==0;
cond1=v(0)==10;
Dv=diff(v);
cond2=Dv(0)==0;
V(t)=dsolve(eq,[cond1 cond2])
t=0:0.01:8;
plot(t,V(t))

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2018년 5월 5일

댓글:

2018년 5월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by