I'm trying to solve ode45 by this expression [closed] - matlab

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
Can I use this form when i need to solve system of ODE by ode45 on MATLAB
dy(3)=dy(1)*dy(2)+y(3)*y(2)
I mean is my expression correct?
For example how can I solve this:
dy(3)=dy(1)*dy(2)+y(1)
dy(2)=dy(1)-y(2)
dy(1)=dy(2)+dy(3)/y(1)
initial conditions are :
y(1)=1
y(2)=0
y(3)=0

MATLAB solves ordinary differential equations of the form dy/dt = f(t,y), your differential equation is fully implicit, of the form f(t,y,dy/dt) = 0. You can only solve it using ode15i. For more information, refer to the documentation on Ordinary Differential Equations and ode15i.

Related

How does matlab solve a differential equation? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
This question is not about how to use matlab, but trying to find out what is happening when matab is solving a differential equation. Results are often different when using different numerical methods. i wonder which numerical method is used in matlab.
Matlab has all kinds of numerical solvers available. The basic set can be found at the bottom of this page:
https://www.mathworks.com/help/matlab/math/choose-an-ode-solver.html
If you'd like to know about a particular solver (say ode45) you can scroll to the bottom of the documentation for the given solver (for ode45 it's found here: https://www.mathworks.com/help/matlab/ref/ode45.html). For this solver the paper which explains it is linked. It may, however, be a little obtuse if you are unfamiliar with the general idea behind numerical solvers, so you might consider checking out a more pedagogical text in this area, such as the one at http://numerical.recipes/. You may also consider googling less complicated solvers like the Euler Method or the Runge-Kutta method -- both give you the flavor for how the numerical solvers work.

What does linsolve(A,B) return when the number of equations is larger then number of variables? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I by accident put a matrix A with far more rows then columns into linsolve(A,B). So it should be inconsistent system of equations. However what I got was a 'solution' which fits my task far better. So what exactly does it return when you have more columns then rows?
What you have seems to be an overdetermined linear system, that can be solved by the least-square method.
If your matrix A has more rows than columns (m > n) it means that you have more equations than unknowns, so an exact solution can be almost impossible to find. What you can obtain is a good enough solution that minimizes the error.
You can refer to the page Overdetermined system for more insights.

How do I solve this complexity equation,T(n) = T(n-3)+T(n-5) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
While solving a puzzle, I ended up having a complexity of T(n)=T(n-3)+T(n-5).
I was trying subtraction method. But I am unable to solve this. Please explain what should be the procedure.
This is a linear homogeneous difference equation with constant coeffs.. It is usually solved by transforming it to the complex plane and solving a polynomial.
Without a CS background (as you state), I'm afraid the details wouldn't fit in here. Start with the Wikipedia entry, if you're interested.
If you want to skip to the final solution, here is the Wolfram Alpha for it.

Matrix equations in Matlab [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I am doing an introduction course in MATLAB (I am a beginner) and I'm having trouble solving an issue regarding an equation of matrices.
The equation is
AX = C - BX
I want to solve for the matrix X. No matter how I have tried to solve it I come up either empty handed or with some sort of a syntax error. I think I am missing something fundamental.
Any help on the subject is very much appreciated.
For this equation to be consistent, A and B must have the same size. Therefore, you can re-write your equation as:
(A+B)X = C
This can be solved in MATLAB with:
X = (A+B)\C
Note that this will always find a solution, regardless of the size of A+B:
If A+B is square, you'll find "the" solution.
if A+B is over/underdetermined, it will return a least-squares approximation to X.
It's up to you to decide whether this is desirable or not.
In case C is zero, you might want to use null (or look at svd).

How to find the solution space (x,y,z) for a function f(x,y,z)=0 in MATLAB [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a function, dependant on a vector k=(x,y,z) and a function f(x,y,z)=0, I would like to find the solution space for (x,y,z).
Can this even be done analytically in matlab? I imagine it can be done numerically because my initial thought was to plot the surface created by this function, however this is of no use to me as I have 9 other constants in my equation with no numerical value assigned to them. Many thanks in advance for any help.
EDIT: This is for a polynomial degree 4.
There are no generic, analytical solvers for given function f(x,y,z) neither in matlab, nor in any other language. If such solution would exist, the Riemann hypothesis (and dozens others) would be solved ;)
For simple problems you could use symbolic math toolbox and a solve function:
http://www.mathworks.com/help/symbolic/solve.html
And obbiously there are numerical solvers, which you can use like vpasolve and others
http://www.mathworks.com/help/symbolic/vpasolve.html