Solving a pair of equation using matlab

2 vues (au cours des 30 derniers jours)
Amey Raj
Amey Raj le 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

Réponses (1)

Bjorn Gustavsson
Bjorn Gustavsson le 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
  7 commentaires
Amey Raj
Amey Raj le 5 Oct 2021
Modifié(e) : Amey Raj le 5 Oct 2021
I could have done that but i have to write the code for something like
Let
y(x) = x^3 + x^2 + x + 1
a(x) is inputed by the user so for example if the user inputs
a(x) = D2 + D + 6
y(x)*a(x) = D2(x^3 + x^2 + x + 1) + D(x^3 + x^2 + x + 1) + 6(x^3 + x^2 + x + 1)
here D2(x^3 + x^2 + x + 1) = 6x + 2 and D is same as before. So D2 is double differential
Sorry about the t in previous comment. My bad
Bjorn Gustavsson
Bjorn Gustavsson le 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.

Connectez-vous pour commenter.

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by