Info
This question is closed. Reopen it to edit or answer.
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
How can i solve this problem with matrices ?
1 view (last 30 days)
Show older comments
How can i solve this problem:
[A]{x}+[B]{x'}+[C]{x''}={K}
A,B,C:known matrices K:known vector (nx1)
and x'' derivative of x' and x' derivative of x(unknown)
15 Comments
Charis Theodorou
on 27 Jun 2014
Can u give me an example??
Sara
on 27 Jun 2014
Set x' = y so that x" = y', then:
A * x + B * y + C * y'= K
x' = y
rewrite as
y' = ...
x' = ...
then from the main code, use ode45 (non-stiff) or ode15s (stiff). Look also here: http://www.mathworks.com/matlabcentral/answers/66301-solve-a-second-order-differential-equation
Charis Theodorou
on 27 Jun 2014
Thanks a lot!! I hope that this is the solution!! If not i will be back.
Roger Stafford
on 27 Jun 2014
I think this is what Sara means: Assuming matrix C is n-by-n and invertible, multiply both sides of your equation by inv(C) to get:
x'' = -(C\B)*x'-(C\A)*x+(C\K)
Now write
x' = y;
y' = -(C\B)*y-(C\A)*x+(C\K)
Your equations are now in standard form for any of the 'ode' solvers. You have 2*n equations to evaluate in each call to your required ode function.
Charis Theodorou
on 27 Jun 2014
Thanks again!!
Charis Theodorou
on 28 Jun 2014
if C has zeros in the last row and column how can i solve it??
Charis Theodorou
on 28 Jun 2014
Also can you remind me how i write the ode45 when i have a vector(nx1) and not a number?
Charis Theodorou
on 28 Jun 2014
I call this function with ode(@diplomatiki, [0 20], zeros(n+3,2))
It might be an error regarding dimensions since I am not sure how to cope with vectors
Charis Theodorou
on 30 Jun 2014
Can you help me with this problem???
Charis Theodorou
on 30 Jun 2014
This is the code !!
Charis Theodorou
on 30 Jun 2014
the equation is: [Mol]{x''}+[Col]{x'}+[Kol]{x}=Z
Charis Theodorou
on 1 Jul 2014
can be solved ??
Answers (0)
See Also
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)