We more or less have to modify the ODE by hand replacing all appearances of n by 1: f = dsolve( 't^2*D2y+t*Dy+(t^2-1^2)*y', 'y(1)=1', 'y(2)=1', 't') Just defining n = 1Īnd re-evaluating the command f = dsolve(besselODE, 'y(1)=1', 'y(2)=n', 't') ĭoes not work, since the value for n shows up in the string defining the differential equation: besselODE Say you want to assign a special value to n, e.g., n = 1, and solve the equation again using this new value for n. Such string-based input for the dsolve function has some limitations. (n bessely(n, 1) - bessely(n, 2)) besselj(n, t) (n besselj(n, 1) - besselj(n, 2)) bessely(n, t)īesselj(n, 1) bessely(n, 2) - besselj(n, 2) bessely(n, 1)
Here is a typical example that shows how you can solve a Bessel ODE with two given initial values: besselODE = 't^2*D2y+t*Dy+(t^2-n^2)*y' į = dsolve(besselODE, 'y(1)=1', 'y(2)=n', 't') The usual way to solve ordinary differential equations (ODEs) using the Symbolic Math Toolbox dsolve command is to set up the equations using string syntax. Solving Ordinary Differential Equations Using String Input
The Fourier and Inverse Fourier Transforms. Įxample: Using the Different Kinds of Arithmetic.
1-7Ĭonstructing Real and Complex Variables. 1-5Ĭreating Symbolic Variables and Expressions. Third printing for Symbolic Math Toolbox 2.0 Other product or brand names are trademarks or registered trademarks of their respective holders. Target Language Compiler is a trademark of The MathWorks, Inc. MATLAB, Simulink, Stateflow, Handle Graphics, and Real-Time Workshop are registered trademarks, and
Other lease or license agreement that may pertain to, or accompany the delivery of, the computer softwareĪnd accompanying documentation, the rights of the Government regarding its use, reproduction, and disclosure are as set forth in Clause 52.227-19 (c)(2) of the FAR. Rights set forth herein shall apply and (b) For any other unit or agency: NOTICE: Notwithstanding any
Software documentation was obtained, as set forth in subparagraph (a) of the Rights in CommercialĬomputer Software or Commercial Software Documentation Clause at DFARS 227.7202-3, therefore the
Have only the rights specified in the license under which the commercial computer software or commercial Government, the following shall apply: (a) For units of the Department of Defense: the Government shall GOVERNMENT: If Licensee is acquiring the Programs on behalf of any unit or agency of the U.S.
No part of this manual may be photocopied or reproduced in any form without prior written consent from The MathWorks, Inc. Or copied only under the terms of the license agreement. The software described in this document is furnished under a license agreement. COPYRIGHT 1993 - 1998 by The MathWorks, Inc. Order status, license renewals, passcodes