Make a code for these equation and make it right to run it
1 次查看（过去 30 天）
As per my understanding, you would like to write the given Second order differential equations in MATLAB.
MATLAB represents the variables and functions in differential equations using symbolic scalar variables and functions. Assuming x, y(x) as symbolic scalar variable and function, also we represent y’(x) and y” (x) using the inbuilt “diff” function.
Here is the code you can check:
syms x y(x)
eqn = (1+x^2)*diff(y,x,2) - 4*diff(y,x) + 6*y == 0;
eqn1 = diff(y,x,2) - x*diff(y,x) - x^2*y == 0;
eqn2 = diff(y,x,2) - x*y == 0;
eqn, eqn1, eqn2 represents the mentioned 2nd order differential equations.
For further reference, please check out the links to learn more about writing the MATLAB code of differential equations.
I hope this resolves the issue you were facing.