MATLAB Answers

Help solving a nonlinear function

3 views (last 30 days)
Hunter Watts
Hunter Watts on 19 Jul 2021
Commented: Hunter Watts on 19 Jul 2021
Hi,
I am currently working on a project where I am trying to code and plot a function in the form of (F1 * S1) + (F2 * S2) + (F3 * S1^2) + (F22 * S2^2) + (2 *F12 * S1 * S2) =>1 where S1 and S2 are known and F1,F2,F3,F22, and F12 are equations that vary in a loop.
If you are familiar with the Tsai Wu failure criterion, that is what I am trying to code to produce the tension and compression values.
I feel like I have gone down a PHD rabbit hole and was trying to see if maybe I was going about it wrong.
My current strategy is to use syms for the variables I am trying to solve for in the "F" equations, then solve the equation, use all the solved equations to solve for the unkowns, then substitute back into the original equation.
The code is extremly sloppy and I am prepared to start over. It currently does not run, although I have gotten it to graph under certain circumstances. I would rather not post my code, just looking for ideas on how to solve the problem.
  2 Comments
Hunter Watts
Hunter Watts on 19 Jul 2021
These are the specific equations. In my original question, F3 is the same as F11 this photo. Also I have disregared the F66 and S6^2 as it is always zero for my use case.
The variables I am trying to graph are actually the sigma_T_1, sigma_C_1, sigma_T_2, and sigma_C_2 from 0 to 360. I was able to get a semi funtional graph (graph was correct up untill 180) with correct values before I left school today. So I belive I am on the right track.
A bit of context for what is going on if it helps. I do research on composites for spacecraft at my university and this is a program that helps calculate the faliure of composites based on ply angles (0,45,90, as well as experimental ones) as well as fiber and matrix material.
Thanks for your help!

Sign in to comment.

Answers (1)

John D'Errico
John D'Errico on 19 Jul 2021
I don't know what it means when you call something an equation that varies in a loop. This is certainly not a PHD level rabbit hole. It does sound as if you are beyond your comfortable depth in the deep end of the pool though.
You have two unknowns. You want to find the locus of points where that inequality is satisfied. If the coefficients were constant, then what you have is a simple conic section. An issue is, depending on those coefficients a conic section can describe anything from a circle, to an elliptical region to a hyperbola or parabola. (Again, not doctoral level, more like high school algebra at that point.)
As a function of what the coefficients are, there is a simple set of rules to determine which conic sectrion applies. So while I don't know what you are trying to say about an equation that varies in a loop, at any iteration in that loop, those parameters are not a function of S1 and S2. And that means, at that point, you have a simple conic section. So plot it, and the set of points that fall on the desired side of the section.
The thing is, what you need to do is break this down into a set of SMALL problems. And that is how you should ALWAYS solve any problem that is too complicated for you to solve. Thus, given the set of CONSTANT coefficients, you can write a simple code that will plot the locus of points that satisfy your inequality. Then worry about how those coefficients will vary in a "loop".
I really cannot say much more than this. This seems to be, on the face of things, a moderately simple problem. Just break it down into smaller problems that you can see how to solve.

Tags

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!