Filter löschen
Filter löschen

draw othorgonal trajectories using differential equations

5 Ansichten (letzte 30 Tage)
to draw orthogonal trajectories am i suppose to use dfield or is ezplot as shown below on the right track
Using the Matlab draw the families of orthogonal trajectories for the following differential equation 1) dy /dx = a*x*y /(b*x^2−c*y^2 )
2) dy/ dx = −d*x /e*y
syms y(x) x y
ode = diff(y,x) == (a*x*y)/(b*x^2-c*y^2);
ysol(x) = dsolve(ode)
ezplot(y(x))
error coming up

Akzeptierte Antwort

madhan ravi
madhan ravi am 12 Dez. 2018
Not more than two variables have to be symbolic so a,b,c valyes are assigned:
syms y(x)
a=2;
b=3;
c=5;
ode = diff(y,x) == (a*x*y)/(b*x^2-c*y^2);
ysol = vpa(dsolve(ode));
ezplot(ysol(1))
hold on
ezplot(ysol(2))
ezplot(ysol(3))
  1 Kommentar
Brenda Galabe
Brenda Galabe am 12 Dez. 2018
for second diff equation
syms y(x)
a=2;
b=3;
c=5;
d= 5;
e = 8;
ode = diff(y,x) == (-d*x)/(e*y);
ysol = vpa(dsolve(ode));
ezplot(ysol(1))
hold on
ezplot(ysol(2))
ezplot(ysol(3))
getting this error
index exceeds matrix dimensions.
Error in sym/subsref (line 776)
R_tilde = builtin('subsref',L_tilde,Idx);

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Brenda Galabe
Brenda Galabe am 12 Dez. 2018
thats for the first one correct ? do the same for the second. it worked great thanks
also when i get this error what does it mean
Warning: Explicit solution could not be found;
implicit solution returned.
> In dsolve (line 208)
  5 Kommentare
Brenda Galabe
Brenda Galabe am 13 Dez. 2018
Bearbeitet: madhan ravi am 13 Dez. 2018
FOR THE SECOND EQUATION KEEP GETTING AN EMPTY PLOT
ode = diff(y,x) == (-d*x)/(e*y);
ysol = vpa(dsolve(ode))
ysol =subs(ysol,'C2',25)
fplot(ysol(1))
hold on
fplot(ysol(2))
madhan ravi
madhan ravi am 13 Dez. 2018
syms y(x) C5 %C5 arises in ysol change it to your constant whether C2 or etc.. doesn't matter
d= 5;
e = 8;
dydx=diff(y);
ode = dydx == (-d*x)/(e*y);
ysol = vpa(dsolve(ode));
y1=subs(ysol,C5,4);
fplot({y1(1),y1(2)})
Screen Shot 2018-12-13 at 8.34.46 AM.png

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by