0
$\begingroup$

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.

$\endgroup$
0

1 Answer 1

1
$\begingroup$
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"
]
$\endgroup$
2
  • $\begingroup$ This is only for x from 0 to 0.1. what about the second range of x i.e 0.1 to 1? $\endgroup$
    – user75507
    Commented Apr 27, 2021 at 23:49
  • $\begingroup$ AM is unknown c. $\endgroup$
    – user75507
    Commented Apr 27, 2021 at 23:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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