Filter löschen
Filter löschen

How to plot this differential equation

1 Ansicht (letzte 30 Tage)
Carlos Castañeda
Carlos Castañeda am 4 Jun. 2018
Beantwortet: Kim Winter am 3 Jul. 2018
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

Antworten (1)

Kim Winter
Kim Winter am 3 Jul. 2018
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

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by