0
$\begingroup$

with "="

with two, "=="

I'm trying to solve with the given parameters,

    1. X = Y = θ = 0
    1. X = Y = 0 and θ = 5°
    1. X = Y = 0 and θ = - 5°
    1. X = Y = 0 and θ = 15°

Any idea what the protected errors are, I made sure to Clear[functions] beforehand. Will the output always give the input because the output for NDSolve was (5,0,0,0..) and if I used (==) it returned True.

$\endgroup$
3
  • 1
    $\begingroup$ Check your equations. Some of them may be using the single = (Set) instead of the double == (Equal). $\endgroup$
    – LouisB
    Feb 25 at 17:50
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Michael E2
    Feb 25 at 19:35
  • $\begingroup$ People here generally like users to post code as Mathematica code instead of just images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. You may find this meta Q&A helpful $\endgroup$
    – Michael E2
    Feb 25 at 19:35
4
$\begingroup$

Few problems. You can't have theta''[0]=0 as initial conditions for second order ode. You can't write Cos[theta], it has to be Cos[theta[t]] since theta depends on time. You also used = where it should be ==.

Also DSolve can solve this. Why use numerical if exact can do it?

m = 10;
iner = 1/2;
L = 1/10;
g = 981/100;
f1 = 50;
f2 = 50;
ode1 = (f1 + f2) Cos[theta[t]] - g == m y''[t];
ode2 = -(f1 + f2) Sin[theta[t]] == m x''[t];
ode3 = -(f1 + f2) L == iner *theta''[t];
ic = {theta[0] == 5, theta'[0] == 0, x[0] == 0, x'[0] == 0, y[0] == 0,y'[0] == 0};
sol  = DSolve[ {ode1, ode2, ode3, ic}, {x[t], y[t], theta[t]}, t]

enter image description here

If you want numerical, then

 sol  = NDSolve[ {ode1, ode2, ode3, ic}, {x, y, theta}, {t, 0, 1}]

enter image description here

Plot[Evaluate[{x[t], y[t], theta[t]} /. sol], {t, 0, 1}, PlotRange -> All]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.