Assigning values to variables after using isolate?
조회 수: 8 (최근 30일)
이전 댓글 표시
Here is my code:
%% Model
syms M n D t r
eqn = M - (1 - 6/(pi^2)) * symsum((1/n^2 * exp((-D*n^2*pi^2*t)/(r^2))),n,0,Inf) == 0;
%% Variables
t = [0.50373, 43.2325, 86.72428, 129.74978, 173.8774, 216.69095];
M = [0.75233, 62.53212, 67.84044, 67.6522, 80.90417, 82.59832];
r = 130/(10^9);
Dsol = isolate(eqn, D)
disp(Dsol)
However, the output is just the solution to Dsol and not the actual array of Dsol values. How can I assign the values to t, M, and r to obtain an array for Dsol?
댓글 수: 0
답변 (1개)
Devineni Aslesha
2020년 6월 22일
In your code, check with the symsum function as it do not return the sum of the series((-D*n^2*pi^2*t)/(r^2))) with respect to the summation index n. You can use the subs function to get the actual array of Dsol values as shown below.
subs(rhs(Dsol),{t,M,r},{t1,M1,r1});
Here, t1 = [0.50373, 43.2325, 86.72428, 129.74978, 173.8774, 216.69095]
M1 = [0.75233, 62.53212, 67.84044, 67.6522, 80.90417, 82.59832] and
r1 = 130/(10^9);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!