Problem 51783. Solve an ODE: equation B
Solution Stats
Problem Comments
-
2 Comments
Chris,
I solved the first test suite symbolically to make sure I was on the right path an got:
[1.0, 6.4839432567518947511762312927844, 9.0049224364695494006414430797622, 8.992494072596270056922480305016, 6.9752731606055591524878412503205, 3.6901871946858786387135688683041, 0].
I am not sure why it would be wrong.
syms y(x)
Dy = diff(y);
a=1;p=0;
X=linspace(1,4,7);
ode=diff(y,x,2)==-Dy/x+(p^2/x^2-a^2)*y;
conds=[y(1)==1, y(4)==0];
ySol(x)=simplify(dsolve(ode,conds));
Y=vpa(ySol(X));
Sorry David. I made a mistake with the signs in the last term of the equation. I "modified" the problem description (quotes intentional). This version should work, but please let me know if it doesn't.
Solution Comments
Show commentsGroup

2021 New Year Cody Competition
- 30 Problems
- 3 Finishers
- Make a random, non-repeating vector.
- Pizza!
- Triangle Numbers
- Generate a vector like 1,2,2,3,3,3,4,4,4,4
- Find nth maximum
- surrounded matrix
- Calculate the area of a triangle between three points
- Return the first and last characters of a character array
- Smallest distance between a point and a rectangle
- N-Queens Checker
- Minefield Sonar
- Get the length of a given vector
- Select every other element of a vector
- Create a vector
- Convert from Fahrenheit to Celsius
- Set the array elements whose value is 13 to 0
- Remove NaN ?
- Find matching string from a list of strings
- The sliding puzzle: 3D
- Draw 'E'
- Find the maximum number of decimal places in a set of numbers
- calculate the day of the year from a date string.
- Reverse the vector
- Matlab Basics - Convert a row vector to a column vector
- Times 2 - START HERE
- Which coins to give
- Fibonacci sequence
- Find max prime number
- Longest Divisor Run
- Perfect Square or not
Problem Recent Solvers8
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!