It looks like you're new here. If you want to get involved, click one of these buttons!

- 140.8K All Categories
- 103.6K Programming Languages
- 6.5K Assembler Developer
- 1.9K Basic
- 39.9K C and C++
- 2.9K C#
- 7.9K Delphi and Kylix
- 4 Haskell
- 9.7K Java
- 4.1K Pascal
- 1.3K Perl
- 2K PHP
- 543 Python
- 37 Ruby
- 4.4K VB.NET
- 1.6K VBA
- 20.8K Visual Basic
- 2.6K Game programming
- 315 Console programming
- 90 DirectX Game dev
- 1 Minecraft
- 112 Newbie Game Programmers
- 2 Oculus Rift
- 9K Applications
- 1.8K Computer Graphics
- 739 Computer Hardware
- 3.4K Database & SQL
- 535 Electronics development
- 1.6K Matlab
- 628 Sound & Music
- 257 XML Development
- 3.3K Classifieds
- 199 Co-operative Projects
- 198 For sale
- 190 FreeLance Software City
- 1.9K Jobs Available
- 603 Jobs Wanted
- 208 Wanted
- 2.9K Microsoft .NET
- 1.8K ASP.NET
- 1.1K .NET General
- 3.4K Miscellaneous
- 8 Join the Team
- 354 Comments on this site
- 69 Computer Emulators
- 2.1K General programming
- 187 New programming languages
- 626 Off topic board
- 195 Mobile & Wireless
- 67 Android
- 126 Palm Pilot
- 338 Multimedia
- 154 Demo programming
- 184 MP3 programming
- Bash scripts
- 27 Cloud Computing
- 53 FreeBSD
- 1.7K LINUX programming
- 370 MS-DOS
- Shell scripting
- 321 Windows CE & Pocket PC
- 4.1K Windows programming
- 938 Software Development
- 416 Algorithms
- 68 Object Orientation
- 91 Project Management
- 94 Quality & Testing
- 268 Security
- 7.7K WEB-Development
- 1.8K Active Server Pages
- 61 AJAX
- 4 Bootstrap Themes
- 55 CGI Development
- 28 ColdFusion
- 224 Flash development
- 1.4K HTML & WEB-Design
- 1.4K Internet Development
- 2.2K JavaScript
- 36 JQuery
- 300 WEB Servers
- 150 WEB-Services / SOAP

- The problem statement, all variables and given/known data

I am trying to solve a system of 2 ordinary differential equations using matlab. However, I am not able to get numerical solutions from the code despite having keyed in all possible solutions. - Relevant equations

The equations I am given are:

dx/dt=A(x/t)+By

dy/dt=C(x/t^2)+D(y/t)

and the boundary conditions are:

y(1)=0; y(1.2)=-100E6

- The attempt at a solution

My code so far:

%Mechanical Properties of Material

E=200e9;

nu=0.3;

P=100E6;

%Constants A,B,C,D in the Equations

a11= (1/E);

a12= (-nu/E);

a33= (1/E);

A= (a12)/(a11+a12);

B= ((a33)-((2*a12^2)/(a11+a12)));
C= (a11)/(a11^2-a12^2);
D= (2*a12+a11)/(a11+a12);

%Defining the System of 2ODES

syms x(t) y(t)

eqns = [diff(x,t)==A

cond = [y(1) == 0, y(1.2)==-P];

withSimplifications = dsolve(eqns, cond)

withoutSimplifications = dsolve(eqns, cond, 'IgnoreAnalyticConstraints', false)

[xSol(t), ySol(t)] = dsolve(eqns)

The answer is get is

Warning: Explicit solution could not be found.

In dsolve (line 201)

In IsotropicThickWallCylinder (line 18)

xSol(t) =

[ empty sym ]

ySol(t) =

[ empty sym ]

Would really appreciate some help.

Tagged:

Terms of use / Privacy statement / Publisher: Lars Hagelin

Programmers Heaven articles / Programmers Heaven files / Programmers Heaven uploaded content / Programmers Heaven C Sharp ebook / Operated by CommunityHeaven

© 1997-2015 Programmersheaven.com - All rights reserved.

## Comments

1✭Two solutions I can offer:

1) Check your equations to make sure they match the assignment. As far as you have written, you have "dy/dt=C(x/t^2)+D(y/t)" from the assignment but wrote "diff(y,t)==-C(x/t^2)-Dy" in the code (note the negatives).

2) Make sure your syntax for MATLAB is correct. Remember that the statement "Ax + By" turns into "A

x + By" when coding. In the first case, MATLAB understands that you have two variables, Ax and By. In the second case, MATLAB understands you have two variables (x and y) and two defined constants (A and .