Simulations with 2 Solutions

81 views
Skip to first unread message

Andrew Cook

unread,
May 15, 2025, 12:46:31 PM5/15/25
to Dedalus Users
Hi all,
I have been trying to use Dedalus to model Fredericks Transitions in Liquid Crystals. The equation are written as below.
K*(lap(n_1))=\lambda*n_1
K*(lap(n_2))-1/2*Xa*H**2*n_2=\lambda*n_2
where at the boundaries 0 and L, n_1=1 and n_2=0
lambda is langrage parameter to enforce that the director field (n_1,n_2) is a unit vector. I made a lambda a problem variable and directly enforce the unit vector conditions. I have also tried to remove this condition and set lambda to 0, but this gets similar errors as I will describe below. 

I have been able to solve this problem by using a parameterization and solving using bvp4c in MATLAB. This is the process (the parameterization) from Stewarts 2004 book in section 3.4.1. When I try to solve this problem in Dedalus I encounter an error.

I expect the solution to have a bifurcation after a critical magnetic field strength, but in Dedalus I am only getting the trivial solutions no matter the initial guesses. I want to use Dedalus to model more complicated liquid crystal simulations, so this is just to make sure I have something that is correct to start.

I have tried using my results from the matlab code as initial guesses. I have tried a director field where the angle is a quadratic polynomial with zeros at 0 and L and is equal to pi in the middle, also this is the initial guess I used in the matlab code notably for the non-trivial solutions. Then I have also tried a random normalized solution that satisfies the boundary conditions. All of these initial guesses either diverge as in the pert norm diverges, or the solution is the trivial solution when I expect the non-trivial solution. Note when I say trivial solution, what I mean is just a constant vector field.

Is there something that is glaringly wrong with the method I am using to solve problem? I have been trying a lot of things, but I have been stuck for a while. I have attached my code I am using. 
NLBVP2dEL.py

Keaton Burns

unread,
May 15, 2025, 2:33:05 PM5/15/25
to dedalu...@googlegroups.com
Hi Andrew,

Nothing stands out to me right away, but I can’t test without the data, etc.

I’d suggest starting from your known solutions again, and checking the residuals of each equation after you load the initial conditions (write them out as dedalus expressions, then evaluate and look at the final values).  This should be sensitive to whether all the data handling and equation entry is correct.

If that looks good, then it could be something in the solver/linear algebra stage. One thing to try there would be lowering the NCC cutoff.

Best,
-Keaton


--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dedalus-users/1e1ea1e1-b12a-439f-a858-ba51864d3ce3n%40googlegroups.com.

Andrew Cook

unread,
May 16, 2025, 11:27:15 AM5/16/25
to Dedalus Users
Hi keaton,
Attached is the initial guess I used from the matlab code written to be inputted to dedalus through an h5 file and the matlab code itself. 

I had question about NCC_cutoff, is there any downside to decreasing the NCC_cutoff? If I were to just have an NCC_cutoff of 1e-48, how would that affect the solver compared 1e-6? is the effect negligible after some point?
-Andrew
FredBVP.m
InitialGuess.h5
Reply all
Reply to author
Forward
0 new messages