TransWikia.com

initial condition in finite element method

Mathematica Asked on August 17, 2021

I want to apply the initial condition below to the linear element

c(x; 0) = sin(10πx); if x in [0; 0:1] and
c(x; 0) = 0; if x in [0:1; 1].

I tried like

SMTInputData["Threads" -> 1];
plots = {};
nel = 50;
h = 1/nel;
L = 1;
SMTAddDomain[{"[CapitalOmega]", 
   name, {"[Omega] *" -> 1, "ff*" -> 0}}];
SMTMesh["[CapitalOmega]", "L1", {1/h}, {{0, 0}, {L, 0}}];
SMTAddInitialBoundary["X" < 0.1 && "X" = 0 &, "AM", 
  1 -> Function[{n, X}, Sin[10*Pi*X]], "Type" -> "InitialCondition"];
SMTAddInitialBoundary["X" > 0.1 && "X" = 1 &, "AP", 
  1 -> 0, "Type" -> "InitialCondition"];
SMTAnalysis[];

But it shows the error like the initial condition format is wrong?
Thank you in advance.

One Answer

SMTAddInitialBoundary["X" < 0.1 && "X" = 0 &, "AM", 
  1 -> Function[{n, X}, Sin[10*Pi*X]], "Type" -> "InitialCondition"]

What is "AM"? It should be

SMTAddInitialBoundary[
  "X" < 0.1 && "X" = 0 &, 
  1 -> Function[{n, X}, Sin[10*Pi*X]],
  "Type" -> "InitialCondition"
]

Answered by JozeK on August 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP