필터 지우기
필터 지우기

How to plotting symbolic solution over range?

조회 수: 3 (최근 30일)
Keith Grey
Keith Grey 2020년 6월 15일
편집: Ameer Hamza 2020년 6월 15일
syms y(x)
ode = x * diff(y, x) == (50) * x * diff(y, x, 2) - (40.3) * x + (101); % DE shown above.
x_dot = dsolve(ode);
plot(195, x_dot)
The value (101) changes with frequency, but I've simplified the equation for minimalism.
I'm trying to plot x_dot vs frequency, but I get:
>> Input must be a function or functions of a single variable.
How can I plot this?
  댓글 수: 1
KSSV
KSSV 2020년 6월 15일
x_dot will be a symbolic expression with x and has two constants C1, C2. You cannot plot using plot.

댓글을 달려면 로그인하십시오.

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 6월 15일
편집: Ameer Hamza 2020년 6월 15일
There is a mistake in the writing of the equations. Also, you need to specify initial conditions to solve for the constant of integrations. Try following code
syms y(x)
dy = diff(y, x, 1);
dy2 = diff(y, x, 2);
ode = dy == (50) * dy2 - (40.3) * x + (101); % DE shown above.
ic = [y(0)==1, dy(0)==0]; % initial conditions
y_sol(x) = dsolve(ode, ic);
fplot(y_sol, [0 10])

카테고리

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

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by