필터 지우기
필터 지우기

Hi, im trying to plot a first ODE, but dont know how to do it. Can somebody help me. Here is the code so far:

조회 수: 1 (최근 30일)
syms a1 a2 a3 ny E tau sigma_c r l delta_phi x(t)
a1 = (E/(2*(1+ny)))*(r/l)*delta_phi;
a2 = (1+ny)/E;
a3 = (9*sqrt(3))/(2*tau*sigma_c)^4;
x(t) = dsolve(diff(x,t) == -(a3/a2)*(x)^4, x(0) == a1)
% Plot t_half and a1 as a function of r
r=0:0.01:1;
t_half = (7*a2)/(3*a1^3*a3)
ezplot(t_half,r)
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 11월 20일
Where is the x in what you want to plot? Where do you give specific values to E, delta_phi, l, ny, r, sigma_c, t, and tau such that you might hope to be able to plot?

댓글을 달려면 로그인하십시오.

채택된 답변

Sebastian K
Sebastian K 2016년 11월 23일
As Walter has suggested, it might be helpful to assign numerical values to your symbolic parameters before using the "dsolve" function.
Currently it seems that "dsolve" is returning multiple solutions to the equation, which is likely caused by the uncertainties associated with all the different symbolic variables.
For instance, if you specify a constant number instead of your parametric initial condition, you will see that "dsolve" returns a unique solution in terms of "t" and your other parameters.
Once you have a solution in this form, you could simply substitute numerical values instead of your symbolic parameters and end up with an explicit solution of "x" in terms of "t".
You could then plot "x" versus "t" using functions such as "subs" or "eval".

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by