필터 지우기
필터 지우기

How to plot this differential equation

조회 수: 1 (최근 30일)
Carlos Castañeda
Carlos Castañeda 2018년 6월 4일
답변: Kim Winter 2018년 7월 3일
Hi guys, I hope you can help me to plot this differential equation:
Y = diff(X,tau); eq = (1-alpha)/(1 - gamma*(Y - Vdr)) + alpha + beta*(Y - Vdr)^2 == F
cond = [X(0) == 0, Y(0) == 0, Vdr == 2, alpha == 0.2, beta == 0, gamma == 3]; sol = dsolve (eq,cond)
Also Y = diff(X,tau) has to be less than Vdr.
I'm completely new using matlab, so I tried to write
fplot(@(tau)sol(tau), [-5 5], '-o')
But I only got a warning message: Function behaves unexpectedly on array inputs. To improve performance, properly vectorize your function to return an output with the same size and shape as the input arguments.
Thanks

답변 (1개)

Kim Winter
Kim Winter 2018년 7월 3일
Hi, You have "tau" as an input, but never initialize it before the @fplot. For example, if you try to run just line 1 (Y=diff(X,tau);), you will get the error that X is uninitialized (although tau is not either). If you initialize your inputs, you may have a better result!
-Kim

카테고리

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

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by