Plotting with dsolve for ODE

3 ビュー (過去 30 日間)
Christian Zimmerman
Christian Zimmerman 2022 年 1 月 20 日
I have created a slope field, now I wish to overlay a single curve for the function that satisfies the equation. below is code so far.
clear
clc
[x,y] = meshgrid(-5:0.4:5,-5:0.4:5);
dydx = x.^2+y.^2-1;
L = sqrt(1+dydx.^2);
quiver(x,y,1./L,dydx./L,'k')
hold on
axis([-3 3 -3 3])
I have attempted to continue like this Unsucccessfuly:
syms y(x)
func = dsolve(diff(y,1) == x^2+y^2-1,y(0) == 0)
fplot(func,[-3 3])
Thank you for your assistance.

回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by