0
$\begingroup$

I have a problem with the DSolve operator. It just gives me the initial ODE as an answer, however, obviously, I need to find the answer h[s] as a function of f[s] and its powers (or whatever else). It is an differential-algebraic equation, but I do not have any connection between f[s] and h[s], they're independent.

r[s_, t_] := {s, f[s]*Cos[t], h[s]*Sin[t]} r1[s_, t_] := D[r[s, t], s] // Simplify r2[s_, t_] := D[r[s, t], t] // Simplify g11[s, t] := r1[s, t].r1[s, t] // Simplify g22[s, t] := r2[s, t].r2[s, t] // Simplify g12[s, t] := r1[s, t].r2[s, t] // Simplify detG := g11[s, t] g22[s, t] - g12[s, t] g12[s, t] // Simplify derivG = 1/2*D[detG, s] // FullSimplify DSolve[derivG == 0, h[s], s] 

So, how does one force Mathematica to solve the eqn? Could someone point me on some mistakes if there are any? Thanks in advance.

$\endgroup$
3
  • 3
    $\begingroup$ it is not likely you can get analytical solution for $h(s)$ because your second order ode is nonlinear. how does one force Mathematica to solve the eqn? some ode's can't be solved analytically. In this case you could try numerical solution. $\endgroup$ Commented Sep 18, 2023 at 6:53
  • $\begingroup$ @Nasser but what should I print? Please, I'm begging, help me! I need to find the h[s]... $\endgroup$ Commented Sep 18, 2023 at 7:51
  • $\begingroup$ Maybe you can look at a simpler case of $f(s)=a$, where $a$ is a constant. In this case your equation for $h(s)$ can be solved. $\endgroup$ Commented Jun 14, 2024 at 11:25

1 Answer 1

0
$\begingroup$

but what should I print?

Mathematica can't solve it analytically. Even if you replace all other terms by parameters

ClearAll["Global`*"] r[s_, t_] := {s, f[s]*Cos[t], h[s]*Sin[t]} r1[s_, t_] := D[r[s, t], s] // Simplify r2[s_, t_] := D[r[s, t], t] // Simplify g11[s, t] := r1[s, t] . r1[s, t] // Simplify g22[s, t] := r2[s, t] . r2[s, t] // Simplify g12[s, t] := r1[s, t] . r2[s, t] // Simplify detG = g11[s, t] g22[s, t] - g12[s, t] g12[s, t] // Simplify; derivG = 1/2*D[detG, s] // FullSimplify; ode = derivG == 0 

Mathematica graphics

ode=ode/.{Sin[t]->m,Cos[t]^2->a} 

Mathematica graphics

DSolve[ode,h[s],s] (* no solution *) 

If you must have analytic solution, then the next best thing is series solution (here is one using 3 terms)

ClearAll["Global`*"] r[s_, t_] := {s, f[s]*Cos[t], h[s]*Sin[t]} r1[s_, t_] := D[r[s, t], s] // Simplify r2[s_, t_] := D[r[s, t], t] // Simplify g11[s, t] := r1[s, t] . r1[s, t] // Simplify g22[s, t] := r2[s, t] . r2[s, t] // Simplify g12[s, t] := r1[s, t] . r2[s, t] // Simplify detG = g11[s, t] g22[s, t] - g12[s, t] g12[s, t] // Simplify; derivG = 1/2*D[detG, s] // FullSimplify; ode = derivG == 0; ode=ode/.{Sin[t]->m,Cos[t]^2->a}; sol=AsymptoticDSolveValue[ode, h[s], {s, 0, 3}]; sol/.{m->Sin[t],a->Cos[t]^2} 

Mathematica graphics

The above is the solution $h(s)$ near $s=0$ as function of $f,f',f'',\sin(t),\cos(t)$. The values of $f,f',f''$ at $s=0$ zero are needed to evaluate the above.

$\endgroup$
1
  • $\begingroup$ thank yo VERY much! I'm not a pro in Mathematica, so i didn't know how to calculate the series within the program $\endgroup$ Commented Sep 18, 2023 at 9:22

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.