필터 지우기
필터 지우기

how to plot a fourth ordinary differential equation

조회 수: 1 (최근 30일)
Lorenzo Mereu
Lorenzo Mereu 2021년 3월 8일
답변: David Jacob 2021년 3월 8일
Hi, I'm new on matlab and maybe this could be a silly answer. I solved this fourth order differential equation, but I have some problems with the function "fplot(usol(x))". Could anyone help me? Thank you! That's the code:
syms u(x) d
a=0.1
Du=diff(u,x)
D2u=diff(u,x,2)
D3u=diff(u,x,3)
ode=diff(u,x,4)==-4*(a^4)*u
c1=u(0)==d
c2=D2u(0)==0
c3=D2u(1)==0
c4=D3u(1)==0
conds=[c1 c2 c3 c4]
usol(x)=dsolve(ode,conds)
usol(x)=subs(usol(x))
fplot(usol(x));
-------------------------------
I report also the error:
Error using fplot>singleFplot (line 240)
Input must be a function or functions of a single
variable.
Error in
fplot>@(f)singleFplot(cax,{f},limits,extraOpts,args)
(line 200)
hObj = cellfun(@(f)
singleFplot(cax,{f},limits,extraOpts,args),fn{1},'UniformOutput',false);
Error in fplot>vectorizeFplot (line 200)
hObj = cellfun(@(f)
singleFplot(cax,{f},limits,extraOpts,args),fn{1},'UniformOutput',false);
Error in fplot (line 166)
hObj =
vectorizeFplot(cax,fn,limits,extraOpts,args);
Error in fourhordertravesuoloelastico (line 18)
fplot(usol(x));

답변 (1개)

David Jacob
David Jacob 2021년 3월 8일
The line usol(x) = subs(usol(x)) isn't doing anything. The function fplot can't plot your function your function, because it is dependent on x and d. Give d a value and it will work. Put something like: subs(usol,d,value)

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by