# Solving a pair of equation using matlab

4 views (last 30 days)
Amey Raj on 5 Oct 2021
how to solve the following pair of equation using MATLAB
y(t) = k*exp(-t/2)*cos(theta + (3^(1/2)*t)/2)
y(t = 0) = 0
Dy(t = 0) = 1
Solve for "k" and "theta"
Dy(t) mean differenttiation of function y(t) w.r.t t
Also return y(t) with values of k and theta inserted

Bjorn Gustavsson on 5 Oct 2021
You have 2 unknown parameters k and theta. You have one condition for y at t=0 and one condition for dy/dt at t=0. Since you have an explicit expression for y(t) you can differentiate that to give you an explicit expression for dy/dt. That will result in 2 expressions for y and dy/dt. This should make it possible to determine the 2 parameters. Simply start by manually differentiating y(t) unsing the product rule.
HTH
Bjorn Gustavsson on 5 Oct 2021
Then the question becomes more of "how to parse user input and interpret that" - once that is solved it should be comparatively easy to build a sum of derivatives of a polynomial or a differential equation. I suggest you open a new question on that.

R2021a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by